DH Parameters
author | Jim Wigginton terrafrost@php.net |
---|---|
package | Default |
__construct()
__toString(): string
string
addFileFormat(string $fullname): boolean
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 | \phpseclib3\Crypt\Common\AsymmetricKey::load() |
---|
string
boolean
bits2int(string $in): \phpseclib3\Math\BigInteger
bits2octets(string $in): string
string
string
computek(string $h1): string
string
string
computeSecret(\phpseclib3\Crypt\DH\PrivateKey|\phpseclib3\Crypt\EC $private,\phpseclib3\Crypt\DH\PublicKey|\phpseclib3\Math\BigInteger|string $public): mixed
createKey(\phpseclib3\Crypt\DH\Parameters $params,integer $length): \phpseclib3\Crypt\DH\PrivateKey
The rationale for the second parameter is described in http://tools.ietf.org/html/rfc4419#section-6.2 :
"To increase the speed of the key exchange, both client and server may reduce the size of their private exponents. It should be at least twice as long as the key material that is generated from the shared secret. For more details, see the paper by van Oorschot and Wiener [VAN-OORSCHOT]."
$length is in bits
\phpseclib3\Crypt\DH\Parameters
integer
optional
\phpseclib3\Crypt\DH\PrivateKey
createParameters( $args): \phpseclib3\Crypt\DH\Parameters
This method is a bit polymorphic. It can take any of the following:
\phpseclib3\Crypt\DH\Parameters
getComment(): null|string
Not all key formats support comments. If you want to set a comment use toString()
null|string
getHash()
getLoadedFormat(): mixed
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 | \phpseclib3\Crypt\Common\AsymmetricKey::load() |
---|---|
mixed
getParameters(): mixed
A public / private key is only returned if the currently loaded "key" contains an x or y value.
see | self::getPublicKey() |
---|---|
mixed
getSupportedKeyFormats(): array
array
initialize_static_variables()
int2octets(\phpseclib3\Math\BigInteger $v): string
load(string $key,string $password = false): \phpseclib3\Crypt\Common\AsymmetricKey
loadFormat(string $type,string $key,string $password = false): static
string
string
string
optional
static
loadParameters(string|array $key): \phpseclib3\Crypt\Common\AsymmetricKey
loadParametersFormat(string $type,string|array $key): \phpseclib3\Crypt\Common\AsymmetricKey
loadPlugins(string $format)
string
loadPrivateKey(string|array $key,string $password = ''): \phpseclib3\Crypt\Common\PrivateKey
loadPrivateKeyFormat(string $type,string $key,string $password = false): \phpseclib3\Crypt\Common\PrivateKey
string
string
string
optional
\phpseclib3\Crypt\Common\PrivateKey
loadPublicKey(string|array $key): \phpseclib3\Crypt\Common\PublicKey
loadPublicKeyFormat(string $type,string $key): \phpseclib3\Crypt\Common\PublicKey
onLoad(array $components): boolean
array
boolean
toString(string $type,array $options = array()): string
string
array
string
useBestEngine()
useInternalEngine()
validatePlugin(string $format,string $type,string $method = null): mixed
string
string
string
optional
mixed
withHash(string $hash)
string
ALGORITHM
var |
---|
base :\phpseclib3\Math\BigInteger
zero :\phpseclib3\Math\BigInteger
one :\phpseclib3\Math\BigInteger
format :string
var |
---|
string
plugins :array
see | |
---|---|
var |
array
invisiblePlugins :array
see | |
---|---|
var |
array
engines :array<mixed,boolean>
var |
---|
array<mixed,boolean>
Key Comment
Type(s)
null|string