| | |
| | | <?php |
| | | |
| | | /* |
| | | /** |
| | | +-------------------------------------------------------------------------+ |
| | | | Abstract driver for the Enigma Plugin | |
| | | | | |
| | |
| | | |
| | | /** |
| | | * Encryption. |
| | | * |
| | | * @param string Message body |
| | | * @param array List of key-password mapping |
| | | * |
| | | * @return mixed Encrypted message or enigma_error on failure |
| | | */ |
| | | abstract function encrypt($text, $keys); |
| | | |
| | | /** |
| | | * Decryption.. |
| | | * Decryption. |
| | | * |
| | | * @param string Encrypted message |
| | | * @param array List of key-password mapping |
| | |
| | | |
| | | /** |
| | | * Signing. |
| | | * |
| | | * @param string Message body |
| | | * @param string Key ID |
| | | * @param string Key password |
| | | * @param int Signing mode (enigma_engine::SIGN_*) |
| | | * |
| | | * @return mixed True on success or enigma_error on failure |
| | | */ |
| | | abstract function sign($text, $key, $passwd, $mode = null); |
| | | |
| | |
| | | * |
| | | * @return mixed Import status array or enigma_error |
| | | */ |
| | | abstract function import($content, $isfile=false); |
| | | abstract function import($content, $isfile = false); |
| | | |
| | | /** |
| | | * Key/Cert export. |
| | | * |
| | | * @param string Key ID |
| | | * |
| | | * @return mixed Key content or enigma_error |
| | | */ |
| | | abstract function export($key); |
| | | |
| | | /** |
| | | * Keys listing. |
| | |
| | | * |
| | | * @return mixed Array of enigma_key objects or enigma_error |
| | | */ |
| | | abstract function list_keys($pattern=''); |
| | | abstract function list_keys($pattern = ''); |
| | | |
| | | /** |
| | | * Single key information. |
| | |
| | | /** |
| | | * Key pair generation. |
| | | * |
| | | * @param array Key/User data |
| | | * @param array Key/User data (name, email, password, size) |
| | | * |
| | | * @return mixed Key (enigma_key) object or enigma_error |
| | | */ |
| | |
| | | |
| | | /** |
| | | * Key deletion. |
| | | * |
| | | * @param string Key ID |
| | | * |
| | | * @return mixed True on success or enigma_error |
| | | */ |
| | | abstract function delete_key($keyid); |
| | | } |