List of usage examples for org.bouncycastle.asn1.esf SignaturePolicyIdentifier isSignaturePolicyImplied
boolean isSignaturePolicyImplied
To view the source code for org.bouncycastle.asn1.esf SignaturePolicyIdentifier isSignaturePolicyImplied.
Click Source Link
From source file:eu.europa.ec.markt.dss.signature.cades.CAdESProfileEPES.java
License:Open Source License
@Override public Hashtable<ASN1ObjectIdentifier, ASN1Encodable> getSignedAttributes(SignatureParameters parameters) { try {//w ww. j av a2 s .c om Hashtable<ASN1ObjectIdentifier, ASN1Encodable> signedAttrs = super.getSignedAttributes(parameters); Attribute policy = null; SignaturePolicyIdentifier sigPolicy = null; switch (parameters.getSignaturePolicy()) { case EXPLICIT: sigPolicy = new SignaturePolicyIdentifier( new SignaturePolicyId(new DERObjectIdentifier(parameters.getSignaturePolicyId()), new OtherHashAlgAndValue( new AlgorithmIdentifier(DigestAlgorithm .getByName(parameters.getSignaturePolicyHashAlgo()).getOid()), new DEROctetString(parameters.getSignaturePolicyHashValue())))); policy = new Attribute(PKCSObjectIdentifiers.id_aa_ets_sigPolicyId, new DERSet(sigPolicy)); signedAttrs.put(PKCSObjectIdentifiers.id_aa_ets_sigPolicyId, policy); break; case IMPLICIT: sigPolicy = new SignaturePolicyIdentifier(); sigPolicy.isSignaturePolicyImplied(); policy = new Attribute(PKCSObjectIdentifiers.id_aa_ets_sigPolicyId, new DERSet(sigPolicy)); signedAttrs.put(PKCSObjectIdentifiers.id_aa_ets_sigPolicyId, policy); break; case NO_POLICY: break; } return signedAttrs; } catch (NoSuchAlgorithmException ex) { throw new ProfileException(ex.getMessage()); } }