Class SignaturePolicyStoreBuilder


public class SignaturePolicyStoreBuilder extends ExtensionBuilder
Builds a XAdES SignaturePolicyStore
  • Constructor Details

    • SignaturePolicyStoreBuilder

      public SignaturePolicyStoreBuilder()
      Default constructor
  • Method Details

    • addSignaturePolicyStore

      public DSSDocument addSignaturePolicyStore(DSSDocument signatureDocument, SignaturePolicyStore signaturePolicyStore)
      Adds a signaturePolicyStore to all signatures inside the document, matching the incorporated signature policy
      Parameters:
      signatureDocument - DSSDocument containing signatures to add signature policy store into
      signaturePolicyStore - SignaturePolicyStore to add
      Returns:
      DSSDocument with signaturePolicyStore
    • addSignaturePolicyStore

      public DSSDocument addSignaturePolicyStore(DSSDocument signatureDocument, SignaturePolicyStore signaturePolicyStore, String signatureId)
      Adds a signaturePolicyStore to a signature with the given signatureId, if the signature policy identifier matches the policy provided within SignaturePolicyStore
      Parameters:
      signatureDocument - DSSDocument containing signatures to add signature policy store into
      signaturePolicyStore - SignaturePolicyStore to add
      signatureId - String Id of a signature to add SignaturePolicyStore for
      Returns:
      DSSDocument with signaturePolicyStore
    • addSignaturePolicyStoreIfDigestMatch

      protected boolean addSignaturePolicyStoreIfDigestMatch(XAdESSignature xadesSignature, Document documentDom, SignaturePolicyStore signaturePolicyStore)
      This method adds SignaturePolicyStore to a documentDom if required
      Parameters:
      xadesSignature - XAdESSignature signature to add SignaturePolicyStore
      documentDom - Document root DOM of the signature document
      signaturePolicyStore - SignaturePolicyStore to be added
      Returns:
      TRUE if the signaturePolicyStore has been added for the particular signature, FALSE otherwise
    • checkDigest

      protected boolean checkDigest(XAdESSignature xadesSignature, SignaturePolicyStore signaturePolicyStore)
      This method verifies if the digests computed in the provided SignaturePolicyStore match the digest defined in the incorporated signature policy identifier
      Parameters:
      xadesSignature - XAdESSignature to check signature policy identifier
      signaturePolicyStore - SignaturePolicyStore to be incorporated
      Returns:
      TRUE if the digest match and SignaturePolicyStore can be embedded, FALSE otherwise