PHP Класс phpseclib\System\SSH\Agent\Identity

Instantiation should only be performed by \phpseclib\System\SSH\Agent class. This could be thought of as implementing an interface that phpseclib\Crypt\RSA implements. ie. maybe a Net_SSH_Auth_PublicKey interface or something. The methods in this interface would be getPublicKey and sign since those are the methods phpseclib looks for to perform public key authentication.
Автор: Jim Wigginton ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$fsock resource Socket Resource
$key phpseclib\Crypt\RSA Key Object
$key_blob string Key Blob

Открытые методы

Метод Описание
__construct ( resource $fsock ) : Identity Default Constructor.
getPublicKey ( integer $type = 'PKCS8' ) : mixed Get Public Key
setHash ( string $hash = 'sha1' ) Sets the hash
setPublicKey ( phpseclib\Crypt\RSA $key ) Set Public Key
setPublicKeyBlob ( string $key_blob ) Set Public Key
sign ( string $message, integer $padding = RSA::PADDING_PKCS1 ) : string Create a signature

Описание методов

__construct() публичный Метод

Default Constructor.
public __construct ( resource $fsock ) : Identity
$fsock resource
Результат Identity

getPublicKey() публичный Метод

Wrapper for $this->key->getPublicKey()
public getPublicKey ( integer $type = 'PKCS8' ) : mixed
$type integer optional
Результат mixed

setHash() публичный Метод

ssh-agent only supports signatures with sha1 hashes but to maintain BC with RSA.php this function exists
public setHash ( string $hash = 'sha1' )
$hash string optional

setPublicKey() публичный Метод

Called by \phpseclib\System\SSH\Agent::requestIdentities()
public setPublicKey ( phpseclib\Crypt\RSA $key )
$key phpseclib\Crypt\RSA

setPublicKeyBlob() публичный Метод

Called by \phpseclib\System\SSH\Agent::requestIdentities(). The key blob could be extracted from $this->key but this saves a small amount of computation.
public setPublicKeyBlob ( string $key_blob )
$key_blob string

sign() публичный Метод

See "2.6.2 Protocol 2 private key signature request"
public sign ( string $message, integer $padding = RSA::PADDING_PKCS1 ) : string
$message string
$padding integer optional
Результат string

Описание свойств

$fsock публичное свойство

Socket Resource
См. также: self::sign()
public resource $fsock
Результат resource

$key публичное свойство

Key Object
См. также: self::getPublicKey()
public RSA,phpseclib\Crypt $key
Результат phpseclib\Crypt\RSA

$key_blob публичное свойство

Key Blob
См. также: self::sign()
public string $key_blob
Результат string