[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/ -> AsymmetricKey.php (summary)

Base Class for all asymmetric key ciphers PHP version 5

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

Defines 25 functions

  __construct()
  initialize_static_variables()
  load()
  loadPrivateKey()
  loadPublicKey()
  loadParameters()
  loadFormat()
  loadPrivateKeyFormat()
  loadPublicKeyFormat()
  loadParametersFormat()
  validatePlugin()
  loadPlugins()
  getSupportedKeyFormats()
  addFileFormat()
  getLoadedFormat()
  getComment()
  useBestEngine()
  useInternalEngine()
  __toString()
  withHash()
  getHash()
  computek()
  int2octets()
  bits2int()
  bits2octets()

Functions
Functions that are not part of a class:

__construct()   X-Ref
The constructor


initialize_static_variables()   X-Ref
Initialize static variables


load($key, $password = false)   X-Ref
Load the key

param: string $key
param: string $password optional
return: \phpseclib3\Crypt\Common\PublicKey|\phpseclib3\Crypt\Common\PrivateKey

loadPrivateKey($key, $password = '')   X-Ref
Loads a private key

param: string|array $key
param: string $password optional
return: PrivateKey

loadPublicKey($key)   X-Ref
Loads a public key

param: string|array $key
return: PublicKey

loadParameters($key)   X-Ref
Loads parameters

param: string|array $key
return: AsymmetricKey

loadFormat($type, $key, $password = false)   X-Ref
Load the key, assuming a specific format

param: string $type
param: string $key
param: string $password optional
return: static

loadPrivateKeyFormat($type, $key, $password = false)   X-Ref
Loads a private key

param: string $type
param: string $key
param: string $password optional
return: PrivateKey

loadPublicKeyFormat($type, $key)   X-Ref
Loads a public key

param: string $type
param: string $key
return: PublicKey

loadParametersFormat($type, $key)   X-Ref
Loads parameters

param: string $type
param: string|array $key
return: AsymmetricKey

validatePlugin($format, $type, $method = null)   X-Ref
Validate Plugin

param: string $format
param: string $type
param: string $method optional
return: mixed

loadPlugins($format)   X-Ref
Load Plugins

param: string $format

getSupportedKeyFormats()   X-Ref
Returns a list of supported formats.

return: array

addFileFormat($fullname)   X-Ref
Add a fileformat plugin

The plugin needs to either already be loaded or be auto-loadable.
Loading a plugin whose shortname overwrite an existing shortname will overwrite the old plugin.

param: string $fullname
see: self::load()
return: bool

getLoadedFormat()   X-Ref
Returns the format of the loaded key.

If the key that was loaded wasn't in a valid or if the key was auto-generated
with RSA::createKey() then this will throw an exception.

see: self::load()
return: mixed

getComment()   X-Ref
Returns the key's comment

Not all key formats support comments. If you want to set a comment use toString()

return: null|string

useBestEngine()   X-Ref
Tests engine validity


useInternalEngine()   X-Ref
Flag to use internal engine only (useful for unit testing)


__toString()   X-Ref
__toString() magic method

return: string

withHash($hash)   X-Ref
Determines which hashing function should be used

param: string $hash

getHash()   X-Ref
Returns the hash algorithm currently being used


computek($h1)   X-Ref
Compute the pseudorandom k for signature generation,
using the process specified for deterministic DSA.

param: string $h1
return: string

int2octets($v)   X-Ref
Integer to Octet String

param: \phpseclib3\Math\BigInteger $v
return: string

bits2int($in)   X-Ref
Bit String to Integer

param: string $in
return: \phpseclib3\Math\BigInteger

bits2octets($in)   X-Ref
Bit String to Octet String

param: string $in
return: string