ParagonIE\Halite\KeyFactory::loadEncryptionKey PHP Method

loadEncryptionKey() public static method

Load a symmetric encryption key from a file
public static loadEncryptionKey ( string $filePath ) : EncryptionKey
$filePath string
return EncryptionKey
    public static function loadEncryptionKey(string $filePath) : EncryptionKey
    {
        if (!\is_readable($filePath)) {
            throw new Alerts\CannotPerformOperation('Cannot read keyfile: ' . $filePath);
        }
        return new EncryptionKey(self::loadKeyFile($filePath));
    }

Usage Example

示例#1
0
 /**
  * SecureJwt constructor.
  *
  * @param string $keyFile
  */
 public function __construct($keyFile = '')
 {
     $this->key = KeyFactory::loadEncryptionKey($keyFile);
 }
All Usage Examples Of ParagonIE\Halite\KeyFactory::loadEncryptionKey