- Phil Roth
- PowerBuilder
- Wednesday, 4 September 2019 02:24 PM UTC
Hi,
We are trying to encrypt log on information using Asymmetric Encryption RSA 2048 using PB17 R3
The Public Key is being provided by another system using OpenSSH which we are receiving as a .PEM file.
When I try and use this Public Key to encrypt, I'm getting following error :-
"Powerbuilder Application execution Error R0208" and "Invalid PubKey in asymmetric Encrypt".
Please can you advise how I need to format the contents of the .PEM file. I've tried using the Base64Decode
sPublicKey = '-----BEGIN RSA PUBLIC KEY-----' + '~r~n' + &
'MIIBCgKCAQEA2E7AXucgl0h6kEo7QWgZRuCsTHuroFrIH6oh0emJTBeLsUqqLFu5+LiRvV2QKGIqF9KpiCAatiBEpTSPtXbFlFdCrSsjGg7q/eqkA/sN+FwwtLpRFwMazNwAtJ5YQk1hdFosWkG0beVYpfqfeWHxNAdwS01SujYuZRUzlXnq/OARfLzNketOYRc9TpQvZaeCjbavqmm7VSLn3we3Mezcpj75KP5ozwRCydiBJS1Yy5I3pK+fgWtePZeqenq78Vn+C0n8ZgkQFdqmDUKSGV9BnbKy3+qfKZifF9f1ppcM4r0XMzZeXXOnjAWoK8LGYefz3s9l2ltMKeMd30464/ywqwIDAQAB' + '~r~n' + &
'-----END RSA PUBLIC KEY-----'
ls_Base64Str =sPublicKey
lblb_pubkey = lnv_CoderObject.Base64Decode(ls_Base64Str)
messagebox("Base64Decode", string(lblb_pubkey, EncodingANSI!))
lblb_encrypt = lnv_CrypterObject.AsymmetricEncrypt(RSA!, lblb_data, lblb_pubKey)
Public Key Error
Regards
Phil
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.