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(),
privStruct.getPrime1(),
privStruct.getPrime2(),
privStruct.getExponent1(),
privStruct.getExponent2(),
privStruct.getCoefficient());
AsymmetricBlockCipher cipher = new OAEPEncoding(new RSAEngine());
cipher.init(true, new ParametersWithRandom(pubParameters, new Rand()));