fromPEM static method

RSAPublicKey fromPEM(
  1. String pemString
)

Create an RSAPublicKey from the given PEM-String.

Implementation

static RSAPublicKey fromPEM(String pemString) {
  final rows = pemString.trim().split(RegExp(r'\r\n?|\n'));
  final privateKeyString = rows
      .skipWhile((row) => row.startsWith('-----BEGIN'))
      .takeWhile((row) => !row.startsWith('-----END'))
      .map((row) => row.trim())
      .join('');
  return RSAPublicKey.fromString(privateKeyString);
}