loadPublicKeyPem method

EvpPkey loadPublicKeyPem(
  1. String pem
)
inherited

Carrega um Chave Pública de PEM.

Implementation

EvpPkey loadPublicKeyPem(String pem) {
  final bio = createBioFromString(pem);
  try {
    final pkey = bindings.PEM_read_bio_PUBKEY(bio, nullptr, nullptr, nullptr);
    if (pkey == nullptr) throw OpenSslException('Failed to read public key');
    return EvpPkey(pkey, this as dynamic);
  } finally {
    freeBio(bio);
  }
}