Class RSAPublicKey

Description

A RSA Private key

Can be used to verify signatures and seal/encrypt data.

Located in /phpsatk/local/org.eenterphace.sat.crypto.openssl/rsa.public.key.php (line 35)


	
			
Method Summary
RSAPublicKey __construct (mixed $res)
string seal (string $data, array &$env_keys, [array[resource/RSAPublicKey] $add_keys = array()])
boolean verify (string $data, string $signature)
Methods
Constructor __construct (line 54)

Initializes a public key

The public key can be created from a resource (openssl_pkey_get_public), a File object, or a string.

Also checks whether the openssl extension is available.

  • access: public
RSAPublicKey __construct (mixed $res)
  • mixed $res
seal (line 103)

Seals (encrypts) data

Encrypts data using a single envelope key which is encrypted using RSA public keys. Data may be signed for multiple recipients each of them having his own encrypted envelope key.

The encrypted envelope keys will be returned using the reference on $env_keys which will contain count($add_keys)+1 elements. The first element is the evelope key for the recipient having this objects public key.

You will have to pass the envelope key corresponding to the recipient with the data.

  • return: Sealed data
  • access: public
string seal (string $data, array &$env_keys, [array[resource/RSAPublicKey] $add_keys = array()])
  • string $data: Data to seal
  • array $env_keys: Reference to an array where envelope keys will be stored.
  • array[resource/RSAPublicKey] $add_keys: Additional recipient keys.
verify (line 80)

Verifies signed data

  • access: public
boolean verify (string $data, string $signature)
  • string $data: Data
  • string $signature: Signature (RSA encrypted SHA1-hash)

Documentation generated on Mon, 21 May 2007 10:35:18 +0200 by phpDocumentor 1.3.0RC5