List of usage examples for org.bouncycastle.jcajce.provider.asymmetric.dsa DSAUtil isDsaOid
public static boolean isDsaOid(ASN1ObjectIdentifier algOid)
From source file:org.xwiki.crypto.internal.asymmetric.keyfactory.DefaultKeyFactory.java
License:Open Source License
private String getKeyFactoryHint(ASN1Object keyInfo) { ASN1ObjectIdentifier algId = getAlgorithmId(keyInfo); String hint = null;/* ww w. j ava2s .c om*/ if (RSAUtil.isRsaOid(algId)) { hint = "RSA"; } else if (DSAUtil.isDsaOid(algId)) { hint = "DSA"; } else if (algId.equals(PKCSObjectIdentifiers.dhKeyAgreement) || algId.equals(X9ObjectIdentifiers.dhpublicnumber)) { hint = "DH"; } else if (algId.equals(OIWObjectIdentifiers.elGamalAlgorithm)) { hint = "ElGamal"; } else if (algId.equals(CryptoProObjectIdentifiers.gostR3410_94)) { hint = "GOST3410"; } if (hint == null) { throw new UnsupportedOperationException("Asymmetric key algorithm not supported: " + algId.getId()); } return hint; }