Example usage for org.bouncycastle.asn1.x9 X9ObjectIdentifiers dhpublicnumber

List of usage examples for org.bouncycastle.asn1.x9 X9ObjectIdentifiers dhpublicnumber

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.x9 X9ObjectIdentifiers dhpublicnumber.

Prototype

ASN1ObjectIdentifier dhpublicnumber

To view the source code for org.bouncycastle.asn1.x9 X9ObjectIdentifiers dhpublicnumber.

Click Source Link

Document

Diffie-Hellman
 dhpublicnumber OBJECT IDENTIFIER ::= { iso(1) member-body(2)  us(840) ansi-x942(10046) number-type(2) 1 } 
OID: 1.2.840.10046.2.1

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