parsePrivate static method
Parses the PEM key no matter it is private, it will figure it out.
Implementation
static RSAPrivateKey parsePrivate(String privateKey) {
var index = 0;
if ((index = privateKey.indexOf(beginRsaPrivateKey)) != -1) {
index = index + beginRsaPrivateKey.length;
} else if ((index = privateKey.indexOf(beginPrivateKey)) != -1) {
index = index + beginPrivateKey.length;
} else {
index = 0;
}
return _parsePrivate(_parseSequence(index, privateKey)) as RSAPrivateKey;
}