toPublicKeyPem method
Exports Public Key to PEM format (SubjectPublicKeyInfo).
Implementation
String toPublicKeyPem() {
final bio = _context.createBio();
try {
final result = _context.bindings.PEM_write_bio_PUBKEY(bio, handle);
if (result != 1) throw OpenSslException('Failed to write public key to PEM');
return _context.bioToString(bio);
} finally {
_context.freeBio(bio);
}
}