cryptal  latest
Cryptography Abstraction Layer
fpoirotte\Cryptal\Registry Class Reference

Public Member Functions

 addCipher ($packageName, $cls, CipherEnum $cipher, ModeEnum $mode, ImplementationTypeEnum $type)
 
 addHash ($packageName, $cls, HashEnum $algo, ImplementationTypeEnum $type)
 
 addMac ($packageName, $cls, MacEnum $algo, ImplementationTypeEnum $type)
 
 getSupportedCiphers ()
 
 getSupportedHashes ()
 
 getSupportedMacs ()
 
 load ($registerDefaultAlgorithms=true)
 
 registerDefaultAlgorithms ()
 
 removeAlgorithms ($packageName)
 
 reset ()
 
 save ()
 

Static Public Member Functions

static buildCipher (CipherEnum $cipher, ModeEnum $mode, PaddingInterface $padding, $key, $tagLength=CryptoInterface::DEFAULT_TAG_LENGTH, $allowUnsafe=false)
 
static buildHash (HashEnum $algo, $allowUnsafe=false)
 
static buildMac (MacEnum $algo, SubAlgorithmAbstractEnum $subAlgo, $key, $nonce= '', $allowUnsafe=false)
 
static getInstance ()
 

Static Protected Member Functions

static findCipher (CipherEnum $cipher, ModeEnum $mode, $allowUnsafe)
 
static findHash (HashEnum $algo, $allowUnsafe)
 
static findMac (MacEnum $algo, $allowUnsafe)
 

Private Attributes

 $metadata
 

Static Private Attributes

static $path = null
 

Detailed Description

A registry/factory for cryptographic primitives.

Definition at line 19 of file Registry.php.

Member Data Documentation

fpoirotte\Cryptal\Registry::$metadata
private

Stores metadata about supported algorithms.

Looks somewhat like this, except that the constants are replaced with their actual values:

array(
'crypt' => array(
CIPHER_3DES . ':' . MODE_CTR => array(
array('vendor/pluginname', 'Vendor\\PluginName\\SomeClass', TYPE_ASSEMBLY),
...
),
...
),
'hash' => array(
HASH_MD5 => array(
...
),
...
),
'mac' => ...,
);

Definition at line 46 of file Registry.php.


The documentation for this class was generated from the following file: