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

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

Introduction

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

Prototype

public static ContentIdentifier getInstance(Object o) 

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;
    }/* w  w w .ja  v  a  2s . c om*/
    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;
}