public final class Certificate
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Certificate.FileType
Specifies the type of certificate file to be added
|
| Constructor and Description |
|---|
Certificate(PAMService service,
APIRequestHandler rest,
java.util.Map<java.lang.String,java.lang.String> connectionParams) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Certificate.FileType fileType,
java.lang.String password,
java.lang.String filePath)
Add a new certificate file
|
boolean |
createCertificate(CertificateModel certificate)
Create a new certificate
|
boolean |
createCSR(CertificateModel certificate)
Create a new certificate signing request
|
boolean |
delete(java.lang.String commonName,
java.lang.String serialNumber)
Delete a certificate
|
java.lang.String |
get(java.lang.String commonName,
java.lang.String serialNumber)
Get a certificates content
|
java.util.List<CertificateInfo> |
getAll()
Get information about all added certificates
|
java.util.List<CertificateExpiryInfo> |
getAllExpiry()
Get Expiration details of all the added certificates
|
java.lang.String |
getKeystore(java.lang.String commonName,
java.lang.String serialNumber)
Get the keystore file content
|
java.lang.String |
getPassphrase(java.lang.String commonName,
java.lang.String serialNumber)
Get the passphrase of a certificate
|
public Certificate(PAMService service, APIRequestHandler rest, java.util.Map<java.lang.String,java.lang.String> connectionParams) throws SDKRegistrationException
SDKRegistrationExceptionpublic boolean createCertificate(CertificateModel certificate) throws SDKInvalidArgumentException, SDKConnectionException, SDKOperationFailedException
certificate - instance of CertificateModel containing all necessary information required to create a certificateSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean createCSR(CertificateModel certificate) throws SDKInvalidArgumentException, SDKConnectionException, SDKOperationFailedException
certificate - instance of CertificateModel containing all necessary information required to create a certificateSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic java.lang.String get(java.lang.String commonName,
java.lang.String serialNumber)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
commonName - not null, not empty common name of the certificateserialNumber - optional (can be null or empty), unique identifier of the certificateSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic java.util.List<CertificateInfo> getAll() throws SDKConnectionException, SDKOperationFailedException
CertificateInfo containing information about all certificatesSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messagepublic java.util.List<CertificateExpiryInfo> getAllExpiry() throws SDKConnectionException, SDKOperationFailedException
CertificateExpiryInfo containing expiry info of each certificateSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messagepublic java.lang.String getKeystore(java.lang.String commonName,
java.lang.String serialNumber)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
commonName - not null, not empty common name of the certificateserialNumber - optional can be empty,the serial number of the appropriate certificateSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messagepublic java.lang.String getPassphrase(java.lang.String commonName,
java.lang.String serialNumber)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
commonName - not null, not empty common name of the certificate whose passphrase has to be fetchedserialNumber - not null, not empty, unique identifier of the certificateSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean add(Certificate.FileType fileType, java.lang.String password, java.lang.String filePath) throws SDKConnectionException, SDKOperationFailedException, SDKInvalidArgumentException
MandatoryParams: fileType, password if fileType is fileType.KEYSTORE, filePath
fileType - type of the certificate file. Choose from Certificate.FileType For CERTFILE fileType, the password field need not be specified
password - password or the passphrase of the certificate file to be addedfilePath - system file location (also specify the file extension. eg: C:/user/admin/certificate.cer)SDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not providedpublic boolean delete(java.lang.String commonName,
java.lang.String serialNumber)
throws SDKInvalidArgumentException,
SDKConnectionException,
SDKOperationFailedException
commonName - not null, not empty common name of the certificate whose passphrase has to be fetchedserialNumber - optional (can be null), unique identifier for each certificateSDKConnectionException - if unable to connect to the serverSDKOperationFailedException - if server did not provide a proper response for the request, or if action fails. The reason for failure will be provided as a part of the exception's messageSDKInvalidArgumentException - if any of the mandatory field's values are invalid or not provided