Greetings,
It seems that i have some problems on using keys that were generated outside xojo in order to encrypt / decrypt data .
I have a .p12 file with all the details needed, when i use terminal and i do my tests via openssl i get all the files however i get BER decoding error on xojo side.
If i run :
openssl pkcs12 -in p12File -info
i get the following header :
MAC Iteration 100000
MAC verified OK
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 50000
and below 2
-----BEGIN ENCRYPTED PRIVATE KEY-----
-----END ENCRYPTED PRIVATE KEY-----
and
5 x
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
So far all ok , now in order to Extract the needed Certificate and key i use again openssl and i have the following :
Getting User Cert File :
openssl pkcs12 -in p12File -clcerts -nokeys -out Client.crt
Getting User Key File :
openssl pkcs12 -in p12File -nocerts -out Client.key
Getting CA Certs :
openssl pkcs12 -in p12File -nokeys -cacerts -out CA.crt
All good here so far . i decrypt the encrypted private key
openssl rsa -in Client.key -out Client_decrypted.key
And once i try to use the Client.crt and Client_decrypted.key in order to Encrypt and decript some data i end up with the lovely
BER decode error
Can somebody clarify for me if there is a way for me to use those keys using Crypto from XOJO or not ? And if Yes then how ? what do i need to do in order to use it properly ?
Apparently certs are Base64 encoded i guess, as well the key.
Thanks in advance.