Skip to content
Advertisement

Tag: rsa

Problem verifying signature using public key

I have a webhook that sends a header, which needs to be verified. Below are some details: Problem : The Java method always returns false. The provided header and body are correct and should result as TRUE. As per docs from the provider : Signature = Base64(RSA512(WEBHOOK_PRIVATE_KEY, SHA512(eventBody))) Public Key : Header : RequestBody: Java method that’s called when webhook

RSA decryption according to the private key reports an error

My code using RSA on the front end: My code using RSA in the backend: PublicKey like this: PrivateKey like this: Bu-t, when i do the java code decryption, it reported such an error: How can i solve this problem ? Answer 1. You are decoding wrong. PEM format has a dash-BEGIN line identifying the type of data, a block

how to construct a java.security.interfaces.RSAPublicKey?

I have the following string, which I understand to be an RSA public key: I need to construct a java.security.interfaces.RSAPublicKey from this string. First I tried calling RSAPublicKeyImpl.newKey(myString.getBytes(StandardCharsets.UTF_8)), but that threw the following exception: Then, following an online guide, I tried this code instead: That threw a very similar exception, just wrapped in another one. Am I missing something obvious

trying to convert Java RSA-PSS signature verification code (with SHA256 hash, SHA1 MGF hash) to Python

Here’s my Java code, which successfully verifies the signature, as expected. The full code (with the imports, keys, message and signature) can be seen at https://pastebin.com/PmhGDaPv in case you want to try to reproduce the issue. My Python code, which does not verify the signature, as expected: The full code (with the imports, keys, message and signature) can be seen

Rebuild of a RSA Private Key from modulus & exponent fails

I’m trying to rebuild a RSA keypair from modulus & private/public exponents. The conversion works correct for the public key but fails to private key when comparing the encoded private keys. When using this rebuild private/public keypair for encryption it works (!) in Java, but when using the rebuild keypair in PHP, the decryption part fails (encryption is working), so

decode south african za-drivers-license

In reference to this discussion: Decode South African (ZA) Drivers License Please assist I seem to be getting an error trying to create PublicKey instance in Java on android. I have pasted the error below: Here is the code snippet: Answer The encoded public keys you’re trying to read are not of the format expected by X509EncodedKeySpec. Instead they are

Advertisement