PHP Classes

File: src/Contract/KeyInterface.php

Recommend this page to a friend!
  Packages of Scott Arciszewski   Halite   src/Contract/KeyInterface.php   Download  
File: src/Contract/KeyInterface.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: Halite
Perform cryptography operations with libsodium
Author: By
Last change: For version 2, let's use strict types!
Date: 10 years ago
Size: 1,226 bytes
 

Contents

Class file image Download
<?php
declare(strict_types=1);
namespace ParagonIE\Halite\Contract;
/**
 * An inferface for cryptographic secrets -- They should be protected!
 */
interface KeyInterface
{
    /**
     * Don't let this ever succeed
     */
    public function __clone();
    
    /**
     * @param string $keyMaterial
     * 
     * Plus optional arguments
     */
    public function __construct(string $keyMaterial = '', ...$args);
    
    /**
     * Make sure you wipe the key from memory on destruction
     */
    public function __destruct();
        
    /**
     * Wipe the key from memory before serializing
     */
    public function __sleep();
    
    /**
     * Is this a part of a key pair?
     * 
     * @return bool
     */
    public function isAsymmetricKey();
    
    /**
     * Is this a signing key?
     * 
     * @return bool
     */
    public function isEncryptionKey();
    
    /**
     * Is this a public key?
     * 
     * @return bool
     */
    public function isPublicKey();
    
    /**
     * Is this a secret key?
     * 
     * @return bool
     */
    public function isSecretKey();
    
    /**
     * Is this a signing key?
     * 
     * @return bool
     */
    public function isSigningKey();
}