* create a public key from the given public key info object.
*/
static PublicKey createPublicKeyFromPublicKeyInfo(
SubjectPublicKeyInfo info)
{
AlgorithmIdentifier algId = info.getAlgorithmId();
if (algId.getObjectId().equals(PKCSObjectIdentifiers.rsaEncryption)
|| algId.getObjectId().equals(X509ObjectIdentifiers.id_ea_rsa))
{
return new JCERSAPublicKey(info);
}
else if (algId.getObjectId().equals(PKCSObjectIdentifiers.dhKeyAgreement))
{
return new JCEDHPublicKey(info);
}
else if (algId.getObjectId().equals(X9ObjectIdentifiers.dhpublicnumber))
{
return new JCEDHPublicKey(info);
}
else if (algId.getObjectId().equals(X9ObjectIdentifiers.id_dsa))
{
return new JDKDSAPublicKey(info);
}
else if (algId.getObjectId().equals(OIWObjectIdentifiers.dsaWithSHA1))
{
return new JDKDSAPublicKey(info);
}
else
{