[ 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

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

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

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

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

return: PublicKey
param: string|array $key

loadParameters($key)   X-Ref
Loads parameters

return: AsymmetricKey
param: string|array $key

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

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

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

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

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

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

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

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

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

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

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.

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

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.

return: string
param: string $h1

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

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

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

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

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

return: string
param: string $in