rsaPublicKeyToPEM function

String rsaPublicKeyToPEM(
  1. RSAPublicKey publicKey
)

Export a RSAPublicKey as PEM String which can be reversed using RSAPublicKey.fromPEM.

Implementation

String rsaPublicKeyToPEM(RSAPublicKey publicKey) {
  return '-----BEGIN PUBLIC KEY-----\n${rsaPublicKeyToString(publicKey)}\n-----END PUBLIC KEY-----';
}