Example usage for org.bouncycastle.asn1.pkcs PKCSObjectIdentifiers md4

List of usage examples for org.bouncycastle.asn1.pkcs PKCSObjectIdentifiers md4

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.pkcs PKCSObjectIdentifiers md4.

Prototype

ASN1ObjectIdentifier md4

To view the source code for org.bouncycastle.asn1.pkcs PKCSObjectIdentifiers md4.

Click Source Link

Document

1.2.840.113549.2.4

Usage

From source file:org.candlepin.util.X509CRLStreamWriter.java

License:Open Source License

protected static Digest createDigest(AlgorithmIdentifier digAlg) throws CryptoException {
    Digest dig;/*from  w  ww.j ava  2  s .co  m*/

    if (digAlg.getAlgorithm().equals(OIWObjectIdentifiers.idSHA1)) {
        dig = new SHA1Digest();
    } else if (digAlg.getAlgorithm().equals(NISTObjectIdentifiers.id_sha224)) {
        dig = new SHA224Digest();
    } else if (digAlg.getAlgorithm().equals(NISTObjectIdentifiers.id_sha256)) {
        dig = new SHA256Digest();
    } else if (digAlg.getAlgorithm().equals(NISTObjectIdentifiers.id_sha384)) {
        dig = new SHA384Digest();
    } else if (digAlg.getAlgorithm().equals(NISTObjectIdentifiers.id_sha512)) {
        dig = new SHA384Digest();
    } else if (digAlg.getAlgorithm().equals(PKCSObjectIdentifiers.md5)) {
        dig = new MD5Digest();
    } else if (digAlg.getAlgorithm().equals(PKCSObjectIdentifiers.md4)) {
        dig = new MD4Digest();
    } else {
        throw new CryptoException("Cannot recognize digest.");
    }

    return dig;
}