com.baidubce.services.iothisk
Class IotPkiManageClient

java.lang.Object
  extended by com.baidubce.AbstractBceClient
      extended by com.baidubce.services.iothisk.AbstractIotHiskBceClient
          extended by com.baidubce.services.iothisk.IotPkiManageClient

public class IotPkiManageClient
extends AbstractIotHiskBceClient

Provides the client for accessing the iot pki service.


Field Summary
 
Fields inherited from class com.baidubce.services.iothisk.AbstractIotHiskBceClient
HANDLERS
 
Fields inherited from class com.baidubce.AbstractBceClient
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX
 
Constructor Summary
IotPkiManageClient(BceClientConfiguration config)
          Constructs a new pki client using the client configuration to access hisk pki.
 
Method Summary
 BatchCreateClientCertResponse batchCreateClientCert(BatchCreateClientCertRequest request, String clientToken)
          Batch create client certs.
 CreateCertGroupResponse createCertGroup(CreateCertGroupRequest request, String clientToken)
          Create a cert group.
 CreateSubCertResponse createClientCert(CreateSubCertRequest request, String clientToken)
          Create a client cert.
 CreateRootCACertResponse createRootCACert(CreateRootCACertRequest request, String clientToken)
          Create a root cert.
 CreateSubCertResponse createServerCert(CreateSubCertRequest request, String clientToken)
          Create a server cert.
 void deleteCertGroup(String groupId)
          Delete a cert group.
 void deleteClientCert(String clientCertId)
          Delete a client cert.
 void deleteRootCACert(String certId)
          Delete a root cert.
 void deleteServerCert(String serverCertId)
          Delete a server cert.
 Map<String,String> downloadBatchCreateCerts(String jobId)
          Download batch create certs.
 String downloadClientCert(String clientCertId)
          Download client cert.
 DownloadCrlResponse downloadCrl(String issuerDN)
          Download root cert.
 String downloadRootCert(String rootCertId)
          Download root cert.
 String downloadServerCert(String serverCertId)
          Download server cert.
 GetBatchCreateStatusResponse getBatchCreateStatus(String jobId)
          Get batch create status
 GetCertGroupResponse getCertGroup(String groupId)
          Get a cert group.
 GetCertStatusResponse getCertStatus(GetCertStatusRequest request)
          Get cert status.
 GetSubCertResponse getClientCert(String clientCertId)
          Get a client cert.
 GetOcspResponse getOcspResponse(byte[] ocspRequest)
          Standard ocsp query use HTTP GET method.
 GetRootCACertResponse getRootCACert(String certId)
          Get a root cert.
 GetSubCertResponse getServerCert(String serverCertId)
          Get a server cert.
 QueryClientCertResponse queryClientCerts(String rootCACertId, String groupId)
          Query client certs.
 QueryServerCertResponse queryServerCerts(String rootCACertId, String groupId)
          Query server certs.
 RenewSubCertResponse renewClientCert(RenewSubCertRequest request, String clientCertId, String clientToken)
          Renew a client cert.
 RenewSubCertResponse renewServerCert(RenewSubCertRequest request, String serverCertId, String clientToken)
          Renew a server cert.
 
Methods inherited from class com.baidubce.services.iothisk.AbstractIotHiskBceClient
createRequest, fillInHeaderAndBody, toJson
 
Methods inherited from class com.baidubce.AbstractBceClient
getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IotPkiManageClient

public IotPkiManageClient(BceClientConfiguration config)
Constructs a new pki client using the client configuration to access hisk pki.

Parameters:
config - The bcc client configuration options controlling how this client connects to bcc (e.g. proxy settings, retry counts, etc).
Method Detail

createRootCACert

public CreateRootCACertResponse createRootCACert(CreateRootCACertRequest request,
                                                 String clientToken)
Create a root cert.

Parameters:
request - The request object containing all options for creating a root cert.
clientToken - A random string to make request idempotent.
Returns:
The created root cert ID.

deleteRootCACert

public void deleteRootCACert(String certId)
Delete a root cert.

Parameters:
certId - The cert ID of the root cert which will be deleted.

getRootCACert

public GetRootCACertResponse getRootCACert(String certId)
Get a root cert.

Parameters:
certId - The cert ID of the root cert which will be got.
Returns:
Crl download url and root cert download url.

createCertGroup

public CreateCertGroupResponse createCertGroup(CreateCertGroupRequest request,
                                               String clientToken)
Create a cert group.

Parameters:
request - The request object containing all options for creating a cert group.
clientToken - A random string to make request idempotent.
Returns:
The created cert group ID.

deleteCertGroup

public void deleteCertGroup(String groupId)
Delete a cert group.

Parameters:
groupId - The group ID of the cert group which will be deleted.

getCertGroup

public GetCertGroupResponse getCertGroup(String groupId)
Get a cert group.

