loadPublicKeyBytes method

EvpPkey loadPublicKeyBytes(
  1. Uint8List bytes
)
inherited

Loads a public key from DER or PEM, whichever bytes holds.

Implementation

EvpPkey loadPublicKeyBytes(Uint8List bytes) {
  final looksPem = bytes.length > 10 &&
      String.fromCharCodes(bytes.sublist(0, 11)) == '-----BEGIN ';
  return looksPem
      ? loadPublicKeyPem(String.fromCharCodes(bytes))
      : loadPublicKeyDer(bytes);
}