类 KmsClient
- java.lang.Object
-
- com.baidubce.AbstractBceClient
-
- com.baidubce.services.kms.KmsClient
-
public class KmsClient extends AbstractBceClient
Provides the client for accessing the Key Manager Service.
-
-
字段概要
-
从类继承的字段 com.baidubce.AbstractBceClient
config, DEFAULT_CONTENT_TYPE, DEFAULT_ENCODING, DEFAULT_SERVICE_DOMAIN, URL_PREFIX
-
-
构造器概要
构造器 构造器 说明 KmsClient()KmsClient(KmsClientConfiguration clientConfiguration)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidcancelKeyDeletion(CancelKeyDeletionRequest request)Cancels deletion of the specified master key.CreateKeyResponsecreateKey(CreateKeyRequest request)Creates a new master key.DecryptResponsedecrypt(DecryptRequest request)Returns DecryptResponse containing plaintext which is decrypted using ciphertext.DescribeKeyResponsedescribeKey(DescribeKeyRequest request)Returns DescribeKeyResponse containing deletionDate of specified master key and master key id.voiddisableKey(DisableKeyRequest request)Disable the specified master key.voidenableKey(EnableKeyRequest request)Enable the specified master key.EncryptResponseencrypt(EncryptRequest request)Returns EncryptResponse containing ciphertext which is encrypted using plaintext by master key.GenerateDataKeyResponsegenerateDataKey(GenerateDataKeyRequest request)Returns GenerateDataKeyResponse containing ciphertext, keyId and plaintext which is random generated by kms.GetParametersForImportResponsegetParametersForImport(GetParametersForImportRequest request)KmsResponseimportAsymmetricKey(ImportAsymmetricKeyRequest request)KmsResponseimportKey(ImportKeyRequest request)ListKeysResponselistKeys(ListKeysRequest request)Returns ListKeysResponse containing master keys.ScheduleKeyDeletionResponsescheduleKeyDeletion(ScheduleKeyDeletionRequest request)Returns ScheduleKeyDeletionResponse containing deletionDate of specified master key and master key id.voidsetInternalRequest(InternalRequest internalRequest, StringWriter writer)set InternalRequest with StringWriterUpdateRotationResponseupdateRotateKey(UpdateRotationRequest request)-
从类继承的方法 com.baidubce.AbstractBceClient
computeBktVirEndpoint, computeServiceId, getBktVirEndpoint, getClient, getEndpoint, getServiceId, invokeHttpClient, isRegionSupported, setClient, shutdown
-
-
-
-
构造器详细资料
-
KmsClient
public KmsClient()
-
KmsClient
public KmsClient(KmsClientConfiguration clientConfiguration)
-
-
方法详细资料
-
createKey
public CreateKeyResponse createKey(CreateKeyRequest request) throws Exception
Creates a new master key.- 参数:
request- The request object containing all options for creating master key.- 返回:
- The newly created master key.
- 抛出:
Exception
-
listKeys
public ListKeysResponse listKeys(ListKeysRequest request) throws Exception
Returns ListKeysResponse containing master keys.- 参数:
request- The request object containing limit and marker for listing master keys.- 返回:
- ListKeysResponse containing a listing of the master keys.
- 抛出:
Exception
-
encrypt
public EncryptResponse encrypt(EncryptRequest request) throws Exception
Returns EncryptResponse containing ciphertext which is encrypted using plaintext by master key.- 参数:
request- The request object containing masterKeyId and plaintext.- 返回:
- EncryptResponse containing ciphertext and master key id.
- 抛出:
Exception
-
decrypt
public DecryptResponse decrypt(DecryptRequest request) throws Exception
Returns DecryptResponse containing plaintext which is decrypted using ciphertext. MasterKeyId is in ciphertext.- 参数:
request- The request object containing ciphertext.- 返回:
- DecryptResponse containing master key id and plaintext .
- 抛出:
Exception
-
generateDataKey
public GenerateDataKeyResponse generateDataKey(GenerateDataKeyRequest request) throws Exception
Returns GenerateDataKeyResponse containing ciphertext, keyId and plaintext which is random generated by kms.- 参数:
request- The request object containing master key id, keySpec and numberOfBytes.- 返回:
- GenerateDataKeyResponse containing ciphertext, keyId and plaintext.
- 抛出:
Exception
-
enableKey
public void enableKey(EnableKeyRequest request) throws Exception
Enable the specified master key.- 参数:
request- The request object containing master key id.- 抛出:
Exception
-
disableKey
public void disableKey(DisableKeyRequest request) throws Exception
Disable the specified master key.- 参数:
request- The request object containing master key id.- 抛出:
Exception
-
scheduleKeyDeletion
public ScheduleKeyDeletionResponse scheduleKeyDeletion(ScheduleKeyDeletionRequest request) throws Exception
Returns ScheduleKeyDeletionResponse containing deletionDate of specified master key and master key id.- 参数:
request- The request object containing master key id, pendingWindowsInDays.- 返回:
- ScheduleKeyDeletionResponse containing deletionDate and master key id.
- 抛出:
Exception
-
cancelKeyDeletion
public void cancelKeyDeletion(CancelKeyDeletionRequest request) throws Exception
Cancels deletion of the specified master key.- 参数:
request- The request object containing master key id.- 抛出:
Exception
-
describeKey
public DescribeKeyResponse describeKey(DescribeKeyRequest request) throws Exception
Returns DescribeKeyResponse containing deletionDate of specified master key and master key id.- 参数:
request- The request object containing master key id, pendingWindowsInDays.- 返回:
- DescribeKeyResponse containing deletionDate and master key id.
- 抛出:
Exception
-
getParametersForImport
public GetParametersForImportResponse getParametersForImport(GetParametersForImportRequest request) throws Exception
- 抛出:
Exception
-
importKey
public KmsResponse importKey(ImportKeyRequest request) throws Exception
- 抛出:
Exception
-
importAsymmetricKey
public KmsResponse importAsymmetricKey(ImportAsymmetricKeyRequest request) throws Exception
- 抛出:
Exception
-
updateRotateKey
public UpdateRotationResponse updateRotateKey(UpdateRotationRequest request) throws Exception
- 抛出:
Exception
-
setInternalRequest
public void setInternalRequest(InternalRequest internalRequest, StringWriter writer)
set InternalRequest with StringWriter- 参数:
internalRequest-writer-
-
-