lv.eparaksts.edoc

## Interface EDoc2Signature

- All Superinterfaces:
    Validatable
  All Known Subinterfaces:
    EDoc2ArchivedSignature, EDoc2BasicSignature, EDoc2QualifiedSignature

      public interface EDoc2Signature
      extends Validatable

  An `EDoc2Signature` class represents general access methods to the signature object.
  See Also:
    `EDoc2.addSignature()`, `EDoc2.addSignature(Map)`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `KEY_SIGNATURE_METHOD_URI` Configuration propery name for the signature method.
    `static String` | `SIGNATURE_METHOD_ECDSA_SHA256` Configuration value for the signature method "ECDSA-SHA256".
    `static String` | `SIGNATURE_METHOD_ECDSA_SHA384` Configuration value for the signature method "ECDSA-SHA384".
    `static String` | `SIGNATURE_METHOD_ECDSA_SHA512` Configuration value for the signature method "ECDSA-SHA512".
    `static String` | `SIGNATURE_METHOD_RSA_SHA1` Configuration value for the signature method "RSA-SHA1".
    `static String` | `SIGNATURE_METHOD_RSA_SHA224` Configuration value for the signature method "RSA-SHA224".
    `static String` | `SIGNATURE_METHOD_RSA_SHA256` Configuration value for the signature method "RSA-SHA256".
    `static String` | `SIGNATURE_METHOD_RSA_SHA384` Configuration value for the signature method "RSA-SHA384".
    `static String` | `SIGNATURE_METHOD_RSA_SHA512` Configuration value for the signature method "RSA-SHA512".

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `EDoc2ArchivedSignature` | `archivedSignature()` Prepares signature for ARCHIVED profile `SignatureProfile.ARCHIVED_SIGNATURE`
    `EDoc2BasicSignature` | `basicSignature()` Prepares signature for BASIC profile `SignatureProfile.BASIC_SIGNATURE`
    `void` | `complete()` Validates the signature integrity according to the profile requirements.
    `List<byte[]>` | `getArchiveTimestamps()` Returns a list of ASN.1 encoded timestamps for ARCHIVE profile.
    `List<byte[]>` | `getCertificateValues()` Returns a list of X.509 certificates that are required to validate the signature.
    `Date` | `getClaimedSigningTime()` Returns claimed signing time of the signature
    `List<byte[]>` | `getCRLs()` Returns a list of X.509 CRL that were added to the signature
    `String` | `getId()` Returns ID of the signature of the document.
    `List<byte[]>` | `getOCSPResponses()` Returns a list of DER encoded OCSP responses accordingly to Online Certificate Status Protocol (RFC 2560).
    `SignatureProfile` | `getProfile()` Profile of the signature
    `String` | `getSignatureMethodAlgorithm()` Returns algorithm name of the signature method.
    `SignatureProductionPlace` | `getSignatureProductionPlace()` Returns claimed production place of the signature
    `List<byte[]>` | `getSignatureTimestamps()` Returns list of timestamps accordingly to Time Stamp Protocol (RFC 3161).
    `byte[]` | `getSignatureValue()` Returns raw signature bytes
    `List<String>` | `getSignerClaimedRoles()` Returns a list of claimed signer roles of the signature
    `X509Certificate` | `getSigningCertificate()` Returns X.509 based certificate that was used to create the signature
    `EDoc2QualifiedSignature` | `qualifiedSignature()` Prepares signature for QUALIFIED profile `SignatureProfile.QUALIFIED_SIGNATURE`

    - ### Methods inherited from interface lv.eparaksts.validation.Validatable

      `validate, validate`

