RsaPublicKey.unmarshal constructor

RsaPublicKey.unmarshal(
  1. Uint8List bytes
)

Implementation

factory RsaPublicKey.unmarshal(Uint8List bytes){
  final pbKey = pb.PublicKey.fromBuffer(bytes);

  if (pbKey.type != pb.KeyType.RSA) {
    throw FormatException('Not an RSA public key');
  }
  return RsaPublicKey.fromRawBytes(Uint8List.fromList(pbKey.data));

}