Class JAdESSignature
java.lang.Object
eu.europa.esig.dss.spi.signature.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.spi.signature.DefaultAdvancedSignature
counterSignatures, detachedContents, manifestFile, offlineCertificateSource, referenceValidations, signatureCRLSource, signatureCryptographicVerification, signatureIdentifier, signatureOCSPSource, signaturePolicy, signatureTimestampSource, signingCertificateSource, structureValidationMessages -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExternalTimestamp(TimestampToken timestamp) This method allows to add an external timestamp.protected SignaturePolicyThis method extracts a signature policy from a signature and builds the objectvoidVerifies the signature integrity; checks if the signed content has not been tampered with.protected JAdESBaselineRequirementsCheckercreateBaselineRequirementsChecker(CertificateVerifier certificateVerifier) Instantiates aBaselineRequirementsCheckeraccording to the signature formatprotected List<SignatureScope> Finds signature scopesGets 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 associatedJWSgetKid()Gets Kid value when presentDeprecated.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. 5.1.4.2.1.3 XML componentSpecifies the format of the signatureprotected SignatureIdentifierBuilderReturns a builder to define and build a signature IdReturns the Signature Policy Store from the signatureReturns information about the place where the signature was generatedReturns value of the "typ" header parameter, declaring the media type of the JWS, when present.byte[]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.booleanChecks if the JAdES Signature is a detached (contains 'sigD' dictionary)voidsetMasterCSigComponent(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.spi.signature.DefaultAdvancedSignature
addExternalEvidenceRecord, areAllSelfSignedCertificates, equals, getAllEvidenceRecords, getAllTimestamps, getArchiveTimestamps, getBaselineRequirementsChecker, getCandidatesForSigningCertificate, getCertificates, getCompleteCertificateSource, getCompleteCRLSource, getCompleteOCSPSource, getContainerContents, getContentTimestamps, getCounterSignaturesCertificateSource, getCounterSignaturesCRLSource, getCounterSignaturesOCSPSource, getDetachedContents, getDetachedEvidenceRecords, getDetachedTimestamps, getDocumentTimestamps, getDSSId, getEmbeddedEvidenceRecords, getId, getManifestFile, getMasterSignature, getSignatureCryptographicVerification, getSignatureFilename, getSignaturePolicy, getSignatureScopes, getSignatureTimestamps, getSignerRoles, getSigningCertificateToken, getStructureValidationResult, getTimestampsX1, getTimestampsX2, hasAProfile, hasBESProfile, hasBProfile, hasCProfile, hasEPESProfile, hasExtendedTProfile, hashCode, hasLTAProfile, hasLTProfile, hasTProfile, hasXLProfile, hasXProfile, initBaselineRequirementsChecker, isCounterSignature, isDocHashOnlyValidation, isHashOnlyValidation, resetCertificateSource, resetRevocationSources, resetTimestampSource, setContainerContents, setDetachedContents, setManifestFile, setMasterSignature, setSignatureFilename, setSigningCertificateSource, toString
-
Constructor Details
-
JAdESSignature
-
-
Method Details
-
getJws
-
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
Deprecated.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
-
getSignatureType
-
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
-
buildSignaturePolicy
Description copied from class:DefaultAdvancedSignatureThis method extracts a signature policy from a signature and builds the object- Specified by:
buildSignaturePolicyin classDefaultAdvancedSignature- 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, JAdES) 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
-
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
DSSDocuments
-
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
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
-
createBaselineRequirementsChecker
protected JAdESBaselineRequirementsChecker createBaselineRequirementsChecker(CertificateVerifier certificateVerifier) Description copied from class:DefaultAdvancedSignatureInstantiates aBaselineRequirementsCheckeraccording to the signature format- Specified by:
createBaselineRequirementsCheckerin classDefaultAdvancedSignature- Parameters:
certificateVerifier-CertificateVerifierto be used- Returns:
BaselineRequirementsChecker
-
validateStructure
Description copied from class:DefaultAdvancedSignatureThis method processes the structure validation of the signature.- Overrides:
validateStructurein classDefaultAdvancedSignature- Returns:
- list of
Stringerrors
-
findSignatureScopes
Description copied from class:DefaultAdvancedSignatureFinds signature scopes- Specified by:
findSignatureScopesin classDefaultAdvancedSignature- Returns:
- a list of
SignatureScopes
-
addExternalTimestamp
Description copied from interface:AdvancedSignatureThis 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
-