ASN1InputStream dIn = new ASN1InputStream(bIn);
//
// extract the public key info.
//
RSAPublicKeyStructure pubStruct;
try
{
pubStruct = new RSAPublicKeyStructure((ASN1Sequence)new SubjectPublicKeyInfo((ASN1Sequence)dIn.readObject()).getPublicKey());
}
catch (Exception e)
{
return new SimpleTestResult(false, getName() + ": exception - " + e.toString());
}
bIn = new ByteArrayInputStream(privKeyEnc);
dIn = new ASN1InputStream(bIn);
//
// extract the private key info.
//
RSAPrivateKeyStructure privStruct;
try
{
privStruct = new RSAPrivateKeyStructure((ASN1Sequence)(new PrivateKeyInfo((ASN1Sequence)dIn.readObject()).getPrivateKey()));
}
catch (Exception e)
{
return new SimpleTestResult(false, getName() + ": exception - " + e.toString());
}
RSAKeyParameters pubParameters = new RSAKeyParameters(
false,
pubStruct.getModulus(),
pubStruct.getPublicExponent());
RSAKeyParameters privParameters = new RSAPrivateCrtKeyParameters(
privStruct.getModulus(),
privStruct.getPublicExponent(),
privStruct.getPrivateExponent(),