fromPem static method
Implementation
static List<SSHKeyPair> fromPem(String pemText, [String? passphrase]) {
final pem = SSHPem.decode(pemText);
switch (pem.type) {
case 'OPENSSH PRIVATE KEY':
final pairs = OpenSSHKeyPairs.decode(pem.content);
return pairs.getPrivateKeys(passphrase);
case 'RSA PRIVATE KEY':
final pair = RsaKeyPair.decode(pem);
return [pair.getPrivateKeys(passphrase)];
default:
throw UnsupportedError('Unsupported key type: ${pem.type}');
}
}