pssht  latest
SSH server library written in PHP
fpoirotte\Pssht\Key\SSH\RSA Class Reference
+ Inheritance diagram for fpoirotte\Pssht\Key\SSH\RSA:

Public Member Functions

 __construct ($n, $e, $d=null)
 
 check ($message, $signature)
 
 serialize (\fpoirotte\Pssht\Wire\Encoder $encoder)
 
 sign ($message)
 

Static Public Member Functions

static getName ()
 Return the name of the algorithm.
 
static unserialize (\fpoirotte\Pssht\Wire\Decoder $decoder, $private=null)
 

Public Attributes

const DER_HEADER = "\x30\x21\x30\x09\x06\x05\x2b\x0e\x03\x02\x1a\x05\x00\x04\x14"
 DER header for RSA.
 

Protected Attributes

 $d
 Private exponent.
 
 $e
 Public exponent.
 
 $n
 Modulus.
 

Detailed Description

Public key using the RSA algorithm.

Definition at line 17 of file RSA.php.

Constructor & Destructor Documentation

fpoirotte\Pssht\Key\SSH\RSA::__construct (   $n,
  $e,
  $d = null 
)

Construct a new public/private RSA key.

Parameters
resource$nGMP resource representing the modulus to use during computations.
resource$eGMP resource for the public exponent.
resource$d(optional) GMP resource for the private exponent. If omitted, only the public part of the key is loaded, meaning that signature generation will be unavailable.

Definition at line 47 of file RSA.php.

References fpoirotte\Pssht\Key\SSH\RSA\$d, fpoirotte\Pssht\Key\SSH\RSA\$e, and fpoirotte\Pssht\Key\SSH\RSA\$n.

Member Function Documentation

fpoirotte\Pssht\Key\SSH\RSA::check (   $message,
  $signature 
)

Check the signature for a message.

Parameters
string$messageSigned message.
string$signatureSignature to check.
Return values
booltrue if the signature is valid for the given message, false otherwise.

Implements fpoirotte\Pssht\Key\KeyInterface.

Definition at line 105 of file RSA.php.

fpoirotte\Pssht\Key\SSH\RSA::serialize ( \fpoirotte\Pssht\Wire\Encoder  $encoder)

Serialize a key.

Parameters
fpoirotte::Pssht::Wire::Encoder$encoderEncoder to use to serialize the key.
Return values
stringSerialized representation of the key.

Implements fpoirotte\Pssht\Key\KeyInterface.

Definition at line 59 of file RSA.php.

References fpoirotte\Pssht\Key\SSH\RSA\$e, and fpoirotte\Pssht\Key\SSH\RSA\$n.

fpoirotte\Pssht\Key\SSH\RSA::sign (   $message)

Sign a message using the key.

Parameters
string$messageMessage to sign.
Return values
stringMessage signature.

Implements fpoirotte\Pssht\Key\KeyInterface.

Definition at line 77 of file RSA.php.


The documentation for this class was generated from the following file: