AbdelbakiBoukerche / rsa_encrypt

rsa encrypt package
MIT License
17 stars 16 forks source link

no functions: encodePrivateKeyToPemPKCS1(keyPair.privateKey) & encodePublicKeyToPemPKCS1(keyPair.publicKey). #7

Closed 312654929 closed 3 years ago

312654929 commented 3 years ago

When I use them, the prompt is undefined

djackowski commented 3 years ago

You have to use RsaKeyHelper().encodePrivateKeyToPemPKCS1(keyPair.privateKey) and RsaKeyHelper().encodePublicKeyToPemPKCS1(keyPair.publicKey)

AbdelbakiBoukerche commented 3 years ago

Hi, Thanks for showing interest in rsa_encrypt :) As for your question, if you have a valid PEM String you can use the parsePublicKeyFromPem (). This function takes the PEM String as a parameter and returns a RSAPublicKey instance. . Happy Coding!

On Tue, Apr 6, 2021 at 9:47 AM Sohaib Aslam @.***> wrote:

How we convert the Public_Key_String on the other side, to RSAPublicKey. There is no decode function which return the RSAPublicKey from the _publicKeyStr,

String _publicKeyStr = helper.encodePublicKeyToPemPKCS1(keys.publicKey);

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AbdelbakiBoukerche/rsa_encrypt/issues/7#issuecomment-813906738, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALB4GWIAD6OFAPASTJDXQTDTHK4CXANCNFSM4TZNU2IA .