\Gishiki\Security\Encryption\AsymmetricPublicKey

This class represents a public key for the asymmetric encryption engine.

Note: This class uses OpenSSL for strong encryption

Summary

Methods
Properties
Constants
__construct()
__destruct()
isLoaded()
__invoke()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$key
N/A

Properties

$key

$key : resource

Type

resource — the public key ready to be used by OpenSSL

Methods

__construct()

__construct(string  $key) 

Used to create a public key from the given string.

Parameters

string $key

the public key serialized as a string

Throws

\InvalidArgumentException

the given key isn't a valid serialized key

\Gishiki\Security\Encryption\Asymmetric\AsymmetricException

the given key is invalid

__destruct()

__destruct() 

Free resources used to hold this private key.

isLoaded()

isLoaded() : boolean

Check if the key has been loaded.

Returns

boolean —

true if the key has been loaded

__invoke()

__invoke() : array

Export a reference to the native private key and its length in bits.

Throws

\Gishiki\Security\Encryption\Asymmetric\AsymmetricException

the key cannot be exported

Returns

array —

the array that contains the key and its legth (in bytes)