getPKCS1Encoded method

String getPKCS1Encoded()

Implementation

String getPKCS1Encoded() {
  final pubKeySequence = ASN1Sequence();
  pubKeySequence.add(ASN1Integer(publicKey.modulus!));
  pubKeySequence.add(ASN1Integer(publicKey.exponent!));
  final dataBase64 = base64Encode(pubKeySequence.encodedBytes);

  return '-----BEGIN RSA PUBLIC KEY-----\n$dataBase64\n-----END RSA PUBLIC KEY-----';
}