MainWP Child Documentation

AsymmetricKey
in package

AbstractYes

Base Class for all asymmetric cipher classes

Tags
author

Jim Wigginton terrafrost@php.net

Table of Contents

Properties

$engines  : array<string|int, bool>
Available Engines
$format  : string
Format of the loaded key
$hash  : Hash
Hash function
$one  : BigInteger
Precomputed One
$zero  : BigInteger
Precomputed Zero
$comment  : null|string
Key Comment
$hmac  : Hash
HMAC function
$invisiblePlugins  : array<string|int, mixed>
Invisible plugins
$plugins  : array<string|int, mixed>
Supported plugins (lower case)

Methods

__toString()  : string
__toString() magic method
addFileFormat()  : bool
Add a fileformat plugin
getComment()  : null|string
Returns the key's comment
getHash()  : mixed
Returns the hash algorithm currently being used
getLoadedFormat()  : mixed
Returns the format of the loaded key.
getSupportedKeyFormats()  : array<string|int, mixed>
Returns a list of supported formats.
load()  : PublicKey|PrivateKey
Load the key
loadFormat()  : static
Load the key, assuming a specific format
loadParameters()  : AsymmetricKey
Loads parameters
loadParametersFormat()  : AsymmetricKey
Loads parameters
loadPrivateKey()  : PrivateKey
Loads a private key
loadPrivateKeyFormat()  : PrivateKey
Loads a private key
loadPublicKey()  : PublicKey
Loads a public key
loadPublicKeyFormat()  : PublicKey
Loads a public key
toString()  : array<string|int, mixed>|string
useBestEngine()  : mixed
Tests engine validity
useInternalEngine()  : mixed
Flag to use internal engine only (useful for unit testing)
withHash()  : mixed
Determines which hashing function should be used
__construct()  : mixed
The constructor
bits2int()  : BigInteger
Bit String to Integer
computek()  : string
Compute the pseudorandom k for signature generation, using the process specified for deterministic DSA.
initialize_static_variables()  : mixed
Initialize static variables
validatePlugin()  : mixed
Validate Plugin
bits2octets()  : string
Bit String to Octet String
int2octets()  : string
Integer to Octet String
loadPlugins()  : mixed
Load Plugins

Properties

$engines

Available Engines

protected static array<string|int, bool> $engines = []

$invisiblePlugins

Invisible plugins

private static array<string|int, mixed> $invisiblePlugins = []
Tags
see
self::initialize_static_variables()

$plugins

Supported plugins (lower case)

private static array<string|int, mixed> $plugins = []
Tags
see
self::initialize_static_variables()

Methods

__toString()

__toString() magic method

public __toString() : string
Return values
string

addFileFormat()

Add a fileformat plugin

public static addFileFormat(string $fullname) : bool

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.

Parameters
$fullname : string
Tags
see
self::load()
Return values
bool

getComment()

Returns the key's comment

public getComment() : null|string

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

Return values
null|string

getHash()

Returns the hash algorithm currently being used

public getHash() : mixed

getLoadedFormat()

Returns the format of the loaded key.

public 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.

Tags
see
self::load()

getSupportedKeyFormats()

Returns a list of supported formats.

public static getSupportedKeyFormats() : array<string|int, mixed>
Return values
array<string|int, mixed>

loadFormat()

Load the key, assuming a specific format

public static loadFormat(string $type, string $key[, string $password = false ]) : static
Parameters
$type : string
$key : string
$password : string = false

optional

Return values
static

loadParameters()

Loads parameters

public static loadParameters(string|array<string|int, mixed> $key) : AsymmetricKey
Parameters
$key : string|array<string|int, mixed>
Return values
AsymmetricKey

loadParametersFormat()

Loads parameters

public static loadParametersFormat(string $type, string|array<string|int, mixed> $key) : AsymmetricKey
Parameters
$type : string
$key : string|array<string|int, mixed>
Return values
AsymmetricKey

loadPrivateKey()

Loads a private key

public static loadPrivateKey(string|array<string|int, mixed> $key[, string $password = '' ]) : PrivateKey
Parameters
$key : string|array<string|int, mixed>
$password : string = ''

optional

Return values
PrivateKey

loadPrivateKeyFormat()

Loads a private key

public static loadPrivateKeyFormat(string $type, string $key[, string $password = false ]) : PrivateKey
Parameters
$type : string
$key : string
$password : string = false

optional

Return values
PrivateKey

loadPublicKey()

Loads a public key

public static loadPublicKey(string|array<string|int, mixed> $key) : PublicKey
Parameters
$key : string|array<string|int, mixed>
Return values
PublicKey

loadPublicKeyFormat()

Loads a public key

public static loadPublicKeyFormat(string $type, string $key) : PublicKey
Parameters
$type : string
$key : string
Return values
PublicKey

toString()

public abstract toString(string $type[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>|string
Parameters
$type : string
$options : array<string|int, mixed> = []
Return values
array<string|int, mixed>|string

useBestEngine()

Tests engine validity

public static useBestEngine() : mixed

useInternalEngine()

Flag to use internal engine only (useful for unit testing)

public static useInternalEngine() : mixed

withHash()

Determines which hashing function should be used

public withHash(string $hash) : mixed
Parameters
$hash : string

__construct()

The constructor

protected __construct() : mixed

computek()

Compute the pseudorandom k for signature generation, using the process specified for deterministic DSA.

protected computek(string $h1) : string
Parameters
$h1 : string
Return values
string

initialize_static_variables()

Initialize static variables

protected static initialize_static_variables() : mixed

validatePlugin()

Validate Plugin

protected static validatePlugin(string $format, string $type[, string $method = null ]) : mixed
Parameters
$format : string
$type : string
$method : string = null

optional

bits2octets()

Bit String to Octet String

private bits2octets(string $in) : string
Parameters
$in : string
Return values
string

loadPlugins()

Load Plugins

private static loadPlugins(string $format) : mixed
Parameters
$format : string

        
On this page

Search results