setPublicKey method

void setPublicKey(
  1. EvpPkey key
)

Sets the Public Key.

Implementation

void setPublicKey(EvpPkey key) {
  _ensureUsable();
  if (_context.bindings.X509_set_pubkey(_cert, key.handle) != 1) {
    throw OpenSslException('Failed to set public key');
  }
}