use of xades4j.properties.SignaturePolicyBase in project xades4j by luisgoncalves.
the class SignerTTest method testSignTWithPolicy.
@Test
public void testSignTWithPolicy() throws Exception {
System.out.println("signTWithPolicy");
Document doc = getTestDocument();
Element elemToSign = doc.getDocumentElement();
SignerT signer = (SignerT) new XadesTSigningProfile(keyingProviderMy).withPolicyProvider(new SignaturePolicyInfoProvider() {
@Override
public SignaturePolicyBase getSignaturePolicy() {
return new SignaturePolicyImpliedProperty();
}
}).newSigner();
new Enveloped(signer).sign(elemToSign);
outputDocument(doc, "document.signed.t.epes.xml");
}
use of xades4j.properties.SignaturePolicyBase in project xades4j by luisgoncalves.
the class PropertiesUtils method addXadesEpesProperties.
public static void addXadesEpesProperties(Collection<SignedSignatureProperty> ssp, SignaturePolicyInfoProvider policyInfoProvider) {
SignaturePolicyBase policyProp = policyInfoProvider.getSignaturePolicy();
if (null == policyProp)
throw new NullPointerException("Null policy");
ssp.add(policyProp);
}
Aggregations