pssht  latest
SSH server library written in PHP
fpoirotte\Pssht\KeyStore Class Reference

Public Member Functions

 __construct ()
 
 add ($user,\fpoirotte\Pssht\Key\KeyInterface $key)
 
 count ($user)
 
 exists ($user, $key)
 
 get ($user)
 
 remove ($user,\fpoirotte\Pssht\Key\KeyInterface $key)
 

Protected Member Functions

 getIdentifier (\fpoirotte\Pssht\Key\KeyInterface $key)
 

Protected Attributes

 $keys
 Public/private keys currently stored.
 

Detailed Description

Provides storage for public/private keys.

Definition at line 17 of file KeyStore.php.

Constructor & Destructor Documentation

fpoirotte\Pssht\KeyStore::__construct ( )

Construct a new store.

Definition at line 25 of file KeyStore.php.

Member Function Documentation

fpoirotte\Pssht\KeyStore::add (   $user,
\fpoirotte\Pssht\Key\KeyInterface  $key 
)

Add a new key in the store.

Parameters
string$userUser the key belongs to.
fpoirotte::Pssht::Key::KeyInterface$keyPublic/private key to add.

Definition at line 55 of file KeyStore.php.

References fpoirotte\Pssht\KeyStore\getIdentifier().

fpoirotte\Pssht\KeyStore::count (   $user)

Return the number of keys currently registered for the given user.

Parameters
string$userUser whose keys must be counted.
Return values
intNumber of available keys for the given user.

Definition at line 145 of file KeyStore.php.

fpoirotte\Pssht\KeyStore::exists (   $user,
  $key 
)

Test whether a given key as been registered for a specific user.

Parameters
string$userUser for which the key is tested.
string | fpoirotte::Pssht::Key::KeyInterface$keyKey to test.
Return values
booltrue if the given key has been registered for the given user, false otherwise.

Definition at line 119 of file KeyStore.php.

References fpoirotte\Pssht\KeyStore\getIdentifier().

fpoirotte\Pssht\KeyStore::get (   $user)

Retrieve a list of the keys currently stored for the given user.

Parameters
string$userUser whose keys should be retrieved.
Return values
arrayPublic/private keys for the given user.

Definition at line 92 of file KeyStore.php.

fpoirotte\Pssht\KeyStore::getIdentifier ( \fpoirotte\Pssht\Key\KeyInterface  $key)
protected

Return the identifier for a key.

Parameters
fpoirotte::Pssht::Key::KeyInterface$keyPublic or private key.
Return values
stringSSH identifier for the key.

Definition at line 39 of file KeyStore.php.

Referenced by fpoirotte\Pssht\KeyStore\add(), fpoirotte\Pssht\KeyStore\exists(), and fpoirotte\Pssht\KeyStore\remove().

fpoirotte\Pssht\KeyStore::remove (   $user,
\fpoirotte\Pssht\Key\KeyInterface  $key 
)

Remove a key from the store.

Parameters
string$userUser the key belongs to.
fpoirotte::Pssht::Key::KeyInterface$keyPublic/private key to remove.

Definition at line 73 of file KeyStore.php.

References fpoirotte\Pssht\KeyStore\getIdentifier().


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