/*
 * Copyright 2016 Datalogics Inc.
 */

package com.datalogics.pdf.security;

import com.adobe.pdfjt.core.credentials.Credentials;
import com.adobe.pdfjt.core.exceptions.PDFInvalidParameterException;

import java.io.IOException;

/**
 * The basic interface for logging into a HSM machine.
 */
public interface HsmManager {

    /**
     * Performs a login operation to the HSM device.
     *
     * @param parms = Contains the parameters needed to login to the device
     * @return a boolean indicating if the login was successful
     * @throws IllegalArgumentException if an argument was invalid
     */
    boolean hsmLogin(final HsmLoginParms parms);

    /**
     * Logs out of the default session with the HSM device.
     *
     * <p>
     * This method should be called only if you have called {@link hsmLogin} to establish a login session.
     */
    void hsmLogout();

    /**
     * Get the Credentials object for the HSM device.
     *
     * @param password - the password for recovering the key
     * @param keyLabel - the given alias associated with the key
     * @param certLabel - the given alias associated with the certificate
     * @return a Credentials object used to sign documents
     * @throws IOException an I/O operation failed or was interrupted
     * @throws SecurityException thrown by the security manager to indicate a security violation
     * @throws PDFInvalidParameterException one or more of the parameters passed to a method is invalid
     */
    Credentials getCredentials(final String password, final String keyLabel, final String certLabel)
                    throws SecurityException, IOException, PDFInvalidParameterException;
}

@@ -84,150 +84,75 @@
 ort 
-com.adobe.pdfjt.core.credentials.Credentials;%0Aimport com.adobe.pdfjt.core.exceptions.PDFInvalidParameterException;%0A%0Aimport java.io.IOException
+java.security.PrivateKey;%0Aimport java.security.cert.X509Certificate
 ;%0A%0A/
@@ -824,27 +824,27 @@
 Get the 
-Credentials
+Private Key
  object 
@@ -1008,489 +1008,347 @@
  * @
-param certLabel - the given alias associated with the certificate%0A     * @return a Credentials object used to sign documents%0A     * @throws IOException an I/O op
+return A private key%0A     */%0A    PrivateKey getPrivateKey(final String password, final String keyLabel);%0A%0A    /**%0A     * Get an array of x509 C
 er
-a
 ti
-on failed or was interrupted%0A     * @throws SecurityException thrown by the security manager to indicate a security violation%0A     * @throws PDFInvalidParameterException one or more of the parameters passed to a method is invalid%0A     */%0A    Credentials getCredentials(final String password, final String keyLabel, 
+ficates for the HSM device.%0A     *%0A     * @param certLabel - the given alias associated with the certificate%0A     * @return X509Certificate%5B%5D%0A     */%0A    X509Certificate%5B%5D getCertificateChain(
 fina
@@ -1370,96 +1370,140 @@
 bel)
+;%0A
 %0A    
+/**%0A
      
-           throws SecurityException, IOException, PDFInvalidParameterException;
+* Get the HSM provider name .%0A     *%0A     * @return String (The Provider name)%0A     */%0A    String getProviderName();%0A
 %0A%7D%0A

Add new API's to the interface.