Class PDFSVTSigValClaimsIssuer

java.lang.Object
se.swedenconnect.sigval.svt.issuer.SVTIssuer<byte[]>
se.swedenconnect.sigval.commons.svt.AbstractSVTSigValClaimsIssuer<byte[]>
se.swedenconnect.sigval.pdf.svt.PDFSVTSigValClaimsIssuer

public class PDFSVTSigValClaimsIssuer extends AbstractSVTSigValClaimsIssuer<byte[]>
Representation of a SVT claims issuer.
Author:
Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
  • Constructor Details

    • PDFSVTSigValClaimsIssuer

      public PDFSVTSigValClaimsIssuer(com.nimbusds.jose.JWSAlgorithm algorithm, Object privateKey, List<X509Certificate> certificates, ExtendedPDFSignatureValidator signatureVerifier) throws com.nimbusds.jose.JOSEException, NoSuchAlgorithmException
      Constructor for the PDF SVT claims issuer. This class is not thread safe and an instance of this issuer must be created for each instance of SVT creation.
      Parameters:
      algorithm - the algorithm used to sign the SVT
      privateKey - the private key used to sign the SVT
      certificates - certificates for validating the signature on the SVT
      signatureVerifier - signature verifier used to validate the signature on the PDF document
      Throws:
      com.nimbusds.jose.JOSEException - on JWT errors
      NoSuchAlgorithmException - if the algorithm is not supported
  • Method Details

    • verify

      protected List<se.swedenconnect.sigval.svt.claims.SignatureClaims> verify(byte[] signedDocument, String hashAlgoUri) throws IOException, SignatureException
      This method is called from within the SVT Issuer to perform signature validation and to collect the signature validation claims as a result of this validation process
      Specified by:
      verify in class se.swedenconnect.sigval.svt.issuer.SVTIssuer<byte[]>
      Parameters:
      signedDocument - the signed document to validate
      Throws:
      IOException - on error
      SignatureException
    • getSvtProfile

      protected se.swedenconnect.sigval.svt.claims.SVTProfile getSvtProfile()
      Specified by:
      getSvtProfile in class se.swedenconnect.sigval.svt.issuer.SVTIssuer<byte[]>
    • calculateDocRefHash

      protected se.swedenconnect.sigval.svt.claims.SignedDataClaims calculateDocRefHash(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sig, byte[] signedDocument, String hashAlgoUri) throws IOException, NoSuchAlgorithmException
      Performs the basic calculation of the hash of signed data in a PDF document, signed by a particular signature
      Parameters:
      sig - Signature
      signedDocument - signed document
      hashAlgoUri - hash algorithm URI identifier
      Returns:
      Signed document data hashes
      Throws:
      IOException - parsing errors
      NoSuchAlgorithmException - unsupported algorithm