SSL sign certificate

Hello, I am developing an application and I have to sign a text with the following requirements.
hit the php code I have to translate xojo.
could someone help me?

[code]# This functions makes the PKCS#7 signature using TRA as input file, CERT and

PRIVATEKEY to sign. Generates an intermediate file and finally trims the

MIME heading leaving the final CMS required by WSAA.

function SignTRA()
{
$STATUS=openssl_pkcs7_sign(“TRA.xml”, “TRA.tmp”, “file://”.CERT,
array(“file://”.PRIVATEKEY, PASSPHRASE),
array(),
!PKCS7_DETACHED
);
if (!$STATUS) {exit(“ERROR generating PKCS#7 signature
“);}
$inf=fopen(“TRA.tmp”, “r”);
$i=0;
$CMS=””;
while (!feof($inf))
{
$buffer=fgets($inf);
if ( $i++ >= 4 ) {$CMS.=$buffer;}
}
fclose($inf);

unlink(“TRA.xml”);

unlink(“TRA.tmp”);
return $CMS;
}[/code]

You can’t sign with a PKCS#7 signature directly in Xojo. You could use the OpenSSL command line from a Shell class.