Parameters:
groupId - The group ID of the cert group which will be got.
Returns:
Root cert ID and sub cert' ID of this group.

createServerCert

public CreateSubCertResponse createServerCert(CreateSubCertRequest request,
                                              String clientToken)
Create a server cert.

Parameters:
request - The request object containing all options for creating a server cert.
clientToken - A random string to make request idempotent.
Returns:
The created server cert ID.

deleteServerCert

public void deleteServerCert(String serverCertId)
Delete a server cert.

Parameters:
serverCertId - The server cert ID of the cert which will be deleted.

getServerCert

public GetSubCertResponse getServerCert(String serverCertId)
Get a server cert.

Parameters:
serverCertId - The server cert ID of the cert which will be got.
Returns:
Root cert ID, cert group ID and cert download url of this cert.

queryServerCerts

public QueryServerCertResponse queryServerCerts(String rootCACertId,
                                                String groupId)
Query server certs.

Parameters:
rootCACertId - The root cert ID of server certs which will be queried.
groupId - The cert group ID of server certs which will be queried.
Returns:
Server cert list of the query.

renewServerCert

public RenewSubCertResponse renewServerCert(RenewSubCertRequest request,
                                            String serverCertId,
                                            String clientToken)
Renew a server cert.

Parameters:
request - The request object containing all options for renewing a server cert.
serverCertId - The server cert ID of the cert which will be renewed.
clientToken - A random string to make request idempotent.
Returns:
Download url of the new server cert.

createClientCert

public CreateSubCertResponse createClientCert(CreateSubCertRequest request,
                                              String clientToken)
Create a client cert.

Parameters:
request - The request object containing all options for creating a client cert.
clientToken - A random string to make request idempotent.
Returns:
The created client cert ID.

deleteClientCert

public void deleteClientCert(String clientCertId)
Delete a client cert.

Parameters:
clientCertId - The client cert ID of the cert which will be deleted.

getClientCert

public GetSubCertResponse getClientCert(String clientCertId)
Get a client cert.

Parameters:
clientCertId - The client cert ID of the cert which will be got.
Returns:
Root cert ID, cert group ID and cert download url of this cert.

queryClientCerts

public QueryClientCertResponse queryClientCerts(String rootCACertId,
                                                String groupId)
Query client certs.

Parameters:
rootCACertId - The root cert ID of client certs which will be queried.
groupId - The cert group ID of client certs which will be queried.
Returns:
Client cert list of the query.

renewClientCert

public RenewSubCertResponse renewClientCert(RenewSubCertRequest request,
                                            String clientCertId,
                                            String clientToken)
Renew a client cert.

Parameters:
request - The request object containing all options for renewing a client cert.
clientCertId - The client cert ID of the cert which will be renewed.
clientToken - A random string to make request idempotent.
Returns:
Download url of the new client cert.

batchCreateClientCert

public BatchCreateClientCertResponse batchCreateClientCert(BatchCreateClientCertRequest request,
                                                           String clientToken)
Batch create client certs.

Parameters:
request - The request object containing all options for creating client certs.
clientToken - A random string to make request idempotent.
Returns:
The create batch ID.

getBatchCreateStatus

public GetBatchCreateStatusResponse getBatchCreateStatus(String jobId)
Get batch create status

Parameters:
jobId - The create batch ID.
Returns:
Status of the create batch.

downloadClientCert

public String downloadClientCert(String clientCertId)
Download client cert.

Parameters:
clientCertId - The client cert ID which will be downloaded.
Returns:
Cert content string, encoded by base64, using PEM format.

downloadServerCert

public String downloadServerCert(String serverCertId)
Download server cert.

Parameters:
serverCertId - The server cert ID which will be downloaded.
Returns:
Cert content string, encoded by base64, using PEM format.

downloadRootCert

public String downloadRootCert(String rootCertId)
Download root cert.

Parameters:
rootCertId - The root cert ID which will be downloaded.
Returns:
Cert content string, encoded by base64, using PEM format.

downloadBatchCreateCerts

public Map<String,String> downloadBatchCreateCerts(String jobId)
Download batch create certs.

Parameters:
jobId - The create batch ID which will be downloaded.
Returns:
null if create failed or processing, or a map which maps device ID and cert content.

getCertStatus

public GetCertStatusResponse getCertStatus(GetCertStatusRequest request)
Get cert status.

Parameters:
request - The request object containing all options for creating client certs.
Returns:
Cert status of request.

downloadCrl

public DownloadCrlResponse downloadCrl(String issuerDN)
Download root cert.

Parameters:
issuerDN - The root cert DN, can be found in root cert.
Returns:
Crl content string, encoded by base64, using PEM format.

getOcspResponse

public GetOcspResponse getOcspResponse(byte[] ocspRequest)
Standard ocsp query use HTTP GET method.

Parameters:
ocspRequest - Standard ocsp request.
Returns:
Standard ocsp response.


Copyright © 2018. All rights reserved.