If you don't specify -out the openssl command (I think, untested) will spit the results to STDOUT, in which case you could do this:

$results = `openssl smime smime -sign -outform der -nodetach -signer $certificate -in $encoded`;

and then you probably want to chomp $results, or parse them in some fashion, assuming the first line of output is what you want.

If you send the results to a file via the -out flag, then you'd have to specify a file name and then slurp back in the results:

system("openssl smime smime -sign -outform der -nodetach -out $filename -signer $certificate -in $encoded");

and then

open INFILE, $filename or die "Can't open $filename: $!";
$results = <INFILE>;
close INFILE;
chomp $results;

That is assuming that the results that you're interested in is just the first line of the file.

Also note that system('$command') is not the same as with double quotes, i.e. system("$command").

With single quotes the $command won't be interpreted. You need double quotes in this case in order for the date command to be successfully executed.

Pete

On Nov 10, 2005, at 9:32 AM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:

If I have:
$certificate = "/home/oracle/certs/oracle.pem";
$encoded = encode_base64($sha1data);

Can I do something like this:

system('openssl smime smime -sign -outform der -nodetach -out $signed
-signer $certificate -in $encoded');

To get a value for $signed?

Paul Fontenot
WFS - CAST Operations
Email: [EMAIL PROTECTED]
Phone: (480) 437-7795

This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose, or take any action based on this message or any information herein. If you have received this message in error, please
advise the sender immediately by reply e-mail and delete this message.
Thank you for your cooperation.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to