Class JAdESSignature
java.lang.Object
eu.europa.esig.dss.validation.DefaultAdvancedSignature
eu.europa.esig.dss.jades.validation.JAdESSignature
- All Implemented Interfaces:
AdvancedSignature
,Serializable
public class JAdESSignature extends DefaultAdvancedSignature
Represents the JAdES signature
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class eu.europa.esig.dss.validation.DefaultAdvancedSignature
counterSignatures, detachedContents, manifestFile, offlineCertificateSource, referenceValidations, signatureCRLSource, signatureCryptographicVerification, signatureIdentifier, signatureOCSPSource, signaturePolicy, signatureTimestampSource, signingCertificateSource, structureValidationMessages
-
Constructor Summary
Constructors Constructor Description JAdESSignature(JWS jws)
Default constructor -
Method Summary
Modifier and Type Method Description void
checkSignatureIntegrity()
Verifies the signature integrity; checks if the signed content has not been tampered with.SignatureCertificateSource
getCertificateSource()
Gets a certificate source which contains ALL certificates embedded in the signature.List<SignerRole>
getCertifiedSignerRoles()
Returns the certified roles of the signer.List<SignerRole>
getClaimedSignerRoles()
Returns the claimed roles of the signer.List<CommitmentTypeIndication>
getCommitmentTypeIndications()
This method obtains the information concerning commitment type indication linked to the signatureString
getContentType()
Returns the value of the signed attribute content-typeList<AdvancedSignature>
getCounterSignatures()
Returns a list of counter signatures applied to this signatureOfflineCRLSource
getCRLSource()
Gets a CRL source which contains ALL CRLs embedded in the signature.String
getDAIdentifier()
This method returns an identifier provided by the Driving Application (DA) Note: used only for XAdESSignatureLevel
getDataFoundUpToLevel()
This method returns the signature levelDigest
getDataToBeSignedRepresentation()
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.DigestAlgorithm
getDigestAlgorithm()
Retrieves the digest algorithm used for generating the signature.EncryptionAlgorithm
getEncryptionAlgorithm()
Retrieves the encryption algorithm used for generating the signature.JAdESEtsiUHeader
getEtsiUHeader()
Returns unsigned properties embedded into the 'etsiU' arrayJWS
getJws()
Gets the associatedJWS
String
getKid()
MaskGenerationFunction
getMaskGenerationFunction()
Retrieves the mask generation function used for generating the signature.EtsiUComponent
getMasterCSigComponent()
Gets a 'cSig' component embedding the current signatureString
getMimeType()
Returns the value of the signed attribute mime-typeOfflineOCSPSource
getOCSPSource()
Gets an OCSP source which contains ALL OCSP responses embedded in the signature.List<DSSDocument>
getOriginalDocuments()
Returns a list of original documents signed by the signatureList<ReferenceValidation>
getReferenceValidations()
Returns individual validation foreach reference (XAdES) or for the message-imprint (CAdES)SigDMechanism
getSigDMechanism()
Returns a mechanism used in 'sigD' to cover a detached contentSignatureAlgorithm
getSignatureAlgorithm()
Retrieves the signature algorithm (or cipher) used for generating the signature.SignatureDigestReference
getSignatureDigestReference(DigestAlgorithm digestAlgorithm)
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 componentSignatureForm
getSignatureForm()
Specifies the format of the signatureprotected SignatureIdentifierBuilder
getSignatureIdentifierBuilder()
Returns a builder to define and build a signature IdSignaturePolicy
getSignaturePolicy()
Returns the Signature Policy OID from the signature.SignaturePolicyStore
getSignaturePolicyStore()
Returns the Signature Policy Store from the signatureSignatureProductionPlace
getSignatureProductionPlace()
Returns information about the place where the signature was generatedbyte[]
getSignatureValue()
Returns the digital signature valueList<SignerRole>
getSignedAssertions()
Returns the list of embedded signed assertions.List<DSSDocument>
getSignedDocumentsByUri(boolean caseSensitive)
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 ObjectByUri detached signature mechanismDate
getSigningTime()
Returns the signing time included within the signature.JAdESTimestampSource
getTimestampSource()
Gets a Signature Timestamp source which contains ALL timestamps embedded in the signature.boolean
isDetachedSignature()
Checks if the JAdES Signature is a detached (contains 'sigD' dictionary)void
setMasterCSigComponent(EtsiUComponent masterCSigComponent)
Sets a 'cSig' component embedding the current signatureprotected List<String>
validateStructure()
This method processes the structure validation of the signature.Methods inherited from class eu.europa.esig.dss.validation.DefaultAdvancedSignature
addExternalTimestamp, areAllSelfSignedCertificates, equals, findSignatureScope, getAllTimestamps, getArchiveTimestamps, getCandidatesForSigningCertificate, getCertificates, getCertificateSourcesExceptLastArchiveTimestamp, getCompleteCertificateSource, getCompleteCRLSource, getCompleteOCSPSource, getContainerContents, getContentTimestamps, getCounterSignaturesCertificateSource, getCounterSignaturesCRLSource, getCounterSignaturesOCSPSource, getDetachedContents, getDocumentTimestamps, getDSSId, getId, getManifestFile, getMasterSignature, getSignatureCryptographicVerification, getSignatureFilename, getSignatureScopes, getSignatureTimestamps, getSignatureValidationContext, getSignerRoles, getSigningCertificateToken, getStructureValidationResult, getTimestampsX1, getTimestampsX2, hashCode, hasLTAProfile, hasLTProfile, hasTProfile, isCounterSignature, isDocHashOnlyValidation, isHashOnlyValidation, prepareCounterSignatures, prepareOfflineCertificateVerifier, prepareTimestamps, 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
-
getSignaturePolicy
Description copied from interface:AdvancedSignature
Returns the Signature Policy OID from the signature.- 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) or for the message-imprint (CAdES)- Returns:
- a list with one or more
ReferenceValidation
-
getKid
-
getSigDMechanism
Returns a mechanism used in 'sigD' to cover a detached content- Returns:
SigDMechanism
-
getSignedDocumentsByUri
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 ObjectByUri detached signature mechanism- Parameters:
caseSensitive
- defines if the name value is case-sensitive- 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
-
validateStructure
Description copied from class:DefaultAdvancedSignature
This method processes the structure validation of the signature.- Overrides:
validateStructure
in classDefaultAdvancedSignature
- Returns:
- list of
String
errors
-