Quantcast
Channel: Mendix Forum Questions
Viewing all articles
Browse latest Browse all 82362

Bouncy Castle in Mendix 7.3 - cannot create signature

$
0
0

Hi,

I've been using the Bouncy Castle library with Mendix 7.1.

In Mendix 7.3 in the release notes it says: "Runtime will not globally register the Bouncy Castle Java library in order to prevent clashes with the usage of Bouncy Castle in the user libraries"

Thus I now register it myself after startup:

import org.bouncycastle.jce.provider.BouncyCastleProvider;
...
Security.addProvider(new BouncyCastleProvider());

Now, when I try to verify a signature

...
sig.init(new JcaPGPContentVerifierBuilderProvider().setProvider("BC"), publicKey);
...

I get an exception:

org.bouncycastle.openpgp.PGPException: cannot create signature: Error constructing implementation (algorithm: SHA256WITHRSA, provider: BC, class: org.bouncycastle.jcajce.provider.asymmetric.rsa.DigestSignatureSpi$SHA256)
    at org.bouncycastle.openpgp.operator.jcajce.OperatorHelper.createSignature(Unknown Source)
    at org.bouncycastle.openpgp.operator.jcajce.OperatorHelper.createSignature(Unknown Source)
    at org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProvider$JcaPGPContentVerifierBuilder.build(Unknown Source)
    at org.bouncycastle.openpgp.PGPSignature.init(Unknown Source)

Has anyone encountered this or knows what I am doing wrong?


Viewing all articles
Browse latest Browse all 82362

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>