Toms Homepage
  Home    Downloads    Your Account    Forums  
  Create an account
· Home
· Games
· PHP Manual


(PHP 4 >= 4.0.4, PHP 5)

openssl_sign -- Generate signature


bool openssl_sign ( string data, string &signature, mixed priv_key_id [, int signature_alg] )


This function is EXPERIMENTAL. The behaviour of this function, the name of this function, and anything else documented about this function may change without notice in a future release of PHP. Use this function at your own risk.

Returns TRUE on success or FALSE on failure. If successful the signature is returned in signature.

openssl_sign() computes a signature for the specified data by using SHA1 for hashing followed by encryption using the private key associated with priv_key_id. Note that the data itself is not encrypted.

Example 1. openssl_sign() example

// $data is assumed to contain the data to be signed

// fetch private key from file and ready it
$fp = fopen("/src/openssl-0.9.6/demos/sign/key.pem", "r");
$priv_key = fread($fp, 8192);
$pkeyid = openssl_get_privatekey($priv_key);

// compute signature
openssl_sign($data, $signature, $pkeyid);

// free the key from memory

See also openssl_verify().

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 2004 by Tom Nitzschner.
Web site engine code is Copyright © 2003 by PHP-Nuke. All Rights Reserved. PHP-Nuke is Free Software released under the GNU/GPL license.
Page Generation: 0.116 Seconds

:: VereorLCARS phpbb2 style by Vereor :: PHP-Nuke theme by ::