lv.pasts.eme.edoc

## Class EDOCSignatureContext

- java.lang.Object
- - lv.pasts.eme.edoc.EDOCSignatureContext

-     public class EDOCSignatureContext
      extends Object

  This class is used to collect the required data for `EDOC` signing.
  Since:
    1.4.2

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected X509Certificate` | `authCert`
    `protected String` | `authCertificateAlias`
    `protected EDOCSignatureCallback` | `edocSignatureCallback`
    `protected KeyAccessor` | `keyAccessor`
    `protected SignatureType` | `signatureType`
    `protected X509Certificate` | `signCert`
    `protected String` | `signCertificateAlias`
    `protected CertPath` | `signCertPath`
    `protected X509Certificate` | `signCertRoot`
    `protected PrivateKey` | `signKey`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `EDOCSignatureContext(KeyAccessor keyAccessor, EDOCSignatureCallback edocSignatureCallback)` Creates an `EDOCSignatureContext` using the given KeyAccessor and EDOCSignatureCallback.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `OCSPClient` | `getSigningCertOCSPClient()` OCSPClient used to obtain OCSP responses for the signing certificate.
    `Map<String,String>` | `getTimeStampRequestProperties()` Optional properties to add for the TimeStamp HTTP requests.
    `protected void` | `onTimeStampResponse(TimeStamp timeStamp)` Notification for the requested TimeStamp response.
    `void` | `setSigningCertOCSPClient(OCSPClient signingCertOCSPClient)` OCSPClient used to obtain OCSP responses for the signing certificate.
    `void` | `setTimeStampRequestProperties(Map<String,String> timeStampRequestProperties)` Optional properties to add for the TimeStamp HTTP requests.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### keyAccessor

          protected KeyAccessor keyAccessor

    - #### edocSignatureCallback

          protected EDOCSignatureCallback edocSignatureCallback

    - #### signatureType

          protected SignatureType signatureType

    - #### authCertificateAlias

          protected String authCertificateAlias

    - #### authCert

          protected X509Certificate authCert

    - #### signCertificateAlias

          protected String signCertificateAlias

    - #### signCert

          protected X509Certificate signCert

    - #### signCertPath

          protected CertPath signCertPath

    - #### signCertRoot

          protected X509Certificate signCertRoot

    - #### signKey

          protected PrivateKey signKey

  - ### Constructor Detail

    - #### EDOCSignatureContext

          public EDOCSignatureContext(KeyAccessor keyAccessor,
                                      EDOCSignatureCallback edocSignatureCallback)

      Creates an `EDOCSignatureContext` using the given KeyAccessor and EDOCSignatureCallback.

      A `KeyAccessor` is used to access the document signing certificate. Optionally a client authentication certificate can be required when requesting a timestamp from the timestamping authority (TSA).

      While creating the signature a communication with the user is required, therefore you must specify an instance of `EDOCSignatureCallback` object which implements the required callback methods.

      Parameters:
        `keyAccessor` - a `KeyAccessor` instance used to access cryptographic keys and certificates.
        `edocSignatureCallback` - callback object used to get user input.

  - ### Method Detail

    - #### getSigningCertOCSPClient

          public OCSPClient getSigningCertOCSPClient()

      OCSPClient used to obtain OCSP responses for the signing certificate.
      Returns:
        OCSPClient.

    - #### setSigningCertOCSPClient

          public void setSigningCertOCSPClient(OCSPClient signingCertOCSPClient)

      OCSPClient used to obtain OCSP responses for the signing certificate. When not specified, the default OCSP client is used.
      Parameters:
        `signingCertOCSPClient` - OCSPClient.

    - #### getTimeStampRequestProperties

          public Map<String,String> getTimeStampRequestProperties()

      Optional properties to add for the TimeStamp HTTP requests.
      Returns:
        properties.

    - #### setTimeStampRequestProperties

          public void setTimeStampRequestProperties(Map<String,String> timeStampRequestProperties)

      Optional properties to add for the TimeStamp HTTP requests.
      Parameters:
        `timeStampRequestProperties` - properties.

    - #### onTimeStampResponse

          protected void onTimeStampResponse(TimeStamp timeStamp)

      Notification for the requested TimeStamp response.
      Parameters:
        `timeStamp` - the newly-created `TimeStamp` object.

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