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

Public Member Functions

 __construct ($pk, $sk=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 isAvailable ()
 
static unserialize (\fpoirotte\Pssht\Wire\Decoder $decoder, $private=null)
 

Static Protected Member Functions

static decodeint ($s)
 
static decodepoint ($s)
 
static encodeint ($y)
 
static encodepoint ($P)
 
static hashint ($m)
 
static isOnCurve ($P)
 

Protected Attributes

 $pk
 Public key.
 
 $sk
 Private (secret) key.
 

Detailed Description

Public key algorithm based on EdDSA (Edwards-curve Digital Signature Algorithm) using curve "Ed25519".

See also
http://ed25519.cr.yp.to/ed25519-20110926.pdf for more information about this algorithm.
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL.key?rev=1.1 for the specification of OpenSSH's private key format.

Definition at line 25 of file ED25519.php.

Constructor & Destructor Documentation

fpoirotte\Pssht\Key\SSH\ED25519::__construct (   $pk,
  $sk = null 
)

Construct a new public/private EdDSA key.

Parameters
string$pkPublic key as a string.
string$sk(optional) Private key as a string. If omitted, only the public part of the key is loaded, meaning that signature generation will be unavailable.

Definition at line 48 of file ED25519.php.

References fpoirotte\Pssht\Key\SSH\ED25519\$pk, and fpoirotte\Pssht\Key\SSH\ED25519\$sk.

Member Function Documentation

fpoirotte\Pssht\Key\SSH\ED25519::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 181 of file ED25519.php.

static fpoirotte\Pssht\Key\SSH\ED25519::isAvailable ( )
static

Determine whether the algorithm is available.

Return values
booltrue if the algorithm is available, false otherwise.

Implements fpoirotte\Pssht\Algorithms\AvailabilityInterface.

Definition at line 78 of file ED25519.php.

fpoirotte\Pssht\Key\SSH\ED25519::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 62 of file ED25519.php.

References fpoirotte\Pssht\Key\SSH\ED25519\$pk.

fpoirotte\Pssht\Key\SSH\ED25519::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 150 of file ED25519.php.


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