Package eu.europa.esig.dss.diagnostic
Class SignatureWrapper
java.lang.Object
eu.europa.esig.dss.diagnostic.AbstractTokenProxy
eu.europa.esig.dss.diagnostic.AbstractSignatureWrapper
eu.europa.esig.dss.diagnostic.SignatureWrapper
- All Implemented Interfaces:
TokenProxy
Contains user-friendly methods to extract information from an
XmlSignature
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns FoundCertificatesProxy to access embedded certificatesReturns FoundRevocationsProxy to access embedded revocation dataReturns a list of archive timestamps for the signatureReturns all non-content timestampsReturns a list of archive timestamps for the signaturebyte[]
Returns binaries of the token, when presentReturns list of found CertifiedRolesgetCity()
Returns the signature production place's city, when presentReturns list of found ClaimedRolesReturns the claimed signing time extracted from the signatureReturns a list of commitment type indicationsReturns all container detached timestamps (used for ASiC containers)Returns the content hints stringReturns the content identifierReturns a list of content timestamps of the signatureReturns the content typeReturns the signature production place's country name, when presentprotected XmlBasicSignature
Returns a basic signature validationprotected List
<XmlChainItem> Returns the token's certificate chainprotected XmlSigningCertificate
Returns the signing certificate of the tokenReturns the signature document identifier of the signatureReturns a DataToBeSigned digestReturns a list of DigestMatchers used in the validation process for a signature or timestampReturns all PDF document timestampsReturns an error messageReturns a list of associated evidence record identifiersReturns a list ofEvidenceRecordWrapper
s associated with the signatureReturns identifiers of all embedded evidence record time-stampsgetId()
Returns the unique identifier of the objectThis method returns a reference extracted from a 'kid' (key identifier) header (used in JAdES)Returns the message-digest for a CMS signatureReturns the MimeTypeReturns a master-signature in case of a counter-signatureReturns a PAdES-specific PDF Revision info NOTE: applicable only for PAdESReturns XMLPolicy description if it is not emptyReturns the signature policy digestReturns the signature policy document specificationReturns DocumentationReferences defined for the signature policyReturns the signature policy Id, when presentReturns an error string occurred during a SignaturePolicy proceeding, when applicableGets the signature policy store descriptionGets the digest of a signature policy containing within the signature policy storeReturns a signature policy store documentation referencesGets the signature policy store idReturns a signature policy store local URIReturns a list of Policy transformations NOTE: used only for XAdES signaturesReturns the signature policy urlReturns the policy UserNoticeReturns the signature production place's postal address, when presentReturns the signature production place's postal code, when presentReturns the signature production place's post office box number, when presentReturns Signature Digest ReferenceReturns a signature filenameReturns the signature level (format)Returns a list if Signer Infos (Signer Information Store) from CAdES CMS Signed DataReturns Signature ScopesReturns all signature timestampsReturns the signature media type NOTE: currently used only in JAdESbyte[]
Gets the SignatureValueReturns list of all found SignedAssertionsgetSignerRoleDetails
(List<XmlSignerRole> listOfSignerRoles) Returns a list ofString
s describing the role for the givenlistOfSignerRoles
Returns list of all found SignerRolesReturns the signature production place's state or province, when presentReturns the signature production place's street address, when presentReturns structural validation error messages, when applicableReturns a list of timestamp IDsReturns a list of validation-data-refs-only- and validation-data- time-stamps for the signatureReturns a list of associated timestampsgetTimestampListByType
(TimestampType timestampType) Returns a list of associated timestamps by typeReturns a list of signature timestamps for the signatureReturns time of /VRI dictionary creation, when 'TU' attribute is present (PAdES only)Returns all corresponding VRI timestamps (PAdES only)boolean
Gets if the A-level of the signature is validboolean
Gets if the B-level of the signature is validboolean
Gets if the current signature counter-signs another signature within the documentboolean
Gets if the signature is a document hash onlyboolean
Gets if the signature is a hash onlyboolean
Gets if the signature policy is ASN.1 processableboolean
Gets if the validated signature policy algorithm matchboolean
Gets if the signature policy digest validation succeedsboolean
Gets if the signature policy has been foundboolean
Checks if a SignaturePolicyIdentifier is presentboolean
Checks if a SignaturePolicyStore unsigned property is presentboolean
Returns if the signature policy's hash should not be compared (zero hash is used)boolean
Checks if the signature's Id is duplicated within the validating documentboolean
Gets if the signature production place is claimed within the signatureboolean
Gets if a signing certificate has been unambiguously identifiedboolean
Gets if a structural validation of the signature is validboolean
Returns if there is the A-Level within the signatureboolean
Returns if there is the T-Level within the signatureboolean
Returns if there is the X-Level within the signatureboolean
Gets if the T-level of the signature is validboolean
Gets if the X-level of the signature is validMethods inherited from class eu.europa.esig.dss.diagnostic.AbstractSignatureWrapper
arePdfModificationsDetected, arePdfObjectModificationsDetected, getContactInfo, getDocMDPPermissions, getFieldMDP, getFilter, getFirstFieldName, getLocation, getModifiedFieldNames, getPdfAnnotationChanges, getPdfAnnotationsOverlapConcernedPages, getPdfExtensionChanges, getPdfPageDifferenceConcernedPages, getPdfSignatureOrFormFillChanges, getPdfUndefinedChanges, getPdfVisualDifferenceConcernedPages, getReason, getSigFieldLock, getSignatureByteRange, getSignatureDictionaryType, getSignatureFieldNames, getSignerName, getSubFilter, isPdfSignatureDictionaryConsistent, isSignatureByteRangeValid
Methods inherited from class eu.europa.esig.dss.diagnostic.AbstractTokenProxy
equals, getCertificateChain, getDigestAlgorithm, getEncryptionAlgorithm, getKeyLengthUsedToSignThisToken, getMaskGenerationFunction, getSignatureAlgorithm, getSigningCertificate, getSigningCertificatePublicKey, getSigningCertificateReference, getSigningCertificateReferences, hashCode, isCertificateChainFromTrustedStore, isSignatureIntact, isSignatureValid, isSigningCertificateReferencePresent, isSigningCertificateReferenceUnique, isTrustedChain, toString
-
Constructor Details
-
SignatureWrapper
Default constructor- Parameters:
signature
-XmlSignature
-
-
Method Details
-
getId
Description copied from interface:TokenProxy
Returns the unique identifier of the object- Returns:
String
id
-
getDAIdentifier
-
getDigestMatchers
Description copied from interface:TokenProxy
Returns a list of DigestMatchers used in the validation process for a signature or timestamp- Specified by:
getDigestMatchers
in interfaceTokenProxy
- Overrides:
getDigestMatchers
in classAbstractTokenProxy
- Returns:
- a list of
XmlDigestMatcher
s
-
getMessageDigest
Returns the message-digest for a CMS signature- Returns:
XmlDigestMatcher
-
getCurrentBasicSignature
Description copied from class:AbstractTokenProxy
Returns a basic signature validation- Specified by:
getCurrentBasicSignature
in classAbstractTokenProxy
- Returns:
XmlBasicSignature
-
getCurrentCertificateChain
Description copied from class:AbstractTokenProxy
Returns the token's certificate chain- Specified by:
getCurrentCertificateChain
in classAbstractTokenProxy
- Returns:
- a list of
XmlChainItem
s
-
getCurrentSigningCertificate
Description copied from class:AbstractTokenProxy
Returns the signing certificate of the token- Specified by:
getCurrentSigningCertificate
in classAbstractTokenProxy
- Returns:
XmlSigningCertificate
-
foundCertificates
Returns FoundCertificatesProxy to access embedded certificates- Specified by:
foundCertificates
in interfaceTokenProxy
- Overrides:
foundCertificates
in classAbstractTokenProxy
- Returns:
FoundCertificatesProxy
-
foundRevocations
Returns FoundRevocationsProxy to access embedded revocation data- Specified by:
foundRevocations
in interfaceTokenProxy
- Overrides:
foundRevocations
in classAbstractTokenProxy
- Returns:
FoundRevocationsProxy
-
getSignatureFilename
-
isStructuralValidationValid
public boolean isStructuralValidationValid()Gets if a structural validation of the signature is valid- Returns:
- TRUE if the structure of the signature is valid, FALSE otherwise
-
getStructuralValidationMessages
-
getClaimedSigningTime
-
getContentType
-
getMimeType
-
getContentHints
-
getContentIdentifier
-
isCounterSignature
public boolean isCounterSignature()Gets if the current signature counter-signs another signature within the document- Returns:
- TRUE if the signature is counter-signature, FALSE otherwise
-
isSignatureDuplicated
public boolean isSignatureDuplicated()Checks if the signature's Id is duplicated within the validating document- Returns:
- TRUE if there is a duplicated signature Id, FALSE otherwise
-
getSignatureDigestReference
Returns Signature Digest Reference- Returns:
XmlSignatureDigestReference
-
getDataToBeSignedRepresentation
Returns a DataToBeSigned digest- Returns:
XmlDigestAlgoAndValue
-
getTimestampList
Returns a list of associated timestamps- Returns:
- a list of
TimestampWrapper
s
-
getTimestampListByType
Returns a list of associated timestamps by type- Parameters:
timestampType
-TimestampType
to get timestamps- Returns:
- a list of
TimestampWrapper
s
-
getEvidenceRecords
Returns a list ofEvidenceRecordWrapper
s associated with the signature- Returns:
- a list of
EvidenceRecordWrapper
s
-
getEvidenceRecordIdsList
-
getEvidenceRecordTimestampIds
-
isSignatureProductionPlacePresent
public boolean isSignatureProductionPlacePresent()Gets if the signature production place is claimed within the signature- Returns:
- TRUE if the signature production place is present, FALSE otherwise
-
getStreetAddress
-
getCity
-
getCountryName
-
getPostOfficeBoxNumber
-
getPostalCode
-
getStateOrProvince
-
getPostalAddress
-
getSignatureFormat
Returns the signature level (format)- Returns:
SignatureLevel
-
getSignatureType
-
getErrorMessage
-
isSigningCertificateIdentified
public boolean isSigningCertificateIdentified()Gets if a signing certificate has been unambiguously identified- Returns:
- TRUE if the signing certificate has been identifier, FALSE otherwise
-
getPolicyId
-
isPolicyZeroHash
public boolean isPolicyZeroHash()Returns if the signature policy's hash should not be compared (zero hash is used)- Returns:
- TRUE if zero hash has been used, FALSE otherwise
-
getPolicyDigestAlgoAndValue
Returns the signature policy digest- Returns:
XmlPolicyDigestAlgoAndValue
-
isPolicyStorePresent
public boolean isPolicyStorePresent()Checks if a SignaturePolicyStore unsigned property is present- Returns:
- TRUE if SignaturePolicyStore is present, FALSE otherwise
-
getPolicyStoreId
-
getPolicyStoreDescription
-
getPolicyStoreDigestAlgoAndValue
Gets the digest of a signature policy containing within the signature policy store- Returns:
XmlDigestAlgoAndValue
-
getPolicyStoreDocumentationReferences
-
getPolicyStoreLocalURI
-
isBLevelTechnicallyValid
public boolean isBLevelTechnicallyValid()Gets if the B-level of the signature is valid- Returns:
- TRUE if the B-level of the signature is valid, FALSE otherwise
-
isThereXLevel
public boolean isThereXLevel()Returns if there is the X-Level within the signature- Returns:
- TRUE if there is the X-Level, FALSE otherwise
-
isXLevelTechnicallyValid
public boolean isXLevelTechnicallyValid()Gets if the X-level of the signature is valid- Returns:
- TRUE if the X-level of the signature is valid, FALSE otherwise
-
getTimestampLevelX
Returns a list of validation-data-refs-only- and validation-data- time-stamps for the signature- Returns:
- a list of
TimestampWrapper
s
-
isThereALevel
public boolean isThereALevel()Returns if there is the A-Level within the signature- Returns:
- TRUE if there is the A-Level, FALSE otherwise
-
isALevelTechnicallyValid
public boolean isALevelTechnicallyValid()Gets if the A-level of the signature is valid- Returns:
- TRUE if the A-level of the signature is valid, FALSE otherwise
-
getALevelTimestamps
Returns a list of archive timestamps for the signature- Returns:
- a list of
TimestampWrapper
s
-
getArchiveTimestamps
Returns a list of archive timestamps for the signature- Returns:
- a list of
TimestampWrapper
s
-
isThereTLevel
public boolean isThereTLevel()Returns if there is the T-Level within the signature- Returns:
- TRUE if there is the T-Level, FALSE otherwise
-
isTLevelTechnicallyValid
public boolean isTLevelTechnicallyValid()Gets if the T-level of the signature is valid- Returns:
- TRUE if the T-level of the signature is valid, FALSE otherwise
-
getTLevelTimestamps
Returns a list of signature timestamps for the signature- Returns:
- a list of
TimestampWrapper
s
-
getContentTimestamps
Returns a list of content timestamps of the signature- Returns:
- a list of
TimestampWrapper
s
-
getAllTimestampsProducedAfterSignatureCreation
Returns all non-content timestamps- Returns:
- a list of
TimestampWrapper
s
-
getSignatureTimestamps
Returns all signature timestamps- Returns:
- a list of
TimestampWrapper
s
-
getDocumentTimestamps
Returns all PDF document timestamps- Returns:
- a list of
TimestampWrapper
s
-
getContainerTimestamps
Returns all container detached timestamps (used for ASiC containers)- Returns:
- a list of
TimestampWrapper
s
-
getVRITimestamps
Returns all corresponding VRI timestamps (PAdES only)- Returns:
- a list of
TimestampWrapper
s
-
getTimestampIdsList
-
getKeyIdentifierReference
This method returns a reference extracted from a 'kid' (key identifier) header (used in JAdES)- Returns:
CertificateRefWrapper
-
getParent
Returns a master-signature in case of a counter-signature- Returns:
SignatureWrapper
-
getSignatureScopes
Returns Signature Scopes- Returns:
- a list of
XmlSignatureScope
s
-
getSignerRoles
Returns list of all found SignerRoles- Returns:
- list of
XmlSignerRole
s
-
getClaimedRoles
Returns list of found ClaimedRoles- Returns:
- list of
XmlSignerRole
s
-
getCertifiedRoles
Returns list of found CertifiedRoles- Returns:
- list of
XmlSignerRole
s
-
getSignedAssertions
Returns list of all found SignedAssertions- Returns:
- list of
XmlSignerRole
s
-
getSignerRoleDetails
Returns a list ofString
s describing the role for the givenlistOfSignerRoles
- Parameters:
listOfSignerRoles
- - list ofXmlSignerRole
to get string role details from- Returns:
- list of role details
-
getCommitmentTypeIndications
Returns a list of commitment type indications- Returns:
- a lust of
XmlCommitmentTypeIndication
s
-
isPolicyPresent
public boolean isPolicyPresent()Checks if a SignaturePolicyIdentifier is present- Returns:
- TRUE if a SignaturePolicyIdentifier is found, FALSE otherwise
-
getPolicyProcessingError
-
getPolicyDescription
-
getPolicyDocumentationReferences
-
getPolicyTransforms
-
getPolicyUrl
-
getPolicyUserNotice
-
getPolicyDocSpecification
Returns the signature policy document specification- Returns:
XmlSPDocSpecification
-
isPolicyAsn1Processable
public boolean isPolicyAsn1Processable()Gets if the signature policy is ASN.1 processable- Returns:
- TRUE if the signature policy is ASN.1, FALSE otherwise
-
isPolicyIdentified
public boolean isPolicyIdentified()Gets if the signature policy has been found- Returns:
- TRUE if the signature policy has been found, FALSE otherwise
-
isPolicyDigestValid
public boolean isPolicyDigestValid()Gets if the signature policy digest validation succeeds- Returns:
- TRUE if the signature policy digest are valid, FALSE otherwise
-
isPolicyDigestAlgorithmsEqual
public boolean isPolicyDigestAlgorithmsEqual()Gets if the validated signature policy algorithm match- Returns:
- TRUE if the signature policy digest algorithms match, FALSE otherwise
-
getPDFRevision
Returns a PAdES-specific PDF Revision info NOTE: applicable only for PAdES- Specified by:
getPDFRevision
in classAbstractSignatureWrapper
- Returns:
PDFRevisionWrapper
-
getSignatureInformationStore
Returns a list if Signer Infos (Signer Information Store) from CAdES CMS Signed Data- Returns:
- list of
XmlSignerInfo
s
-
getVRIDictionaryCreationTime
-
getSignatureValue
public byte[] getSignatureValue()Gets the SignatureValue- Returns:
- binaries
-
isDocHashOnly
public boolean isDocHashOnly()Gets if the signature is a document hash only- Returns:
- TRUE if the signature is a document hash only, FALSE otherwise
-
isHashOnly
public boolean isHashOnly()Gets if the signature is a hash only- Returns:
- TRUE if the signature is a hash only, FALSE otherwise
-
getBinaries
public byte[] getBinaries()Description copied from class:AbstractTokenProxy
Returns binaries of the token, when present- Specified by:
getBinaries
in classAbstractTokenProxy
- Returns:
- a byte array
-