Namespace: \ParagonIE\Halite
public static
checksum($filepath
,Key
$key = null
,$raw = false
) :string
Calculates a BLAKE2b-512 hash of the given file.
$filepath
- Path to a file (or an open file handle)$key
(optional, should be anAuthenticationKey
orSignaturePublicKey
)$raw
- Set toTRUE
if you don't want a hexadecimal string returned
public static
encrypt($input
,$output
,EncryptionKey
$key
):string
Encrypt the contents of $input
(either a string containing the path to a file, or an open file
handle), and store it in the file (handle?) at $output
.
Both $input
and $output
can be a string, a resource, or an object whose class implements StreamInterface
.
In the object case, $input
must be an instance of ReadOnlyFile
and $output
must
be an instance of MutableFile
.
public static
decrypt($input
,$output
,EncryptionKey
$key
):string
Decrypt the contents of $input
(either a string containing the path to a file, or an open file
handle), and store it in the file (handle?) at $output
.
Both $input
and $output
can be a string, a resource, or an object whose class implements StreamInterface
.
In the object case, $input
must be an instance of ReadOnlyFile
and $output
must
be an instance of MutableFile
.
public static
seal($input
,$output
,EncryptionPublicKey
$key
):string
Seals (encrypts with a public key) the contents of $input
(either a string containing the path to a file, or an open file
handle), and store it in the file (handle?) at $output
.
Both $input
and $output
can be a string, a resource, or an object whose class implements StreamInterface
.
In the object case, $input
must be an instance of ReadOnlyFile
and $output
must
be an instance of MutableFile
.
public static
unseal($input
,$output
,EncryptionSecretKey
$key
) :string
Unseals (decrypts with a secret key) the contents of $input
(either a string containing the path to a file, or an open file
handle), and store it in the file (handle?) at $output
.
Both $input
and $output
can be a string, a resource, or an object whose class implements StreamInterface
.
In the object case, $input
must be an instance of ReadOnlyFile
and $output
must
be an instance of MutableFile
.
public static
sign($input
,SignatureSecretKey
$key
,bool $raw_binary
):string
Calculate a digital signature of a file.
$input
can be a string or a resource, or an instance of ReadOnlyFile
.
public static
sign($input
,SignaturePublicKey
$key
,string $signature
,boolean $raw_binary
):bool
Verifies a digital signature of a file.
$input
can be a string or a resource, or an instance of ReadOnlyFile
.