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
Constructors -
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 XmlBasicSignatureReturns a basic signature validationprotected List<XmlChainItem> Returns the token's certificate chainprotected XmlSigningCertificateReturns 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 ofEvidenceRecordWrappers 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 ofStrings describing the role for the givenlistOfSignerRolesReturns 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)booleanGets if the A-level of the signature is validbooleanGets if the B-level of the signature is validbooleanGets if the current signature counter-signs another signature within the documentbooleanGets if the signature is a document hash onlybooleanGets if the signature is a hash onlybooleanGets if the signature policy is ASN.1 processablebooleanGets if the validated signature policy algorithm matchbooleanGets if the signature policy digest validation succeedsbooleanGets if the signature policy has been foundbooleanChecks if a SignaturePolicyIdentifier is presentbooleanChecks if a SignaturePolicyStore unsigned property is presentbooleanReturns if the signature policy's hash should not be compared (zero hash is used)booleanChecks if the signature's Id is duplicated within the validating documentbooleanGets if the signature production place is claimed within the signaturebooleanGets if a signing certificate has been unambiguously identifiedbooleanGets if a structural validation of the signature is validbooleanReturns if there is the A-Level within the signaturebooleanReturns if there is the T-Level within the signaturebooleanReturns if there is the X-Level within the signaturebooleanGets if the T-level of the signature is validbooleanGets 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, isSignatureByteRangeValidMethods 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:TokenProxyReturns the unique identifier of the object- Returns:
Stringid
-
getDAIdentifier
-
getDigestMatchers
Description copied from interface:TokenProxyReturns a list of DigestMatchers used in the validation process for a signature or timestamp- Specified by:
getDigestMatchersin interfaceTokenProxy- Overrides:
getDigestMatchersin classAbstractTokenProxy- Returns:
- a list of
XmlDigestMatchers
-
getMessageDigest
Returns the message-digest for a CMS signature- Returns:
XmlDigestMatcher
-
getCurrentBasicSignature
Description copied from class:AbstractTokenProxyReturns a basic signature validation- Specified by:
getCurrentBasicSignaturein classAbstractTokenProxy- Returns:
XmlBasicSignature
-
getCurrentCertificateChain
Description copied from class:AbstractTokenProxyReturns the token's certificate chain- Specified by:
getCurrentCertificateChainin classAbstractTokenProxy- Returns:
- a list of
XmlChainItems
-
getCurrentSigningCertificate
Description copied from class:AbstractTokenProxyReturns the signing certificate of the token- Specified by:
getCurrentSigningCertificatein classAbstractTokenProxy- Returns:
XmlSigningCertificate
-
foundCertificates
Returns FoundCertificatesProxy to access embedded certificates- Specified by:
foundCertificatesin interfaceTokenProxy- Overrides:
foundCertificatesin classAbstractTokenProxy- Returns:
FoundCertificatesProxy
-
foundRevocations
Returns FoundRevocationsProxy to access embedded revocation data- Specified by:
foundRevocationsin interfaceTokenProxy- Overrides:
foundRevocationsin 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
TimestampWrappers
-
getTimestampListByType
Returns a list of associated timestamps by type- Parameters:
timestampType-TimestampTypeto get timestamps- Returns:
- a list of
TimestampWrappers
-
getEvidenceRecords
Returns a list ofEvidenceRecordWrappers associated with the signature- Returns:
- a list of
EvidenceRecordWrappers
-
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
TimestampWrappers
-
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
TimestampWrappers
-
getArchiveTimestamps
Returns a list of archive timestamps for the signature- Returns:
- a list of
TimestampWrappers
-
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
TimestampWrappers
-
getContentTimestamps
Returns a list of content timestamps of the signature- Returns:
- a list of
TimestampWrappers
-
getAllTimestampsProducedAfterSignatureCreation
Returns all non-content timestamps- Returns:
- a list of
TimestampWrappers
-
getSignatureTimestamps
Returns all signature timestamps- Returns:
- a list of
TimestampWrappers
-
getDocumentTimestamps
Returns all PDF document timestamps- Returns:
- a list of
TimestampWrappers
-
getContainerTimestamps
Returns all container detached timestamps (used for ASiC containers)- Returns:
- a list of
TimestampWrappers
-
getVRITimestamps
Returns all corresponding VRI timestamps (PAdES only)- Returns:
- a list of
TimestampWrappers
-
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
XmlSignatureScopes
-
getSignerRoles
Returns list of all found SignerRoles- Returns:
- list of
XmlSignerRoles
-
getClaimedRoles
Returns list of found ClaimedRoles- Returns:
- list of
XmlSignerRoles
-
getCertifiedRoles
Returns list of found CertifiedRoles- Returns:
- list of
XmlSignerRoles
-
getSignedAssertions
Returns list of all found SignedAssertions- Returns:
- list of
XmlSignerRoles
-
getSignerRoleDetails
Returns a list ofStrings describing the role for the givenlistOfSignerRoles- Parameters:
listOfSignerRoles- - list ofXmlSignerRoleto get string role details from- Returns:
- list of role details
-
getCommitmentTypeIndications
Returns a list of commitment type indications- Returns:
- a lust of
XmlCommitmentTypeIndications
-
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:
getPDFRevisionin classAbstractSignatureWrapper- Returns:
PDFRevisionWrapper
-
getSignatureInformationStore
Returns a list if Signer Infos (Signer Information Store) from CAdES CMS Signed Data- Returns:
- list of
XmlSignerInfos
-
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:AbstractTokenProxyReturns binaries of the token, when present- Specified by:
getBinariesin classAbstractTokenProxy- Returns:
- a byte array
-