- - ### Field Detail

    - #### KEY_SIGNATURE_METHOD_URI

          static final String KEY_SIGNATURE_METHOD_URI

      Configuration propery name for the signature method. Property value is URI to signature method. For example: `http://www.w3.org/2001/04/xmldsig-more#rsa-sha256`
      See Also:
        `EDoc2.addSignature(Map)`, Constant Field Values

    - #### SIGNATURE_METHOD_RSA_SHA1

          static final String SIGNATURE_METHOD_RSA_SHA1

      Configuration value for the signature method "RSA-SHA1".
      See Also:
        Constant Field Values

    - #### SIGNATURE_METHOD_RSA_SHA224

          static final String SIGNATURE_METHOD_RSA_SHA224

      Configuration value for the signature method "RSA-SHA224".
      See Also:
        Constant Field Values

    - #### SIGNATURE_METHOD_RSA_SHA256

          static final String SIGNATURE_METHOD_RSA_SHA256

      Configuration value for the signature method "RSA-SHA256".
      See Also:
        Constant Field Values

    - #### SIGNATURE_METHOD_RSA_SHA384

          static final String SIGNATURE_METHOD_RSA_SHA384

      Configuration value for the signature method "RSA-SHA384".
      See Also:
        Constant Field Values

    - #### SIGNATURE_METHOD_RSA_SHA512

          static final String SIGNATURE_METHOD_RSA_SHA512

      Configuration value for the signature method "RSA-SHA512".
      See Also:
        Constant Field Values

    - #### SIGNATURE_METHOD_ECDSA_SHA256

          static final String SIGNATURE_METHOD_ECDSA_SHA256

      Configuration value for the signature method "ECDSA-SHA256".
      See Also:
        Constant Field Values

    - #### SIGNATURE_METHOD_ECDSA_SHA384

          static final String SIGNATURE_METHOD_ECDSA_SHA384

      Configuration value for the signature method "ECDSA-SHA384".
      See Also:
        Constant Field Values

    - #### SIGNATURE_METHOD_ECDSA_SHA512

          static final String SIGNATURE_METHOD_ECDSA_SHA512

      Configuration value for the signature method "ECDSA-SHA512".
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getId

          String getId()

      Returns ID of the signature of the document. ID is unique in document scope. ID will be automatically set at create time of the signature.
      Returns:
        the ID of the signature. ID is never `null`.

    - #### getProfile

          SignatureProfile getProfile()

      Profile of the signature
      Returns:
        current profile of the signature

    - #### getSignatureMethodAlgorithm

          String getSignatureMethodAlgorithm()

      Returns algorithm name of the signature method.
      Returns:
        Signature method algorithm name.

    - #### getSigningCertificate

          X509Certificate getSigningCertificate()
                                         throws EDoc2Exception

      Returns X.509 based certificate that was used to create the signature
      Returns:
        certificate that was used to create the signature
      Throws:
        `EDoc2Exception`

    - #### getClaimedSigningTime

          Date getClaimedSigningTime()
                              throws EDoc2Exception

      Returns claimed signing time of the signature
      Returns:
        Claimed signing time
      Throws:
        `EDoc2Exception`

    - #### getSignerClaimedRoles

          List<String> getSignerClaimedRoles()

      Returns a list of claimed signer roles of the signature
      Returns:
        Claimed signer role list

    - #### getSignatureProductionPlace

          SignatureProductionPlace getSignatureProductionPlace()

      Returns claimed production place of the signature
      Returns:
        Production place

    - #### getSignatureValue

          byte[] getSignatureValue()
                            throws EDoc2Exception

      Returns raw signature bytes
      Returns:
        raw bytes of the signature
      Throws:
        `EDoc2Exception`

    - #### getSignatureTimestamps

          List<byte[]> getSignatureTimestamps()
                                       throws EDoc2Exception

      Returns list of timestamps accordingly to Time Stamp Protocol (RFC 3161). Each entry is an ASN.1 encoded TimeStampToken value.
      Returns:
        list of ASN.1 encoded timestamps
      Throws:
        `EDoc2Exception`

    - #### getCertificateValues

          List<byte[]> getCertificateValues()
                                     throws EDoc2Exception

      Returns a list of X.509 certificates that are required to validate the signature. The list does not include certificate that was used to create the signature
      Returns:
        list of certificates for signature validation
      Throws:
        `EDoc2Exception`
      See Also:
        `X509Certificate`, `getSigningCertificate()`

    - #### getOCSPResponses

          List<byte[]> getOCSPResponses()
                                 throws EDoc2Exception

      Returns a list of DER encoded OCSP responses accordingly to Online Certificate Status Protocol (RFC 2560).
      Returns:
        list of DER encoded OCSP responses
      Throws:
        `EDoc2Exception`

    - #### getCRLs

          List<byte[]> getCRLs()
                        throws EDoc2Exception

      Returns a list of X.509 CRL that were added to the signature
      Returns:
        a list of included CRL
      Throws:
        `EDoc2Exception`
      See Also:
        `X509CRL`

    - #### getArchiveTimestamps

          List<byte[]> getArchiveTimestamps()
                                     throws EDoc2Exception

      Returns a list of ASN.1 encoded timestamps for ARCHIVE profile. Method applies to ARCHIVE profile only.
      Returns:
        a list of ASN.1 encoded timestamps
      Throws:
        `EDoc2Exception`

    - #### basicSignature

          EDoc2BasicSignature basicSignature()
                                      throws EDoc2Exception

      Prepares signature for BASIC profile `SignatureProfile.BASIC_SIGNATURE`
      Returns:
        BASIC signature profile interface
      Throws:
        `EDoc2Exception` - if the signature is not modificable

    - #### qualifiedSignature

          EDoc2QualifiedSignature qualifiedSignature()
                                              throws EDoc2Exception

      Prepares signature for QUALIFIED profile `SignatureProfile.QUALIFIED_SIGNATURE`
      Returns:
        QUALIFIED signature profile interface
      Throws:
        `EDoc2Exception` - if the signature is not extendable
      See Also:
        `SignatureProfile`, `getProfile()`

    - #### archivedSignature

          EDoc2ArchivedSignature archivedSignature()
                                            throws EDoc2Exception

      Prepares signature for ARCHIVED profile `SignatureProfile.ARCHIVED_SIGNATURE`
      Returns:
        ARCHIVED signature profile interface
      Throws:
        `EDoc2Exception` - if the signature is not archivable
      See Also:
        `SignatureProfile`, `getProfile()`

    - #### complete

          void complete()
                 throws EDoc2Exception

      Validates the signature integrity according to the profile requirements. Throws exception if the signature is not completed.
      Throws:
        `EDoc2Exception` - if the signature is not completed

Copyright VAS Latvijas Valsts radio un televizijas centrs / Developed by SIA EUSO