public abstract class BaseDataKeyProvider extends Object
| Modifier and Type | Field and Description |
|---|---|
protected CryptoAlgorithm |
algorithm |
protected FormatHandler |
handler |
protected CmkId |
keyId |
protected AliyunKms |
kms |
| Constructor and Description |
|---|
BaseDataKeyProvider(String keyId) |
BaseDataKeyProvider(String keyId,
CryptoAlgorithm algorithm) |
| Modifier and Type | Method and Description |
|---|---|
DecryptionMaterial |
decryptDataKey(DecryptionMaterial material,
List<EncryptedDataKey> encryptedDataKeys)
解密数据密钥
|
EncryptionMaterial |
encryptDataKey(EncryptionMaterial material)
生成一个数据密钥并进行加密处理
|
CryptoAlgorithm |
getAlgorithm() |
abstract CipherMaterial |
getCipherMaterial(byte[] cipherText)
通过密文或数据密钥关键字获取数据密钥并生成密码材料
|
abstract byte[] |
processCipherMaterial(CipherMaterial cipherMaterial)
处理密码材料生成字节数组,字节数组内容可能包含:
1.
CipherMaterial 的所有内容
2.CipherMaterial 中的 CipherBody 部分(CipherHeader 部分由
AbstractExternalStoreDataKeyProvider 的实现自行处理) |
void |
setAlgorithm(CryptoAlgorithm algorithm) |
void |
setAliyunKms(AliyunKms kms) |
void |
setFormatHandler(FormatHandler handler) |
void |
setMultiCmkId(List<String> keyIds) |
protected CryptoAlgorithm algorithm
protected FormatHandler handler
protected AliyunKms kms
protected CmkId keyId
public BaseDataKeyProvider(String keyId)
public BaseDataKeyProvider(String keyId, CryptoAlgorithm algorithm)
public void setAliyunKms(AliyunKms kms)
public CryptoAlgorithm getAlgorithm()
public void setAlgorithm(CryptoAlgorithm algorithm)
public void setFormatHandler(FormatHandler handler)
public EncryptionMaterial encryptDataKey(EncryptionMaterial material)
material - 加密密钥材料(不包含获取数据密钥)public DecryptionMaterial decryptDataKey(DecryptionMaterial material, List<EncryptedDataKey> encryptedDataKeys)
material - 解密密钥材料(不包含数据密钥明文)encryptedDataKeys - 数据密钥明文列表public abstract CipherMaterial getCipherMaterial(byte[] cipherText)
cipherText - 密文public abstract byte[] processCipherMaterial(CipherMaterial cipherMaterial)
CipherMaterial 的所有内容
2.CipherMaterial 中的 CipherBody 部分(CipherHeader 部分由
AbstractExternalStoreDataKeyProvider 的实现自行处理)cipherMaterial - 密码材料Copyright © 2020. All rights reserved.