97
Views
3
Comments
Solved
[CryptoAPI] GetPrivateKey issue
Forge component by Ricardo Silva
34
Published on 03 Mar 2019

Dear all,


have i small issue with the getPrivateKey().

Our application has 3 modules: 1 Web-App, one mobile-app and one "integration layer".

Question 1; Is the result of the getPrivateKey() on all three modules the same?

My guess it is not, because i'm getting a lot of "decryption failed"

We are using the k-encrypt method (in the web-app) to securely store a client-pass we need further-on in the "integration layer".


Regards,

Jeroen


Ricardo Silva
Rank: #0
Solution

Yes, if the modules are all in the same environment getPrivateKey() should return the same on all of them.

You can double-check this by taking the returned binary data, base64 encoding it (using the BinaryData extension), and checking the result in those modules.

Let me know what you find. Obviously, don't actually share any of the private keys here.

Rank: #148

Hi Ricardo,


thanks for your reply!

I've tested my application again after publishing all 3 modules a few times.

Now indeed the problem is solved :-)

Rank: #1144

Jeroen Vormer wrote:

Hi Ricardo,


thanks for your reply!

I've tested my application again after publishing all 3 modules a few times.

Now indeed the problem is solved :-)

 Hi Jeroen,


If you got this right can you help me please?


I'm getting an error when trying the component.

First: I tried using

RSA_NewKey

and it gives me the private key, when I use the function 

RSA_GetPublicKey

to extract public key from the private one generated, I get empty text.



So I thought of sending the private key without these two texts "<RSAKeyValue><Modulus>" and "</RSAKeyValue>" and i'm getting wrong syntax, any lead how to do so?