* create a public key from the given public key info object.
*/
static PublicKey createPublicKeyFromPublicKeyInfo(
SubjectPublicKeyInfo info)
{
DERObjectIdentifier algOid = info.getAlgorithmId().getObjectId();
if (RSAUtil.isRsaOid(algOid))
{
return new JCERSAPublicKey(info);
}
else if (algOid.equals(PKCSObjectIdentifiers.dhKeyAgreement))
{
return new JCEDHPublicKey(info);
}
else if (algOid.equals(X9ObjectIdentifiers.dhpublicnumber))
{
return new JCEDHPublicKey(info);
}
else if (algOid.equals(OIWObjectIdentifiers.elGamalAlgorithm))
{
return new JCEElGamalPublicKey(info);
}
else if (algOid.equals(X9ObjectIdentifiers.id_dsa))
{
return new JDKDSAPublicKey(info);
}
else if (algOid.equals(OIWObjectIdentifiers.dsaWithSHA1))
{
return new JDKDSAPublicKey(info);
}
else if (algOid.equals(X9ObjectIdentifiers.id_ecPublicKey))
{
return new JCEECPublicKey(info);
}
else if (algOid.equals(CryptoProObjectIdentifiers.gostR3410_94))
{
return new JDKGOST3410PublicKey(info);
}
else if (algOid.equals(CryptoProObjectIdentifiers.gostR3410_2001))
{
return new JCEECPublicKey(info);
}
else
{