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

Public Member Functions

 __construct ($p, $q, $g, $y, $x=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\x20\x30\x0c\x06\x08\x2a\x86\x48\x86\xf7\x0d\x02\x05\x05\x00\x04\x10"
 DER header for DSA.
 

Protected Attributes

 $g
 DSA parameter g.
 
 $p
 DSA parameter p.
 
 $q
 DSA prime number.
 
 $x
 Private key.
 
 $y
 Public key.
 

Detailed Description

Public key using the Digital Signature Algorithm (DSA), as used in the Digital Signature Standard (DSS).

Definition at line 18 of file DSS.php.

Constructor & Destructor Documentation

fpoirotte\Pssht\Key\SSH\DSS::__construct (   $p,
  $q,
  $g,
  $y,
  $x = null 
)

Construct a new public/private DSA key.

Parameters
resource$pGMP resource containing the p parameter for DSA.
resource$qGMP resource containing the q parameter for DSA.
resource$gGMP resource containing the g parameter for DSA.
resource$yGMP resource containing the public key.
resource$x(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 60 of file DSS.php.

References fpoirotte\Pssht\Key\SSH\DSS\$g, fpoirotte\Pssht\Key\SSH\DSS\$p, fpoirotte\Pssht\Key\SSH\DSS\$q, fpoirotte\Pssht\Key\SSH\DSS\$x, and fpoirotte\Pssht\Key\SSH\DSS\$y.

Member Function Documentation

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

Referenced by fpoirotte\Pssht\Key\SSH\DSS\sign().

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

References fpoirotte\Pssht\Key\SSH\DSS\$g, fpoirotte\Pssht\Key\SSH\DSS\$p, fpoirotte\Pssht\Key\SSH\DSS\$q, and fpoirotte\Pssht\Key\SSH\DSS\$y.

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

References fpoirotte\Pssht\Key\SSH\DSS\check().


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