feeding a private rsa key through the shell to get the public
Thierry Douez
th.douez at gmail.com
Sun May 5 05:08:05 EDT 2013
Hi,
this works:
on mouseUp
local _code, _decode,str2code,Result_code,Result_decode
put "Live is beautiful" into str2code
put "echo -n " "e& str2code "e & " | openssl enc -base64" into
_code
put shell( _code ) into Result_code
put "echo -n " "e& Result_code "e & " | openssl enc -base64 -d"
into _decode
put shell( _decode ) into Result_decode
put "Want to encode: " & str2code &cr& \
"Result coding: " & Result_code &cr& \
"Result decoding: " & Result_decode &cr& \
"Equals?" & ( str2code is Result_decode )
end mouseUp
and in the message box:
Want to encode: Live is beautiful
Result coding: TGl2ZSBpcyBiZWF1dGlmdWw=
Result decoding: Live is beautiful
Equals?true
Regards,
Thierry
------------------------------------------------
Thierry Douez - http://sunny-tdz.com
Maker of sunnYperl - sunnYmidi - sunnYmage
2013/5/5 Dr. Hawkins <dochawk at gmail.com>
> I'm successfully generating an rsa key and putting it where I needed it (a
> field).
>
> I'm not having any luck extracting it from a shell command.
>
> I want to do something like
>
> put the shell of "echo " & fld privateKey & " | openssl rsa -pubout"
>
> but this yields a blank line and the private key.
>
> (on the command line,
> cat testkey.pem | openssl rsa -pubout
>
> produces the public key)
>
> I'm trying to avoid writing a diskfile or making any assumptions about the
> file system.
>
> --
> Dr. Richard E. Hawkins, Esq.
> (702) 508-8462
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
More information about the use-livecode
mailing list