pssht
latest
SSH server library written in PHP
Main Page
Classes
Files
File List
Base.php
1
<?php
2
3
/*
4
* This file is part of pssht.
5
*
6
* (c) François Poirotte <clicky@erebot.net>
7
*
8
* For the full copyright and license information, please view the LICENSE
9
* file that was distributed with this source code.
10
*/
11
12
namespace
fpoirotte\Pssht\KEX\ECDH
;
13
18
abstract
class
Base
implements
19
\fpoirotte\Pssht\KEX\KEXInterface
,
20
\fpoirotte\Pssht\Algorithms\AvailabilityInterface,
21
\fpoirotte\Pssht\KEX\ECDH\BaseInterface
22
{
23
public
static
function
addHandlers(\
fpoirotte
\Pssht\
Transport
$transport)
24
{
25
$transport->setHandler(
26
\
fpoirotte
\Pssht\Messages\KEX\ECDH\INIT\RFC5656::getMessageId(),
27
new
\
fpoirotte
\Pssht\Handlers\KEX\ECDH\INIT\RFC5656()
28
);
29
}
30
31
public
function
hash
($data)
32
{
33
return
hash
(static::getHashName(), $data,
true
);
34
}
35
36
public
static
function
isAvailable
()
37
{
38
if
(!function_exists(
'hash_algos'
) || !function_exists(
'hash'
)) {
39
return
false
;
40
}
41
return
in_array(static::getHashName(), hash_algos(),
true
);
42
}
43
}
fpoirotte\Pssht\KEX\KEXInterface
Definition:
KEXInterface.php:17
fpoirotte\Pssht\KEX\ECDH\BaseInterface
Definition:
BaseInterface.php:18
fpoirotte\Pssht\KEX\ECDH\Base\isAvailable
static isAvailable()
Definition:
Base.php:36
fpoirotte\Pssht\KEX\ECDH\Base\hash
hash($data)
Definition:
Base.php:31
fpoirotte\Pssht\KEX\ECDH
Definition:
Base.php:12
fpoirotte\Pssht\Transport
Definition:
Transport.php:19
fpoirotte\Pssht\KEX\ECDH\Base
Definition:
Base.php:18
fpoirotte
src
KEX
ECDH
Base.php
Generated on Tue May 9 2017 12:09:55 for pssht by
1.8.11