Class JAdESSignature
java.lang.Object
eu.europa.esig.dss.validation.DefaultAdvancedSignature
eu.europa.esig.dss.jades.validation.JAdESSignature
- All Implemented Interfaces:
IdentifierBasedObject
,AdvancedSignature
,Serializable
Represents the JAdES signature
- See Also:
-
Field Summary
Fields inherited from class eu.europa.esig.dss.validation.DefaultAdvancedSignature
counterSignatures, detachedContents, manifestFile, offlineCertificateSource, offlineCertificateVerifier, referenceValidations, signatureCRLSource, signatureCryptographicVerification, signatureIdentifier, signatureOCSPSource, signaturePolicy, signatureTimestampSource, signingCertificateSource, structureValidationMessages
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addExternalTimestamp
(TimestampToken timestamp) This method allows to add an external timestamp.protected SignaturePolicy
This method extracts a signature policy from a signature and builds the objectvoid
Verifies the signature integrity; checks if the signed content has not been tampered with.protected BaselineRequirementsChecker
Instantiates aBaselineRequirementsChecker
according to the signature formatGets a certificate source which contains ALL certificates embedded in the signature.Returns the certified roles of the signer.Returns the claimed roles of the signer.This method obtains the information concerning commitment type indication linked to the signatureReturns the value of the signed attribute content-typeReturns a list of counter signatures applied to this signatureGets a CRL source which contains ALL CRLs embedded in the signature.This method returns an identifier provided by the Driving Application (DA) Note: used only for XAdESThis method returns the signature levelTS 119 102-1 (4.2.8 Data to be signed representation (DTBSR)) : The DTBS preparation component shall take the DTBSF and hash it according to the hash algorithm specified in the cryptographic suite.Retrieves the digest algorithm used for generating the signature.Retrieves the encryption algorithm used for generating the signature.Returns unsigned properties embedded into the 'etsiU' arraygetJws()
Gets the associatedJWS
getKid()
Gets Kid value when presentRetrieves the mask generation function used for generating the signature.Gets a 'cSig' component embedding the current signatureReturns the value of the signed attribute mime-typeGets an OCSP source which contains ALL OCSP responses embedded in the signature.Returns a list of original documents signed by the signatureReturns individual validation foreach reference (XAdES, JAdES) or for the message-imprint (CAdES)Returns a mechanism used in 'sigD' to cover a detached contentRetrieves the signature algorithm (or cipher) used for generating the signature.getSignatureDigestReference
(DigestAlgorithm digestAlgorithm) Returns a signature reference element as defined in TS 119 442 - V1.1.1 - Electronic Signatures and Infrastructures (ESI), ch.Specifies the format of the signatureprotected SignatureIdentifierBuilder
Returns a builder to define and build a signature IdReturns the Signature Policy Store from the signatureReturns information about the place where the signature was generatedbyte[]
Returns the digital signature valueReturns the list of embedded signed assertions.Returns a list of signed documents by the list of URIs present in 'sigD' Keeps the original order according to 'pars' dictionary content Used in HTTPHeaders detached signature mechanismThis method returns a list of documents for ObjectIdByUrl or ObjectIdByUriHash mechanisms Keeps the original order according to 'pars' dictionary contentReturns the signing time included within the signature.Gets a Signature Timestamp source which contains ALL timestamps embedded in the signature.boolean
Checks if the JAdES Signature is a detached (contains 'sigD' dictionary)void
setMasterCSigComponent
(EtsiUComponent masterCSigComponent) Sets a 'cSig' component embedding the current signatureThis method processes the structure validation of the signature.Methods inherited from class eu.europa.esig.dss.validation.DefaultAdvancedSignature
areAllSelfSignedCertificates, equals, findSignatureScope, getAllTimestamps, getArchiveTimestamps, getBaselineRequirementsChecker, getCandidatesForSigningCertificate, getCertificates, getCompleteCertificateSource, getCompleteCRLSource, getCompleteOCSPSource, getContainerContents, getContentTimestamps, getCounterSignaturesCertificateSource, getCounterSignaturesCRLSource, getCounterSignaturesOCSPSource, getDetachedContents, getDetachedTimestamps, getDocumentTimestamps, getDSSId, getId, getManifestFile, getMasterSignature, getSignatureCryptographicVerification, getSignatureFilename, getSignaturePolicy, getSignatureScopes, getSignatureTimestamps, getSignerRoles, getSigningCertificateToken, getStructureValidationResult, getTimestampsX1, getTimestampsX2, hasBProfile, hashCode, hasLTAProfile, hasLTProfile, hasTProfile, isCounterSignature, isDocHashOnlyValidation, isHashOnlyValidation, prepareOfflineCertificateVerifier, resetCertificateSource, resetRevocationSources, resetTimestampSource, setContainerContents, setDetachedContents, setManifestFile, setMasterSignature, setSignatureFilename, setSigningCertificateSource, toString
-
Constructor Details
-
JAdESSignature
Default constructor- Parameters:
jws
-JWS
-
-
Method Details
-
getJws
Gets the associatedJWS
- Returns:
JWS
-
getSignatureForm
Description copied from interface:AdvancedSignature
Specifies the format of the signature- Returns:
SignatureForm
-
getSignatureAlgorithm
Description copied from interface:AdvancedSignature
Retrieves the signature algorithm (or cipher) used for generating the signature.- Returns:
SignatureAlgorithm
-
getEncryptionAlgorithm
Description copied from interface:AdvancedSignature
Retrieves the encryption algorithm used for generating the signature.- Returns:
EncryptionAlgorithm
-
getDigestAlgorithm
Description copied from interface:AdvancedSignature
Retrieves the digest algorithm used for generating the signature.- Returns:
DigestAlgorithm
-
getMaskGenerationFunction
Description copied from interface:AdvancedSignature
Retrieves the mask generation function used for generating the signature.- Returns:
MaskGenerationFunction
-
getSigningTime
Description copied from interface:AdvancedSignature
Returns the signing time included within the signature.- Returns:
Date
representing the signing time or null
-
isDetachedSignature
public boolean isDetachedSignature()Checks if the JAdES Signature is a detached (contains 'sigD' dictionary)- Returns:
- TRUE if the signature is detached, FALSE otherwise
-
getMasterCSigComponent
Gets a 'cSig' component embedding the current signature- Returns:
EtsiUComponent
'cSig' embedding the current signature
-
setMasterCSigComponent
Sets a 'cSig' component embedding the current signature- Parameters:
masterCSigComponent
-Object
'cSig' embedding the current signature
-
getCertificateSource
Description copied from interface:AdvancedSignature
Gets a certificate source which contains ALL certificates embedded in the signature.- Returns:
SignatureCertificateSource
-
getCRLSource
Description copied from interface:AdvancedSignature
Gets a CRL source which contains ALL CRLs embedded in the signature.- Returns:
OfflineRevocationSource
-
getOCSPSource
Description copied from interface:AdvancedSignature
Gets an OCSP source which contains ALL OCSP responses embedded in the signature.- Returns:
OfflineRevocationSource
-
getTimestampSource
Description copied from interface:AdvancedSignature
Gets a Signature Timestamp source which contains ALL timestamps embedded in the signature.- Returns:
SignatureTimestampSource
-
getSignatureProductionPlace
Description copied from interface:AdvancedSignature
Returns information about the place where the signature was generated- Returns:
SignatureProductionPlace
-
getSignaturePolicyStore
Description copied from interface:AdvancedSignature
Returns the Signature Policy Store from the signature- Returns:
SignaturePolicyStore
-
getCommitmentTypeIndications
Description copied from interface:AdvancedSignature
This method obtains the information concerning commitment type indication linked to the signature- Returns:
- a list of
CommitmentTypeIndication
s
-
getContentType
Description copied from interface:AdvancedSignature
Returns the value of the signed attribute content-type- Returns:
- content type as
String
-
getMimeType
Description copied from interface:AdvancedSignature
Returns the value of the signed attribute mime-type- Returns:
- mime type as
String
-
getCertifiedSignerRoles
Description copied from interface:AdvancedSignature
Returns the certified roles of the signer.- Returns:
- list of the
SignerRole
s
-
getClaimedSignerRoles
Description copied from interface:AdvancedSignature
Returns the claimed roles of the signer.- Returns:
- list of the
SignerRole
s
-
getSignedAssertions
Description copied from interface:AdvancedSignature
Returns the list of embedded signed assertions.- Returns:
- list of the assertions s
-
getCounterSignatures
Description copied from interface:AdvancedSignature
Returns a list of counter signatures applied to this signature- Returns:
- a
List
ofAdvancedSignatures
representing the counter signatures
-
getDAIdentifier
Description copied from interface:AdvancedSignature
This method returns an identifier provided by the Driving Application (DA) Note: used only for XAdES- Returns:
- The signature identifier
-
buildSignaturePolicy
Description copied from class:DefaultAdvancedSignature
This method extracts a signature policy from a signature and builds the object- Specified by:
buildSignaturePolicy
in classDefaultAdvancedSignature
- Returns:
SignaturePolicy
-
getSignatureValue
public byte[] getSignatureValue()Description copied from interface:AdvancedSignature
Returns the digital signature value- Returns:
- digital signature value byte array
-
getEtsiUHeader
Returns unsigned properties embedded into the 'etsiU' array- Returns:
JAdESEtsiUHeader
-
getSignatureDigestReference
Description copied from interface:AdvancedSignature
Returns a signature reference element as defined in TS 119 442 - V1.1.1 - Electronic Signatures and Infrastructures (ESI), ch. 5.1.4.2.1.3 XML component- Parameters:
digestAlgorithm
-DigestAlgorithm
to use- Returns:
SignatureDigestReference
-
getDataToBeSignedRepresentation
Description copied from interface:AdvancedSignature
TS 119 102-1 (4.2.8 Data to be signed representation (DTBSR)) : The DTBS preparation component shall take the DTBSF and hash it according to the hash algorithm specified in the cryptographic suite.- Returns:
Digest
DTBSR, which is then used to create the signature.
-
getSignatureIdentifierBuilder
Description copied from class:DefaultAdvancedSignature
Returns a builder to define and build a signature Id- Specified by:
getSignatureIdentifierBuilder
in classDefaultAdvancedSignature
- Returns:
SignatureIdentifierBuilder
-
checkSignatureIntegrity
public void checkSignatureIntegrity()Description copied from interface:AdvancedSignature
Verifies the signature integrity; checks if the signed content has not been tampered with. In the case of a non-AdES signature no including the signing certificate then the latter must be provided by callingsetProvidedSigningCertificateToken
In the case of a detached signature the signed content must be provided by callingsetProvidedSigningCertificateToken
-
getReferenceValidations
Description copied from interface:AdvancedSignature
Returns individual validation foreach reference (XAdES, JAdES) or for the message-imprint (CAdES)- Returns:
- a list with one or more
ReferenceValidation
-
getKid
Gets Kid value when present- Returns:
String
-
getSigDMechanism
Returns a mechanism used in 'sigD' to cover a detached content- Returns:
SigDMechanism
-
getSignedDocumentsByHTTPHeaderName
Returns a list of signed documents by the list of URIs present in 'sigD' Keeps the original order according to 'pars' dictionary content Used in HTTPHeaders detached signature mechanism- Returns:
- a list of
DSSDocument
s
-
getSignedDocumentsForObjectIdByUriMechanism
This method returns a list of documents for ObjectIdByUrl or ObjectIdByUriHash mechanisms Keeps the original order according to 'pars' dictionary content- Returns:
- a list of
DSSDocument
s
-
getOriginalDocuments
Returns a list of original documents signed by the signature- Returns:
- a list of
DSSDocument
s
-
getDataFoundUpToLevel
Description copied from interface:AdvancedSignature
This method returns the signature level- Returns:
- a value of
SignatureLevel
-
createBaselineRequirementsChecker
Description copied from class:DefaultAdvancedSignature
Instantiates aBaselineRequirementsChecker
according to the signature format- Specified by:
createBaselineRequirementsChecker
in classDefaultAdvancedSignature
- Returns:
BaselineRequirementsChecker
-
validateStructure
Description copied from class:DefaultAdvancedSignature
This method processes the structure validation of the signature.- Overrides:
validateStructure
in classDefaultAdvancedSignature
- Returns:
- list of
String
errors
-
addExternalTimestamp
Description copied from interface:AdvancedSignature
This method allows to add an external timestamp. The given timestamp must be processed before. NOTE: The method is supported only for CAdES signatures- Parameters:
timestamp
- the timestamp token
-