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);
}
}
답변함 일 년 전
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.