Search in sources :

Example 6 with SignaturePolicy

use of org.demoiselle.signer.policy.engine.asn1.etsi.SignaturePolicy in project signer by demoiselle.

the class CAdESTimeStampSigner method setSignaturePolicy.

@Override
public void setSignaturePolicy(PolicyFactory.Policies signaturePolicy) {
    PolicyFactory policyFactory = PolicyFactory.getInstance();
    org.demoiselle.signer.policy.engine.asn1.etsi.SignaturePolicy sp = policyFactory.loadPolicy(signaturePolicy);
    this.signaturePolicy = sp;
}
Also used : PolicyFactory(org.demoiselle.signer.policy.engine.factory.PolicyFactory) SignaturePolicy(org.demoiselle.signer.policy.engine.asn1.etsi.SignaturePolicy)

Example 7 with SignaturePolicy

use of org.demoiselle.signer.policy.engine.asn1.etsi.SignaturePolicy in project signer by demoiselle.

the class PolicyFactory method loadPolicy.

// TODO - Carregar politica em formato XML
public SignaturePolicy loadPolicy(Policies policy) {
    SignaturePolicy signaturePolicy = new SignaturePolicy();
    InputStream is = this.getClass().getResourceAsStream(policy.getFile());
    ASN1Primitive primitive = this.readANS1FromStream(is);
    signaturePolicy.parse(primitive);
    signaturePolicy.setSignPolicyURI(policy.getUrl());
    return signaturePolicy;
}
Also used : SignaturePolicy(org.demoiselle.signer.policy.engine.asn1.etsi.SignaturePolicy) FileInputStream(java.io.FileInputStream) ASN1InputStream(org.bouncycastle.asn1.ASN1InputStream) InputStream(java.io.InputStream) ASN1Primitive(org.bouncycastle.asn1.ASN1Primitive)

Aggregations

SignaturePolicy (org.demoiselle.signer.policy.engine.asn1.etsi.SignaturePolicy)4 PolicyFactory (org.demoiselle.signer.policy.engine.factory.PolicyFactory)4 IOException (java.io.IOException)3 X509Certificate (java.security.cert.X509Certificate)3 ASN1ObjectIdentifier (org.bouncycastle.asn1.ASN1ObjectIdentifier)3 Attribute (org.bouncycastle.asn1.cms.Attribute)3 AttributeTable (org.bouncycastle.asn1.cms.AttributeTable)3 CMSException (org.bouncycastle.cms.CMSException)3 CMSProcessableByteArray (org.bouncycastle.cms.CMSProcessableByteArray)3 CMSSignedData (org.bouncycastle.cms.CMSSignedData)3 SignerInformation (org.bouncycastle.cms.SignerInformation)3 SignerInformationStore (org.bouncycastle.cms.SignerInformationStore)3 BouncyCastleProvider (org.bouncycastle.jce.provider.BouncyCastleProvider)3 OperatorCreationException (org.bouncycastle.operator.OperatorCreationException)3 SignerException (org.demoiselle.signer.policy.impl.cades.SignerException)3 CertificateEncodingException (java.security.cert.CertificateEncodingException)2 ParseException (java.text.ParseException)2 Date (java.util.Date)2 LinkedList (java.util.LinkedList)2 ASN1UTCTime (org.bouncycastle.asn1.ASN1UTCTime)2