public class AliyunCrypto extends Object
| Constructor and Description |
|---|
AliyunCrypto(AliyunConfig config) |
AliyunCrypto(AliyunConfig config,
org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
CryptoResult<byte[]> |
decrypt(BaseDataKeyProvider provider,
byte[] cipherText)
使用
BaseDataKeyProvider 获取加密使用的dataKey解密 cipherText |
CryptoResult<byte[]> |
encrypt(BaseDataKeyProvider provider,
byte[] plainText,
Map<String,String> encryptionContext)
|
void |
setConfig(AliyunConfig config) |
void |
setCryptoKeyManager(CryptoKeyManager cryptoKeyManager) |
void |
setEncryptHandler(EncryptHandler encryptHandler) |
SignatureResult<byte[]> |
sign(SignatureProvider provider,
byte[] content,
ContentType type)
使用
SignatureProvider 处理加签请求 |
SignatureResult<Boolean> |
verify(SignatureProvider provider,
byte[] content,
byte[] signature,
ContentType type)
使用
SignatureProvider 处理验签请求 |
public AliyunCrypto(AliyunConfig config)
public AliyunCrypto(AliyunConfig config, org.slf4j.Logger logger)
public void setEncryptHandler(EncryptHandler encryptHandler)
public void setConfig(AliyunConfig config)
public void setCryptoKeyManager(CryptoKeyManager cryptoKeyManager)
public CryptoResult<byte[]> encrypt(BaseDataKeyProvider provider, byte[] plainText, Map<String,String> encryptionContext)
provider - 数据密钥提供plainText - 明文encryptionContext - 加密上下文public CryptoResult<byte[]> decrypt(BaseDataKeyProvider provider, byte[] cipherText)
BaseDataKeyProvider 获取加密使用的dataKey解密 cipherTextprovider - 数据密钥提供cipherText - 密文public SignatureResult<byte[]> sign(SignatureProvider provider, byte[] content, ContentType type)
SignatureProvider 处理加签请求provider - 签名提供content - 签名内容type - 内容类型public SignatureResult<Boolean> verify(SignatureProvider provider, byte[] content, byte[] signature, ContentType type)
SignatureProvider 处理验签请求provider - 签名提供content - 验签内容signature - 签名结果type - 内容类型Copyright © 2020. All rights reserved.