com.baidubce.services.kms
Class KmsClient

java.lang.Object
  extended by com.baidubce.AbstractBceClient
      extended by com.baidubce.services.kms.KmsClient

public class KmsClient
extends AbstractBceClient

Provides the client for accessing the Key Manager Service.


Field Summary
 
Fields inherited from class com.baidubce.AbstractBceClient
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX
 
Constructor Summary
KmsClient()
           
KmsClient(KmsClientConfiguration clientConfiguration)
           
 
Method Summary
 void cancelKeyDeletion(CancelKeyDeletionRequest request)
          Cancels deletion of the specified master key.
 CreateKeyResponse createKey(CreateKeyRequest request)
          Creates a new master key.
 DecryptResponse decrypt(DecryptRequest request)
          Returns DecryptResponse containing plaintext which is decrypted using ciphertext.
 DescribeKeyResponse describeKey(DescribeKeyRequest request)
          Returns DescribeKeyResponse containing deletionDate of specified master key and master key id.
 void disableKey(DisableKeyRequest request)
          Disable the specified master key.
 void enableKey(EnableKeyRequest request)
          Enable the specified master key.
 EncryptResponse encrypt(EncryptRequest request)
          Returns EncryptResponse containing ciphertext which is encrypted using plaintext by master key.
 GenerateDataKeyResponse generateDataKey(GenerateDataKeyRequest request)
          Returns GenerateDataKeyResponse containing ciphertext, keyId and plaintext which is random generated by kms.
 ListKeysResponse listKeys(ListKeysRequest request)
          Returns ListKeysResponse containing master keys.
 ScheduleKeyDeletionResponse scheduleKeyDeletion(ScheduleKeyDeletionRequest request)
          Returns ScheduleKeyDeletionResponse containing deletionDate of specified master key and master key id.
 void setInternalRequest(InternalRequest internalRequest, StringWriter writer)
          set InternalRequest with StringWriter
 
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

KmsClient

public KmsClient()

KmsClient

public KmsClient(KmsClientConfiguration clientConfiguration)
Method Detail

createKey

public CreateKeyResponse createKey(CreateKeyRequest request)
                            throws Exception
Creates a new master key.

Parameters:
request - The request object containing all options for creating master key.
Returns:
The newly created master key.
Throws:
Exception

listKeys

public ListKeysResponse listKeys(ListKeysRequest request)
                          throws Exception
Returns ListKeysResponse containing master keys.

Parameters:
request - The request object containing limit and marker for listing master keys.
Returns:
ListKeysResponse containing a listing of the master keys.
Throws:
Exception

encrypt

public EncryptResponse encrypt(EncryptRequest request)
                        throws Exception
Returns EncryptResponse containing ciphertext which is encrypted using plaintext by master key.

Parameters:
request - The request object containing masterKeyId and plaintext.
Returns:
EncryptResponse containing ciphertext and master key id.
Throws:
Exception

decrypt

public DecryptResponse decrypt(DecryptRequest request)
                        throws Exception
Returns DecryptResponse containing plaintext which is decrypted using ciphertext. MasterKeyId is in ciphertext.

Parameters:
request - The request object containing ciphertext.
Returns:
DecryptResponse containing master key id and plaintext .
Throws:
Exception

generateDataKey

public GenerateDataKeyResponse generateDataKey(GenerateDataKeyRequest request)
                                        throws Exception
Returns GenerateDataKeyResponse containing ciphertext, keyId and plaintext which is random generated by kms.

Parameters:
request - The request object containing master key id, keySpec and numberOfBytes.
Returns:
GenerateDataKeyResponse containing ciphertext, keyId and plaintext.
Throws:
Exception

enableKey

public void enableKey(EnableKeyRequest request)
               throws Exception
Enable the specified master key.

Parameters:
request - The request object containing master key id.
Throws:
Exception

disableKey

public void disableKey(DisableKeyRequest request)
                throws Exception
Disable the specified master key.

Parameters:
request - The request object containing master key id.
Throws:
Exception

scheduleKeyDeletion

public ScheduleKeyDeletionResponse scheduleKeyDeletion(ScheduleKeyDeletionRequest request)
                                                throws Exception
Returns ScheduleKeyDeletionResponse containing deletionDate of specified master key and master key id.

Parameters:
request - The request object containing master key id, pendingWindowsInDays.
Returns:
ScheduleKeyDeletionResponse containing deletionDate and master key id.
Throws:
Exception

cancelKeyDeletion

public void cancelKeyDeletion(CancelKeyDeletionRequest request)
                       throws Exception
Cancels deletion of the specified master key.

Parameters:
request - The request object containing master key id.
Throws:
Exception

describeKey

public DescribeKeyResponse describeKey(DescribeKeyRequest request)
                                throws Exception
Returns DescribeKeyResponse containing deletionDate of specified master key and master key id.

Parameters:
request - The request object containing master key id, pendingWindowsInDays.
Returns:
DescribeKeyResponse containing deletionDate and master key id.
Throws:
Exception

setInternalRequest

public void setInternalRequest(InternalRequest internalRequest,
                               StringWriter writer)
set InternalRequest with StringWriter

Parameters:
internalRequest -
writer -


Copyright © 2018. All rights reserved.