Class DDocSignature

java.lang.Object
org.digidoc4j.impl.ddoc.DDocSignature
All Implemented Interfaces:
Serializable, Signature

public class DDocSignature extends Object implements Signature
Signature implementation. Provides an interface for handling a signature and the corresponding OCSP response properties.
See Also:
  • Constructor Details

    • DDocSignature

      public DDocSignature(Signature signature)
      Parameters:
      signature - add description
  • Method Details

    • setCertificate

      public void setCertificate(X509Cert cert)
      Set certificate.
      Parameters:
      cert -
    • getCity

      public String getCity()
      Description copied from interface: Signature
      Returns the signature production city.
      Specified by:
      getCity in interface Signature
      Returns:
      production city
    • getCountryName

      public String getCountryName()
      Description copied from interface: Signature
      Returns the signature production country.
      Specified by:
      getCountryName in interface Signature
      Returns:
      production country
    • getId

      public String getId()
      Description copied from interface: Signature
      Returns the signature id.
      Specified by:
      getId in interface Signature
      Returns:
      id
    • getUniqueId

      public String getUniqueId()
      Description copied from interface: Signature
      Returns the identifier that uniquely identifies this signature.
      Specified by:
      getUniqueId in interface Signature
      Returns:
      unique identifier
    • getOCSPNonce

      public byte[] getOCSPNonce()
      Description copied from interface: Signature
      Returns the signature OCSP response nonce or null if OCSP response is not present or OCSP nonce is not found inside the OCSP response.
      Specified by:
      getOCSPNonce in interface Signature
      Returns:
      OCSP response nonce or null if not found
    • getOCSPCertificate

      public X509Cert getOCSPCertificate()
      Description copied from interface: Signature
      Returns the signature OCSP responder certificate.
      Specified by:
      getOCSPCertificate in interface Signature
      Returns:
      OCSP responder certificate
    • getPostalCode

      public String getPostalCode()
      Description copied from interface: Signature
      Returns the signature production postal code.
      Specified by:
      getPostalCode in interface Signature
      Returns:
      postal code
    • getOCSPResponseCreationTime

      public Date getOCSPResponseCreationTime()
      This method returns OCSP response creation time (Date object), it can be null.
      Specified by:
      getOCSPResponseCreationTime in interface Signature
      Returns:
      date.
    • getTimeStampCreationTime

      public Date getTimeStampCreationTime()
      Description copied from interface: Signature
      Returns the signature timestamp generation time.
      Specified by:
      getTimeStampCreationTime in interface Signature
      Returns:
      generation timestamp
    • getTrustedSigningTime

      public Date getTrustedSigningTime()
      This method returns OCSP response creation time (Date object), it can be null.
      Specified by:
      getTrustedSigningTime in interface Signature
      Returns:
      date.
    • getProfile

      public SignatureProfile getProfile()
      Description copied from interface: Signature
      Returns the signature profile.
      Specified by:
      getProfile in interface Signature
      Returns:
      profile
    • getSignatureMethod

      public String getSignatureMethod()
      Description copied from interface: Signature
      Returns the signature method that was used for signing.
      Specified by:
      getSignatureMethod in interface Signature
      Returns:
      signature method
    • getSignerRoles

      public List<String> getSignerRoles()
      Description copied from interface: Signature
      Returns the signer's roles.
      Specified by:
      getSignerRoles in interface Signature
      Returns:
      signer roles
    • getSigningCertificate

      public X509Cert getSigningCertificate()
      Description copied from interface: Signature
      Returns the signature certificate that was used for signing.
      Specified by:
      getSigningCertificate in interface Signature
      Returns:
      signature certificate
    • getClaimedSigningTime

      public Date getClaimedSigningTime()
      Description copied from interface: Signature
      Returns the computer's time of signing.

      See also Signature.getTrustedSigningTime()

      Specified by:
      getClaimedSigningTime in interface Signature
      Returns:
      signing time
    • getStateOrProvince

      public String getStateOrProvince()
      Description copied from interface: Signature
      Returns the signature production state or province.
      Specified by:
      getStateOrProvince in interface Signature
      Returns:
      production state or province
    • getTimeStampTokenCertificate

      public X509Cert getTimeStampTokenCertificate()
      Description copied from interface: Signature
      Returns the signature TimeStampToken certificate. For a DDOC Signature it throws a NotYetImplementedException.
      Specified by:
      getTimeStampTokenCertificate in interface Signature
      Returns:
      TimeStampToken certificate
    • validateSignature

      public ValidationResult validateSignature()
      Description copied from interface: Signature
      Validates the signature.
      Specified by:
      validateSignature in interface Signature
      Returns:
      the validation result.
    • getCertValueOfType

      public CertValue getCertValueOfType(int type)
      Retrieves CertValue element with the desired type
      Parameters:
      type - CertValue type
      Returns:
      CertValue element or null if not found
    • getAdESSignature

      public byte[] getAdESSignature()
      Description copied from interface: Signature
      Returns signature as XAdES XML
      Specified by:
      getAdESSignature in interface Signature
      Returns:
      signature as byte array
    • getIndexInArray

      public int getIndexInArray()
      Get index In array.
      Returns:
      integer.
    • setIndexInArray

      public void setIndexInArray(int indexInArray)
      Set index In array.
      Parameters:
      indexInArray -