Class JAdESSignaturePolicyStoreBuilder
java.lang.Object
eu.europa.esig.dss.jades.signature.JAdESExtensionBuilder
eu.europa.esig.dss.jades.signature.JAdESSignaturePolicyStoreBuilder
The builder used to incorporate a
SignaturePolicyStore
to a
JAdESSignature document-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddSignaturePolicyStore
(DSSDocument document, SignaturePolicyStore signaturePolicyStore, boolean base64UrlInstance) AddssignaturePolicyStore
to all signatures inside thedocument
matching the givenSignaturePolicyStore
.addSignaturePolicyStore
(DSSDocument document, SignaturePolicyStore signaturePolicyStore, boolean base64UrlInstance, String signatureId) AddssignaturePolicyStore
to a signature inside thedocument
with the givensignatureId
protected boolean
addSignaturePolicyStoreIfDigestMatch
(JAdESSignature jadesSignature, SignaturePolicyStore signaturePolicyStore, boolean base64UrlInstance, SignedDocumentValidator documentValidator) This method addsSignaturePolicyStore
to ajadesSignature
if requiredprotected boolean
checkDigest
(JAdESSignature jadesSignature, SignaturePolicyStore signaturePolicyStore, SignedDocumentValidator documentValidator) This method verifies if the digests computed in the providedSignaturePolicyStore
match the digest defined in the incorporated signature policy identifierMethods inherited from class eu.europa.esig.dss.jades.signature.JAdESExtensionBuilder
assertEtsiUComponentsConsistent, assertJSONSerializationObjectMayBeExtended, assertJWSJsonSerializationObjectValid
-
Constructor Details
-
JAdESSignaturePolicyStoreBuilder
public JAdESSignaturePolicyStoreBuilder()Default constructor
-
-
Method Details
-
addSignaturePolicyStore
public DSSDocument addSignaturePolicyStore(DSSDocument document, SignaturePolicyStore signaturePolicyStore, boolean base64UrlInstance) AddssignaturePolicyStore
to all signatures inside thedocument
matching the givenSignaturePolicyStore
.- Parameters:
document
-DSSDocument
containing JAdES signatures to extend with aSignaturePolicyStore
signaturePolicyStore
-SignaturePolicyStore
to incorporatebase64UrlInstance
- TRUE if the signature policy store shall be incorporated as a base64url-encoded component of the 'etsiU' header, FALSE if it will be incorporated in its clear JSON representation- Returns:
DSSDocument
containing signatures withsignaturePolicyStore
-
addSignaturePolicyStore
public DSSDocument addSignaturePolicyStore(DSSDocument document, SignaturePolicyStore signaturePolicyStore, boolean base64UrlInstance, String signatureId) AddssignaturePolicyStore
to a signature inside thedocument
with the givensignatureId
- Parameters:
document
-DSSDocument
containing JAdES signatures to extend with aSignaturePolicyStore
signaturePolicyStore
-SignaturePolicyStore
to incorporatebase64UrlInstance
- TRUE if the signature policy store shall be incorporated as a base64url-encoded component of the 'etsiU' header, FALSE if it will be incorporated in its clear JSON representationsignatureId
-String
id of a signature to add SignaturePolicyStore for- Returns:
DSSDocument
containing signatures withsignaturePolicyStore
-
addSignaturePolicyStoreIfDigestMatch
protected boolean addSignaturePolicyStoreIfDigestMatch(JAdESSignature jadesSignature, SignaturePolicyStore signaturePolicyStore, boolean base64UrlInstance, SignedDocumentValidator documentValidator) This method addsSignaturePolicyStore
to ajadesSignature
if required- Parameters:
jadesSignature
-JAdESSignature
signature to addSignaturePolicyStore
signaturePolicyStore
-SignaturePolicyStore
to be addedbase64UrlInstance
- defines whetherSignaturePolicyStore
shall be incorporated as a base64url-encoded 'etsiU' componentdocumentValidator
-SignedDocumentValidator
used to extract the signature- Returns:
- TRUE if the signaturePolicyStore has been added for the particular signature, FALSE otherwise
-
checkDigest
protected boolean checkDigest(JAdESSignature jadesSignature, SignaturePolicyStore signaturePolicyStore, SignedDocumentValidator documentValidator) This method verifies if the digests computed in the providedSignaturePolicyStore
match the digest defined in the incorporated signature policy identifier- Parameters:
jadesSignature
-JAdESSignature
to check signature policy identifiersignaturePolicyStore
-SignaturePolicyStore
to be incorporateddocumentValidator
-SignedDocumentValidator
JWS document validator used to extract the signature- Returns:
- TRUE if the digest match and
SignaturePolicyStore
can be embedded, FALSE otherwise
-