pssht
latest
SSH server library written in PHP
|
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. | |
fpoirotte\Pssht\Key\SSH\RSA::__construct | ( | $n, | |
$e, | |||
$d = null |
|||
) |
Construct a new public/private RSA key.
resource | $n | GMP resource representing the modulus to use during computations. |
resource | $e | GMP 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.
fpoirotte\Pssht\Key\SSH\RSA::check | ( | $message, | |
$signature | |||
) |
Check the signature for a message.
string | $message | Signed message. |
string | $signature | Signature to check. |
bool | true if the signature is valid for the given message, false otherwise. |
Implements fpoirotte\Pssht\Key\KeyInterface.
fpoirotte\Pssht\Key\SSH\RSA::serialize | ( | \fpoirotte\Pssht\Wire\Encoder | $encoder | ) |
Serialize a key.
fpoirotte::Pssht::Wire::Encoder | $encoder | Encoder to use to serialize the key. |
string | Serialized 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.
string | $message | Message to sign. |
string | Message signature. |
Implements fpoirotte\Pssht\Key\KeyInterface.