public class AliyunCrypto extends Object
| Constructor and Description |
|---|
AliyunCrypto(AliyunConfig config) |
AliyunCrypto(AliyunConfig config,
org.slf4j.Logger logger) |
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[]> encrypt(BaseDataKeyProvider provider, byte[] plainText)
BaseDataKeyProvider 生成dataKey加密 plaintextpublic CryptoResult<byte[]> decrypt(BaseDataKeyProvider provider, byte[] cipherText)
BaseDataKeyProvider 获取加密使用的dataKey解密 cipherTextprovider - 数据密钥提供cipherText - 密文public CryptoResult<OutputStream> encrypt(BaseDataKeyProvider provider, InputStream inputStream, OutputStream outputStream, Map<String,String> encryptionContext)
provider - 数据密钥提供inputStream - 待加密明文流outputStream - 已加密密文流encryptionContext - 加密上下文public CryptoResult<OutputStream> encrypt(BaseDataKeyProvider provider, InputStream inputStream, OutputStream outputStream)
public CryptoResult<OutputStream> decrypt(BaseDataKeyProvider provider, InputStream inputStream, OutputStream outputStream)
provider - 数据密钥提供inputStream - 加密密文流outputStream - 明文数据流public SignatureResult<byte[]> sign(SignatureProvider provider, byte[] content, ContentType type)
SignatureProvider 处理加签请求provider - 签名提供content - 签名内容type - 内容类型public Boolean verify(SignatureProvider provider, byte[] content, byte[] signature, ContentType type)
SignatureProvider 处理验签请求provider - 签名提供content - 验签内容signature - 签名结果type - 内容类型Copyright © 2020. All rights reserved.