[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/vendor/phpseclib/phpseclib/phpseclib/System/SSH/Agent/ -> Identity.php (summary)

Pure-PHP ssh-agent client. {@internal See http://api.libssh.org/rfc/PROTOCOL.agent}

Author: Jim Wigginton
Copyright: 2009 Jim Wigginton
License: http://www.opensource.org/licenses/mit-license.html MIT License
Link: http://phpseclib.sourceforge.net
File Size: 320 lines (9 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Identity:: (11 methods):
  __construct()
  withPublicKey()
  withPublicKeyBlob()
  getPublicKey()
  withHash()
  withPadding()
  withSignatureFormat()
  getCurve()
  sign()
  toString()
  withPassword()


Class: Identity  - X-Ref

Pure-PHP ssh-agent client identity object

Instantiation should only be performed by \phpseclib3\System\SSH\Agent class.
This could be thought of as implementing an interface that phpseclib3\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.

__construct($fsock)   X-Ref
Default Constructor.

param: resource $fsock

withPublicKey(PublicKey $key)   X-Ref
Set Public Key

Called by \phpseclib3\System\SSH\Agent::requestIdentities()

param: \phpseclib3\Crypt\Common\PublicKey $key

withPublicKeyBlob($key_blob)   X-Ref
Set Public Key

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

param: string $key_blob

getPublicKey($type = 'PKCS8')   X-Ref
Get Public Key

Wrapper for $this->key->getPublicKey()

param: string $type optional
return: mixed

withHash($hash)   X-Ref
Sets the hash

param: string $hash

withPadding($padding)   X-Ref
Sets the padding

Only PKCS1 padding is supported

param: string $padding

withSignatureFormat($format)   X-Ref
Determines the signature padding mode

Valid values are: ASN1, SSH2, Raw

param: string $format

getCurve()   X-Ref
Returns the curve

Returns a string if it's a named curve, an array if not

return: string|array

sign($message)   X-Ref
Create a signature

See "2.6.2 Protocol 2 private key signature request"

param: string $message
return: string

toString($type, array $options = [])   X-Ref
Returns the private key

param: string $type
param: array $options optional
return: string

withPassword($password = false)   X-Ref
Sets the password

param: string|bool $password
return: never