List of usage examples for org.bouncycastle.asn1.ess ContentHints getContentType
public ASN1ObjectIdentifier getContentType()
From source file:eu.europa.ec.markt.dss.validation102853.cades.CAdESSignature.java
License:Open Source License
@Override public String getContentHints() { final AttributeTable signedAttributes = signerInformation.getSignedAttributes(); if (signedAttributes == null) { return null; }/*from w w w . ja v a2 s.co m*/ final Attribute contentHintAttribute = signedAttributes.get(PKCSObjectIdentifiers.id_aa_contentHint); if (contentHintAttribute == null) { return null; } final ASN1Encodable asn1Encodable = contentHintAttribute.getAttrValues().getObjectAt(0); final ContentHints contentHints = ContentHints.getInstance(asn1Encodable); final String contentHintsContentType = contentHints.getContentType().toString(); final String contentHintsContentDescription = contentHints.getContentDescription().getString(); final String contentHint = contentHintsContentType + " [" + contentHintsContentDescription + "]"; return contentHint; }
From source file:eu.europa.esig.dss.cades.validation.CAdESSignature.java
License:Open Source License
@Override public String getContentHints() { final AttributeTable signedAttributes = signerInformation.getSignedAttributes(); if (signedAttributes == null) { return null; }//from ww w. j a v a2 s. c om final Attribute contentHintAttribute = signedAttributes.get(PKCSObjectIdentifiers.id_aa_contentHint); if (contentHintAttribute == null) { return null; } final ASN1Encodable asn1Encodable = contentHintAttribute.getAttrValues().getObjectAt(0); final ContentHints contentHints = ContentHints.getInstance(asn1Encodable); String contentHint = null; if (contentHints != null) { // content-type is mandatory contentHint = contentHints.getContentType().toString(); // content-description is optional if (contentHints.getContentDescription() != null) { contentHint += " [" + contentHints.getContentDescription().toString() + "]"; } } return contentHint; }