Package org.digidoc4j
Interface Signature
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AsicESignature
,AsicSignature
,AsicSSignature
,BDocSignature
,DDocSignature
Signature interface. Provides an interface for handling a signature and the corresponding OCSP response properties.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Returns signature as XAdES XMLgetCity()
Returns the signature production city.Returns the computer's time of signing.Returns the signature production country.getId()
Returns the signature id.Returns the signature OCSP responder certificate.byte[]
Returns the signature OCSP response nonce ornull
if OCSP response is not present or OCSP nonce is not found inside the OCSP response.Returns the signature OCSP producedAt timestamp.Returns the signature production postal code.Returns the signature profile.Returns the signature method that was used for signing.Returns the signer's roles.Returns the signature certificate that was used for signing.Returns the signature production state or province.Returns the signature timestamp generation time.Returns the signature TimeStampToken certificate.Returns signature creation time confirmed by OCSP or TimeStamp authority.Returns the identifier that uniquely identifies this signature.Validates the signature.
-
Method Details
-
getCity
String getCity()Returns the signature production city.- Returns:
- production city
-
getCountryName
String getCountryName()Returns the signature production country.- Returns:
- production country
-
getId
String getId()Returns the signature id.- Returns:
- id
-
getUniqueId
String getUniqueId()Returns the identifier that uniquely identifies this signature.- Returns:
- unique identifier
-
getOCSPNonce
byte[] getOCSPNonce()Returns the signature OCSP response nonce ornull
if OCSP response is not present or OCSP nonce is not found inside the OCSP response.- Returns:
- OCSP response nonce or
null
if not found
-
getOCSPCertificate
X509Cert getOCSPCertificate()Returns the signature OCSP responder certificate.- Returns:
- OCSP responder certificate
-
getPostalCode
String getPostalCode()Returns the signature production postal code.- Returns:
- postal code
-
getOCSPResponseCreationTime
Date getOCSPResponseCreationTime()Returns the signature OCSP producedAt timestamp.- Returns:
- producedAt timestamp
-
getTimeStampCreationTime
Date getTimeStampCreationTime()Returns the signature timestamp generation time.- Returns:
- generation timestamp
-
getTrustedSigningTime
Date getTrustedSigningTime()Returns signature creation time confirmed by OCSP or TimeStamp authority.Returns OCSP response creation time in case of LT_TM (TimeMark) signatures or Time Stamp creation time in case of LT/LTA (TimeStamp) signatures. Returns null for B_BES signatures.
This is much more secure than using signer's computer time that
getClaimedSigningTime()
returns.- Returns:
- signature creation time confirmed by OCSP or TimeStamp authority.
-
getProfile
SignatureProfile getProfile()Returns the signature profile.- Returns:
- profile
-
getSignatureMethod
String getSignatureMethod()Returns the signature method that was used for signing.- Returns:
- signature method
-
getSignerRoles
Returns the signer's roles.- Returns:
- signer roles
-
getSigningCertificate
X509Cert getSigningCertificate()Returns the signature certificate that was used for signing.- Returns:
- signature certificate
-
getClaimedSigningTime
Date getClaimedSigningTime()Returns the computer's time of signing.See also
getTrustedSigningTime()
- Returns:
- signing time
-
getStateOrProvince
String getStateOrProvince()Returns the signature production state or province.- Returns:
- production state or province
-
getTimeStampTokenCertificate
X509Cert getTimeStampTokenCertificate()Returns the signature TimeStampToken certificate. For a DDOC Signature it throws a NotYetImplementedException.- Returns:
- TimeStampToken certificate
-
validateSignature
ValidationResult validateSignature()Validates the signature.- Returns:
- the validation result.
-
getAdESSignature
byte[] getAdESSignature()Returns signature as XAdES XML- Returns:
- signature as byte array
-