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 voidcheckSignatureIntegrity()Verifies the signature integrity; checks if the signed content has not been tampered with.SignatureCertificateSourcegetCertificateSource()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 signatureStringgetContentType()Returns the value of the signed attribute content-typeList<AdvancedSignature>getCounterSignatures()Returns a list of counter signatures applied to this signatureOfflineCRLSourcegetCRLSource()Gets a CRL source which contains ALL CRLs embedded in the signature.StringgetDAIdentifier()This method returns an identifier provided by the Driving Application (DA) Note: used only for XAdESSignatureLevelgetDataFoundUpToLevel()This method returns the signature levelDigestgetDataToBeSignedRepresentation()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.DigestAlgorithmgetDigestAlgorithm()Retrieves the digest algorithm used for generating the signature.EncryptionAlgorithmgetEncryptionAlgorithm()Retrieves the encryption algorithm used for generating the signature.JAdESEtsiUHeadergetEtsiUHeader()Returns unsigned properties embedded into the 'etsiU' arrayJWSgetJws()Gets the associatedJWSStringgetKid()MaskGenerationFunctiongetMaskGenerationFunction()Retrieves the mask generation function used for generating the signature.EtsiUComponentgetMasterCSigComponent()Gets a 'cSig' component embedding the current signatureStringgetMimeType()Returns the value of the signed attribute mime-typeOfflineOCSPSourcegetOCSPSource()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)SigDMechanismgetSigDMechanism()Returns a mechanism used in 'sigD' to cover a detached contentSignatureAlgorithmgetSignatureAlgorithm()Retrieves the signature algorithm (or cipher) used for generating the signature.SignatureDigestReferencegetSignatureDigestReference(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 componentSignatureFormgetSignatureForm()Specifies the format of the signatureprotected SignatureIdentifierBuildergetSignatureIdentifierBuilder()Returns a builder to define and build a signature IdSignaturePolicygetSignaturePolicy()Returns the Signature Policy OID from the signature.SignaturePolicyStoregetSignaturePolicyStore()Returns the Signature Policy Store from the signatureSignatureProductionPlacegetSignatureProductionPlace()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 mechanismDategetSigningTime()Returns the signing time included within the signature.JAdESTimestampSourcegetTimestampSource()Gets a Signature Timestamp source which contains ALL timestamps embedded in the signature.booleanisDetachedSignature()Checks if the JAdES Signature is a detached (contains 'sigD' dictionary)voidsetMasterCSigComponent(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:AdvancedSignatureSpecifies the format of the signature- Returns:
SignatureForm
-
getSignatureAlgorithm
Description copied from interface:AdvancedSignatureRetrieves the signature algorithm (or cipher) used for generating the signature.- Returns:
SignatureAlgorithm
-
getEncryptionAlgorithm
Description copied from interface:AdvancedSignatureRetrieves the encryption algorithm used for generating the signature.- Returns:
EncryptionAlgorithm
-
getDigestAlgorithm
Description copied from interface:AdvancedSignatureRetrieves the digest algorithm used for generating the signature.- Returns:
DigestAlgorithm
-
getMaskGenerationFunction
Description copied from interface:AdvancedSignatureRetrieves the mask generation function used for generating the signature.- Returns:
MaskGenerationFunction
-
getSigningTime
Description copied from interface:AdvancedSignatureReturns the signing time included within the signature.- Returns:
Daterepresenting 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:AdvancedSignatureGets a certificate source which contains ALL certificates embedded in the signature.- Returns:
SignatureCertificateSource
-
getCRLSource
Description copied from interface:AdvancedSignatureGets a CRL source which contains ALL CRLs embedded in the signature.- Returns:
OfflineRevocationSource
-
getOCSPSource
Description copied from interface:AdvancedSignatureGets an OCSP source which contains ALL OCSP responses embedded in the signature.- Returns:
OfflineRevocationSource
-
getTimestampSource
Description copied from interface:AdvancedSignatureGets a Signature Timestamp source which contains ALL timestamps embedded in the signature.- Returns:
SignatureTimestampSource
-
getSignatureProductionPlace
Description copied from interface:AdvancedSignatureReturns information about the place where the signature was generated- Returns:
SignatureProductionPlace
-
getSignaturePolicyStore
Description copied from interface:AdvancedSignatureReturns the Signature Policy Store from the signature- Returns:
SignaturePolicyStore
-
getCommitmentTypeIndications
Description copied from interface:AdvancedSignatureThis method obtains the information concerning commitment type indication linked to the signature- Returns:
- a list of
CommitmentTypeIndications
-
getContentType
Description copied from interface:AdvancedSignatureReturns the value of the signed attribute content-type- Returns:
- content type as
String
-
getMimeType
Description copied from interface:AdvancedSignatureReturns the value of the signed attribute mime-type- Returns:
- mime type as
String
-
getCertifiedSignerRoles
Description copied from interface:AdvancedSignatureReturns the certified roles of the signer.- Returns:
- list of the
SignerRoles
-
getClaimedSignerRoles
Description copied from interface:AdvancedSignatureReturns the claimed roles of the signer.- Returns:
- list of the
SignerRoles
-
getSignedAssertions
Description copied from interface:AdvancedSignatureReturns the list of embedded signed assertions.- Returns:
- list of the assertions s
-
getCounterSignatures
Description copied from interface:AdvancedSignatureReturns a list of counter signatures applied to this signature- Returns:
- a
ListofAdvancedSignaturesrepresenting the counter signatures
-
getDAIdentifier
Description copied from interface:AdvancedSignatureThis method returns an identifier provided by the Driving Application (DA) Note: used only for XAdES- Returns:
- The signature identifier
-
getSignaturePolicy
Description copied from interface:AdvancedSignatureReturns the Signature Policy OID from the signature.- Returns:
SignaturePolicy
-
getSignatureValue
public byte[] getSignatureValue()Description copied from interface:AdvancedSignatureReturns 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:AdvancedSignatureReturns 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-DigestAlgorithmto use- Returns:
SignatureDigestReference
-
getDataToBeSignedRepresentation
Description copied from interface:AdvancedSignatureTS 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:
DigestDTBSR, which is then used to create the signature.
-
getSignatureIdentifierBuilder
Description copied from class:DefaultAdvancedSignatureReturns a builder to define and build a signature Id- Specified by:
getSignatureIdentifierBuilderin classDefaultAdvancedSignature- Returns:
SignatureIdentifierBuilder
-
checkSignatureIntegrity
public void checkSignatureIntegrity()Description copied from interface:AdvancedSignatureVerifies 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 callingsetProvidedSigningCertificateTokenIn the case of a detached signature the signed content must be provided by callingsetProvidedSigningCertificateToken -
getReferenceValidations
Description copied from interface:AdvancedSignatureReturns 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
DSSDocuments
-
getOriginalDocuments
Returns a list of original documents signed by the signature- Returns:
- a list of
DSSDocuments
-
getDataFoundUpToLevel
Description copied from interface:AdvancedSignatureThis method returns the signature level- Returns:
- a value of
SignatureLevel
-
validateStructure
Description copied from class:DefaultAdvancedSignatureThis method processes the structure validation of the signature.- Overrides:
validateStructurein classDefaultAdvancedSignature- Returns:
- list of
Stringerrors
-