Example usage for org.bouncycastle.asn1.ess ContentIdentifier getValue

List of usage examples for org.bouncycastle.asn1.ess ContentIdentifier getValue

Introduction

In this page you can find the example usage for org.bouncycastle.asn1.ess ContentIdentifier getValue.

Prototype

public ASN1OctetString getValue() 

Source Link

Usage

From source file:eu.europa.ec.markt.dss.validation102853.cades.CAdESSignature.java

License:Open Source License

@Override
public String getContentIdentifier() {

    final AttributeTable signedAttributes = signerInformation.getSignedAttributes();
    if (signedAttributes == null) {
        return null;
    }/*from   ww w. ja  v a 2  s .c  o  m*/
    final Attribute contentIdentifierAttribute = signedAttributes
            .get(PKCSObjectIdentifiers.id_aa_contentIdentifier);
    if (contentIdentifierAttribute == null) {
        return null;
    }
    final ASN1Encodable asn1Encodable = contentIdentifierAttribute.getAttrValues().getObjectAt(0);
    final ContentIdentifier contentIdentifier = ContentIdentifier.getInstance(asn1Encodable);
    final String contentIdentifierString = DSSASN1Utils.toString(contentIdentifier.getValue());
    return contentIdentifierString;
}