Search code examples
rencryptionrsapki

Where are stored RSA keys in R with package PKI?


I'm trying to use RSA keys with package PKI in R.

I generated a key like this :

key=PKI::PKI.genRSAkey(2048)

Then I don't know where is the public key, if I want to communicate it for example.

> key
<pointer: 0x0000000037aa9ed0>
attr(,"class")
[1] "public.key"  "private.key"

I can't find anything about this in the PKI documentation.

class(key)
[1] "public.key"  "private.key"

Any ideas ?

Thank you


Solution

  • To save a key, the function PKI.save.key allows to convert the key into a readable format, you can choose a target location, and the type of key (private or public). You juste have to open the file and you can see the key and give it to someone.

    Thank you @MrFlick for the hint.