Package se.swedenconnect.sigval.pdf.svt
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
Representation of a SVT claims issuer.
- Author:
- Martin Lindström (martin@idsec.se), Stefan Santesson (stefan@idsec.se)
-
Field Summary
Fields inherited from class se.swedenconnect.sigval.svt.issuer.SVTIssuer
certificates, jwsAlgorithm, signer
-
Constructor Summary
ConstructorsConstructorDescriptionPDFSVTSigValClaimsIssuer
(com.nimbusds.jose.JWSAlgorithm algorithm, Object privateKey, List<X509Certificate> certificates, ExtendedPDFSignatureValidator signatureVerifier) Constructor for the PDF SVT claims issuer. -
Method Summary
Modifier and TypeMethodDescriptionprotected se.swedenconnect.sigval.svt.claims.SignedDataClaims
calculateDocRefHash
(org.apache.pdfbox.pdmodel.interactive.digitalsignature.PDSignature sig, byte[] signedDocument, String hashAlgoUri) Performs the basic calculation of the hash of signed data in a PDF document, signed by a particular signatureprotected se.swedenconnect.sigval.svt.claims.SVTProfile
protected List
<se.swedenconnect.sigval.svt.claims.SignatureClaims> 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 processMethods inherited from class se.swedenconnect.sigval.commons.svt.AbstractSVTSigValClaimsIssuer
extractTimeValClaims, getB64Hash, getCertRef, getSignaturePolicyValidations, isCertPathMatch, isVerifiedTime, setDefaultBasicValidation
Methods inherited from class se.swedenconnect.sigval.svt.issuer.SVTIssuer
getSignedSvtJWT, getSvtJwtClaims, validateSignatureSVTClaims, valueTest
-
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 SVTprivateKey
- the private key used to sign the SVTcertificates
- certificates for validating the signature on the SVTsignatureVerifier
- signature verifier used to validate the signature on the PDF document- Throws:
com.nimbusds.jose.JOSEException
- on JWT errorsNoSuchAlgorithmException
- 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 classse.swedenconnect.sigval.svt.issuer.SVTIssuer<byte[]>
- Parameters:
signedDocument
- the signed document to validate- Throws:
IOException
- on errorSignatureException
-
getSvtProfile
protected se.swedenconnect.sigval.svt.claims.SVTProfile getSvtProfile()- Specified by:
getSvtProfile
in classse.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
- SignaturesignedDocument
- signed documenthashAlgoUri
- hash algorithm URI identifier- Returns:
- Signed document data hashes
- Throws:
IOException
- parsing errorsNoSuchAlgorithmException
- unsupported algorithm
-