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年前
関連するコンテンツ
- 質問済み 6年前
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.