AlgorithmIdentifier algId = keyInfo.getAlgorithmId();
if (algId.getObjectId().equals(PKCSObjectIdentifiers.rsaEncryption)
|| algId.getObjectId().equals(X509ObjectIdentifiers.id_ea_rsa))
{
RSAPublicKeyStructure pubKey = new RSAPublicKeyStructure((ASN1Sequence)keyInfo.getPublicKey());
return new RSAKeyParameters(false, pubKey.getModulus(), pubKey.getPublicExponent());
}
else if (algId.getObjectId().equals(PKCSObjectIdentifiers.dhKeyAgreement)
|| algId.getObjectId().equals(X9ObjectIdentifiers.dhpublicnumber))
{
DHParameter params = new DHParameter((ASN1Sequence)keyInfo.getAlgorithmId().getParameters());