Example usage for org.bouncycastle.asn1.esf OtherHash getHashValue

List of usage examples for org.bouncycastle.asn1.esf OtherHash getHashValue

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.esf OtherHash getHashValue.

Prototype

public byte[] getHashValue() 

Source Link

Usage

From source file:eu.europa.ec.markt.dss.validation102853.crl.CRLRef.java

License:Open Source License

/**
 * The default constructor for CRLRef./*from  w  ww . j a va  2  s .c o  m*/
 *
 * @param cmsRef
 * @throws ParseException
 */
public CRLRef(CrlValidatedID cmsRef) {
    try {

        final CrlIdentifier crlIdentifier = cmsRef.getCrlIdentifier();
        if (crlIdentifier != null) {
            crlIssuer = crlIdentifier.getCrlIssuer();
            crlIssuedTime = crlIdentifier.getCrlIssuedTime().getDate();
            crlNumber = crlIdentifier.getCrlNumber();
        }
        final OtherHash crlHash = cmsRef.getCrlHash();

        digestAlgorithm = DigestAlgorithm.forOID(crlHash.getHashAlgorithm().getAlgorithm());
        digestValue = crlHash.getHashValue();
    } catch (ParseException ex) {
        throw new DSSException(ex);
    }
}

From source file:eu.europa.esig.dss.validation.CRLRef.java

License:Open Source License

/**
 * The default constructor for CRLRef./* ww  w .j  a  va 2s  .  com*/
 *
 * @param cmsRef
 * @throws ParseException
 */
public CRLRef(CrlValidatedID cmsRef) {
    try {

        final CrlIdentifier crlIdentifier = cmsRef.getCrlIdentifier();
        if (crlIdentifier != null) {
            crlIssuer = crlIdentifier.getCrlIssuer();
            crlIssuedTime = crlIdentifier.getCrlIssuedTime().getDate();
            crlNumber = crlIdentifier.getCrlNumber();
        }
        final OtherHash crlHash = cmsRef.getCrlHash();

        digestAlgorithm = DigestAlgorithm.forOID(crlHash.getHashAlgorithm().getAlgorithm().getId());
        digestValue = crlHash.getHashValue();
    } catch (ParseException ex) {
        throw new DSSException(ex);
    }
}

From source file:eu.europa.esig.dss.validation.OCSPRef.java

License:Open Source License

/**
 * The default constructor for OCSPRef.//  ww w  . jav a  2 s  . c o  m
 */
public OCSPRef(final OtherHash otherHash, final boolean matchOnlyBasicOCSPResponse) {

    if (otherHash != null) { // -444

        this.digestAlgorithm = DigestAlgorithm.forOID(otherHash.getHashAlgorithm().getAlgorithm().getId());
        this.digestValue = otherHash.getHashValue();
    }
    this.matchOnlyBasicOCSPResponse = matchOnlyBasicOCSPResponse;
}