Package com.avaya.clientservices.provider.certificate

## Interface CertificateEnrollmentCompletionHandler

-     public interface CertificateEnrollmentCompletionHandler

  Interface to be implemented by applications to get the certificate enrollment result from `CertificateManager.enroll(ScepConfiguration, EnrollmentCredentialProvider, CertificateEnrollmentCompletionHandler)`.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `onError​(CertificateEnrollmentException ex)` | Enrollment has failed.
    `void` | `onSuccess​(java.security.cert.X509Certificate[] chain, java.security.PrivateKey privateKey)` | Reported when certificate enrollment is successful.

- - ### Method Detail

    - #### onSuccess

          void onSuccess​(java.security.cert.X509Certificate[] chain,
                         java.security.PrivateKey privateKey)

      Reported when certificate enrollment is successful.

      Certificates and a private key received in this completion handler can be used later for setting Client identity in Client SDK by calling `CertificateManager.setClientIdentityCertificateChain(X509Certificate[], PrivateKey)`

      Parameters:
        `chain` - A chain of certificates (from a root to a client certificate) received from the enrollment server.
        `privateKey` - Unencrypted RSA private key received from the enrollment server.

    - #### onError

          void onError​(CertificateEnrollmentException ex)

      Enrollment has failed.
      Parameters:
        `ex` - Exception containing the reason of certificate enrollment failure.