lv.pasts.eme.smartcard

## Interface CardAccessorCallback

- All Superinterfaces:
    KeyStore.ProtectionParameter

      public interface CardAccessorCallback
      extends KeyStore.ProtectionParameter

  `CardAccessorCallback` class is a callback used to interact with the user while accessing the SmartCard.

  An application implements a `CardAccessorCallback` and passes it to the `CardAccessor` so that it may interact with the application to retrieve specific data, such as PIN code, or to display certain information. For example, implementations for an application with a graphical user interface (GUI) may pop up windows to prompt for requested information or to display error messages. An implementation may also choose to obtain requested information from an alternate source without asking the end user.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `char[]` | `getCardPIN(String tokenSerial, String tokenLabel, long sessionId, X509Certificate cert, boolean isRetry)` Requests user the PIN code required to access the SmartCard.
    `CertificateEntry` | `selectClientAuthenticationCertificate(CertificateEntry[] certList)` Requests user to select the client authentication certificate from the given certificate list.
    `CertificateEntry` | `selectDocumentSigningCertificate(CertificateEntry[] certList)` Requests user to select the signing certificate from the given certificate list.

- - ### Method Detail

    - #### getCardPIN

          char[] getCardPIN(String tokenSerial,
                            String tokenLabel,
                            long sessionId,
                            X509Certificate cert,
                            boolean isRetry)

      Requests user the PIN code required to access the SmartCard. PIN code is requested to access private key or sign data.
      To get certificate information, PIN code is not required, therefore it will not be requested unless access to the private key is made.
      Parameters:
        `tokenSerial` - serial number of the associated token.
        `tokenLabel` - label of the associated token.
        `sessionId` - identifier of the current session.
        `cert` - certificate of the associated private key.
        `isRetry` - true if the previously provided PIN code was incorrect.
      Returns:
        the retrieved PIN code or `null` if action is cancelled.

    - #### selectDocumentSigningCertificate

          CertificateEntry selectDocumentSigningCertificate(CertificateEntry[] certList)

      Requests user to select the signing certificate from the given certificate list.
      Parameters:
        `certList` - certificate list containing available signing certificates.
      Returns:
        the selected certificate entry or `null` if action is cancelled.
        Use `CertificateEntry.REFRESH_MARKER` to refresh the certificate list and invoke this method again.

    - #### selectClientAuthenticationCertificate

          CertificateEntry selectClientAuthenticationCertificate(CertificateEntry[] certList)

      Requests user to select the client authentication certificate from the given certificate list.
      Parameters:
        `certList` - certificate list containing available client authentication certificates.
      Returns:
        the selected certificate entry or `null` if action is cancelled.
        Use `CertificateEntry.REFRESH_MARKER` to refresh the certificate list and invoke this method again.

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