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;
}
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;
}
Aggregations