protected static function loadKeyFile(string $filePath): HiddenString
    {
        $fileData = \file_get_contents($filePath);
        if ($fileData === false) {
            // @codeCoverageIgnoreStart
            throw new CannotPerformOperation(
                'Cannot load key from file: '. $filePath
            );
            // @codeCoverageIgnoreEnd
        }
        $data = Hex::decode($fileData);
        \sodium_memzero($fileData);
        return new HiddenString(
            self::getKeyDataFromString($data)
        );
    }
protected static function loadKeyFile(string $filePath): HiddenString
    {
        $fileData = \file_get_contents($filePath);
        if ($fileData === false) {
            // @codeCoverageIgnoreStart
            throw new CannotPerformOperation(
                'Cannot load key from file: '. $filePath
            );
            // @codeCoverageIgnoreEnd
        }
        $data = Hex::decode($fileData);
        \sodium_memzero($fileData);
        return new HiddenString(
            self::getKeyDataFromString($data)
        );
    }
protected static function loadKeyFile ( string $ filePath ) : HiddenString { $ fileData = \ file_get_contents ( $ filePath ) ; if ( $ fileData === false ) { // @codeCoverageIgnoreStart throw new CannotPerformOperation ( 'Cannot load key from file: ' . $ filePath ) ; // @codeCoverageIgnoreEnd } $ data = Hex :: decode ( $ fileData ) ; \ sodium_memzero ( $ fileData ) ; return new HiddenString ( self :: getKeyDataFromString ( $ data ) ) ; }
Read a key from a file, verify its checksum

@param string $filePath
@return HiddenString
@throws CannotPerformOperation
@throws InvalidKey
@throws \TypeError
Read a key from a file verify its checksum