最近有用到阿里云KMS顺便做下记录
阿里云KMS的非对称密钥签名API
AsymmetricSign
签名算法说明:
KeySpec | Algorithm | 说明 |
---|---|---|
RSA_2048 | RSA_PSS_SHA_256 | RSASSA-PSS using SHA-256 and MGF1 with SHA-256 |
Java代码
/**
* 验签
*
* @param publicKeyBase64Str 验签公钥
* @param source 原始数据, 经过base64.decode的数据
* @param sign 签名数据,经过base64.decode的数据
* @return true 则数据合法,false则不合法
* @throws GeneralSecurityException
*/
public static boolean verify(String publi