1 réponse
- Le plus récent
- Le plus de votes
- La plupart des commentaires
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);
}
}
répondu il y a un an
Contenus pertinents
- demandé il y a un an
- demandé il y a 7 mois
- demandé il y a 2 mois
- demandé il y a un an
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.