Hi,

I've checked the SHA256 function from bouncycastle and it seems generate 
the hash correctly. At least from the few
experiments I've done. 

But since I need to verify RSA signature with SHA256 I would have to 
replace the SHA256Digest() implementation from
bouncycaste with a new one. So even if I would try to use example from 
Francesco, it would have to change it to provide
org.bouncycastle.crypto.Digest interface.  That would require proper tests 
if the implementation works as intended. 

The code for verifying the signature  looks like this:
RSADigestSigner signer = new RSADigestSigner(new SHA256Digest());
        signer.init(false, new RSAKeyParameters(false, modulus, exponent));
        
        try {
            signer.update(data.getBytes("UTF-8"), 0, 
data.getBytes("UTF-8").length);
        } catch (UnsupportedEncodingException ex) {
            Log.e(ex);
        }

        boolean verified = signer.verifySignature(sigDecode);

(it's from the example in the first post)



Dátum: štvrtok 2. júla 2020, čas: 5:25:53 UTC+2, odosielateľ: Shai Almog

> Hi,
> the BC BigInteger predated our own implementation. 
> Which code did you use to verify a signature?
> Did you try the code from Francesco
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/7a583b33-2421-4881-b907-39979185df02n%40googlegroups.com.

Reply via email to