Example usage for org.bouncycastle.asn1.cryptopro CryptoProObjectIdentifiers gostR3410_94

List of usage examples for org.bouncycastle.asn1.cryptopro CryptoProObjectIdentifiers gostR3410_94

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.cryptopro CryptoProObjectIdentifiers gostR3410_94.

Prototype

ASN1ObjectIdentifier gostR3410_94

To view the source code for org.bouncycastle.asn1.cryptopro CryptoProObjectIdentifiers gostR3410_94.

Click Source Link

Document

Gost R3410-94 OID: 1.2.643.2.2.20

Usage

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;//w  w  w . j a va  2  s.  c  o m

    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;
}