1 回答
- 最新
- 投票最多
- 评论最多
0
This issue resolve by overriding the JCE provider method for signature calculation
timeStampToken.getSignedData().setSecurityProvider(new SecurityProvider(authProvider1) {
@Override
public byte[] calculateSignatureFromSignedAttributes(AlgorithmID signatureAlgorithm,
AlgorithmID digestAlgorithm, PrivateKey privateKey, byte[] signedAttributes)
throws NoSuchAlgorithmException, InvalidKeyException, SignatureException {
byte[] sigValue = null;
try {
java.security.Signature signature = Signature.getInstance("SHA256withRSA", CloudHsmProvider.PROVIDER_NAME);
signature.initSign(privateKey);
signature.update(signedAttributes);
sigValue = signature.sign();
} catch (NoSuchProviderException ex) {
throw new SignatureException(ex);
}
}
已回答 1 年前
相关内容
- AWS 官方已更新 4 个月前
- AWS 官方已更新 3 年前
- AWS 官方已更新 2 年前
I have tested two use cases, creating a self-signed certificate using AWS CloudHsm RSA key it works on EC2 Linux and EC2 Windows Server 2019 both instances. Creating CMS signature failed on EC2 Windows instance and same code working on EC2 Linux instance. Possibly this can be the issue with windows native dll.