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

Public Member Functions

 __construct (\fpoirotte\Pssht\ECC\Point $Q, $d=null)
 
 check ($message, $signature)
 
 getPublic ()
 
 getRNG ()
 
 isValid ()
 
 serialize (\fpoirotte\Pssht\Wire\Encoder $encoder)
 
 setRNG (\fpoirotte\Pssht\Random\RandomInterface $rng)
 
 sign ($message, $raw_output=false)
 
- Public Member Functions inherited from fpoirotte\Pssht\Key\KeyInterface
 sign ($message)
 

Static Public Member Functions

static getName ()
 Return the name of the algorithm.
 
static unserialize (\fpoirotte\Pssht\Wire\Decoder $decoder, $private=null)
 
- Static Public Member Functions inherited from fpoirotte\Pssht\Key\ECDSA\SHA2\BaseInterface
static getHash ()
 
static getIdentifier ()
 

Protected Attributes

 $d
 Private key.
 
 $Q
 Public key.
 
 $rng
 RNG.
 

Detailed Description

Abstract class for a Public key using the Elliptic Curve Digital Signature Algorithm (ECDSA).

Definition at line 18 of file Base.php.

Constructor & Destructor Documentation

fpoirotte\Pssht\Key\ECDSA\SHA2\Base::__construct ( \fpoirotte\Pssht\ECC\Point  $Q,
  $d = null 
)

Construct a new public/private ECDSA key with the NIST P-256 elliptic curve.

Parameters
Point$QGMP resource containing public key Q from ECDSA.
resource$d(optional) GMP resource containing the private key. If omitted, only the public part of the key is loaded, meaning that signature generation will be unavailable.

Definition at line 44 of file Base.php.

References fpoirotte\Pssht\Key\ECDSA\SHA2\Base\$d, and fpoirotte\Pssht\Key\ECDSA\SHA2\Base\$Q.

Member Function Documentation

fpoirotte\Pssht\Key\ECDSA\SHA2\Base::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 111 of file Base.php.

fpoirotte\Pssht\Key\ECDSA\SHA2\Base::getRNG ( )

Get the Random Number Generator associated with this key.

Return values
fpoirotte::Pssht::Random::RandomInterfaceRNG associated with this key.

Definition at line 140 of file Base.php.

References fpoirotte\Pssht\Key\ECDSA\SHA2\Base\$rng.

fpoirotte\Pssht\Key\ECDSA\SHA2\Base::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 56 of file Base.php.

References fpoirotte\Pssht\Key\ECDSA\SHA2\Base\$Q.

fpoirotte\Pssht\Key\ECDSA\SHA2\Base::setRNG ( \fpoirotte\Pssht\Random\RandomInterface  $rng)

Set the Random Number Generator to use when signing messages with this key.

Parameters
fpoirotte::Pssht::Random::RandomInterface$rngNew RNG to use.

Definition at line 152 of file Base.php.

References fpoirotte\Pssht\Key\ECDSA\SHA2\Base\$Q, and fpoirotte\Pssht\Key\ECDSA\SHA2\Base\$rng.


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