[CryptoAPI] GetPrivateKey

[CryptoAPI] GetPrivateKey

Forge Component
Published on 2015-11-29 by Ricardo Silva
9 votes
Published on 2015-11-29 by Ricardo Silva
Hi Ricardo.

I was trying the new function GetPrivateKey from v1.5 an it outputs the PrivateKey in Binary Data.
Why not output the Key in text instead of binary data?

If I want to use the Key in a function like EncryptAES256 It requires a password in text data type.
This way I need to use one more action, BinaryToBase64 from BinaryData extension, to get the key in text.

My suggestion is to output text instead of binary data, or have 2 function, one that outputs binary data and the other plain text.

Thanks ;)
I output the key in binary data so you can use it directly with the KEncrypt function.

EncryptAES256 with a text password does key derivation from the password which is not needed here, you should use the key directly.

I changed the function and noe I'm using the KEncrypt instead of the EncryptAES256.