Method | Description | |
---|---|---|
checksum ( string | resource $filePath, |
Calculate the BLAKE2b-512 checksum of a file. This method doesn't load the entire file into memory. You may optionally supply a key to use in the BLAKE2b hash. | |
checksum ( string | resource $filePath, |
Calculate the BLAKE2b-512 checksum of a file. This method doesn't load the entire file into memory. You may optionally supply a key to use in the BLAKE2b hash. | |
decrypt ( string | resource $input, string | resource $output, EncryptionKey $key ) : boolean | Decrypt a file using symmetric-key authenticated encryption. | |
encrypt ( string | resource $input, string | resource $output, EncryptionKey $key ) : integer | Encrypt a file using symmetric authenticated encryption. | |
seal ( string | resource $input, string | resource $output, EncryptionPublicKey $publicKey ) : integer | Encrypt a file using anonymous public-key encryption (with ciphertext authentication). | |
sign ( string | resource $filename, SignatureSecretKey $secretKey, boolean $raw_binary = false ) : string | Calculate a digital signature (Ed25519) of a file | |
sign ( string | resource $filename, SignatureSecretKey $secretKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : string | Calculate a digital signature (Ed25519) of a file | |
unseal ( string | resource $input, string | resource $output, EncryptionSecretKey $secretKey ) : boolean | Decrypt a file using anonymous public-key encryption. Ciphertext integrity is still assured thanks to the Encrypt-then-MAC construction. | |
verify ( string | resource $filename, SignaturePublicKey $publicKey, string $signature, boolean $raw_binary = false ) : boolean | Verify a digital signature for a file. | |
verify ( string | resource $filename, SignaturePublicKey $publicKey, string $signature, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : boolean | Verify a digital signature for a file. |
Method | Description | |
---|---|---|
checksumData ( StreamInterface $fileStream, |
Calculate the BLAKE2b checksum of the contents of a file | |
checksumData ( StreamInterface $fileStream, |
Calculate the BLAKE2b checksum of the contents of a file | |
decryptData ( ReadOnlyFile $input, MutableFile $output, EncryptionKey $key ) : boolean | Decrypt the contents of a file. | |
encryptData ( ReadOnlyFile $input, MutableFile $output, EncryptionKey $key ) : integer | Encrypt the contents of a file. | |
getConfig ( string $header, string $mode = 'encrypt' ) : |
Get the configuration | |
getConfigChecksum ( integer $major, integer $minor ) : array | Get the configuration for encrypt operations | |
getConfigEncrypt ( integer $major, integer $minor ) : array | Get the configuration for encrypt operations | |
getConfigSeal ( integer $major, integer $minor ) : array | Get the configuration for seal operations | |
sealData ( ReadOnlyFile $input, MutableFile $output, EncryptionPublicKey $publicKey ) : integer | Seal the contents of a file. | |
signData ( ReadOnlyFile $input, SignatureSecretKey $secretKey, boolean $raw_binary = false ) : string | Sign the contents of a file | |
signData ( ReadOnlyFile $input, SignatureSecretKey $secretKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : string | Sign the contents of a file | |
splitKeys ( |
Split a key using HKDF-BLAKE2b | |
unsealData ( ReadOnlyFile $input, MutableFile $output, EncryptionSecretKey $secretKey ) : boolean | Unseal the contents of a file. | |
verifyData ( ReadOnlyFile $input, SignaturePublicKey $publicKey, string $signature, boolean $raw_binary = false ) : boolean | Verify the contents of a file | |
verifyData ( ReadOnlyFile $input, SignaturePublicKey $publicKey, string $signature, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : boolean | Verify the contents of a file |
Method | Description | |
---|---|---|
__construct ( ) | Don't allow this to be instantiated. | |
streamDecrypt ( ReadOnlyFile $input, MutableFile $output, EncryptionKey $encKey, string $nonce, string $mac, |
Stream decryption - Do not call directly | |
streamEncrypt ( ReadOnlyFile $input, MutableFile $output, EncryptionKey $encKey, string $nonce, string $mac, |
Stream encryption - Do not call directly | |
streamVerify ( ReadOnlyFile $input, resource | string $mac, |
Recalculate and verify the HMAC of the input file |
public static checksum ( string | resource $filePath, |
||
$filePath | string | resource | The file |
$key | (optional; expects SignaturePublicKey or AuthenticationKey) | |
$encoding | mixed | Which encoding scheme to use for the checksum? |
return | string | The checksum |
protected static checksumData ( StreamInterface $fileStream, |
||
$fileStream | StreamInterface | |
$key | ||
$raw | boolean | |
return | string |
protected static checksumData ( StreamInterface $fileStream, |
||
$fileStream | StreamInterface | |
$key | ||
$encoding | mixed | Which encoding scheme to use for the checksum? |
return | string |
protected static decryptData ( ReadOnlyFile $input, MutableFile $output, EncryptionKey $key ) : boolean | ||
$input | ReadOnlyFile | |
$output | MutableFile | |
$key | EncryptionKey | |
return | boolean |
protected static encryptData ( ReadOnlyFile $input, MutableFile $output, EncryptionKey $key ) : integer | ||
$input | ReadOnlyFile | |
$output | MutableFile | |
$key | EncryptionKey | |
return | integer |
public static seal ( string | resource $input, string | resource $output, EncryptionPublicKey $publicKey ) : integer | ||
$input | string | resource | File name or file handle |
$output | string | resource | File name or file handle |
$publicKey | EncryptionPublicKey | Recipient's encryption public key |
return | integer | Number of bytes written |
public static sign ( string | resource $filename, SignatureSecretKey $secretKey, boolean $raw_binary = false ) : string | ||
$filename | string | resource | File name or file handle |
$secretKey | SignatureSecretKey | Secret key for digital signatures |
$raw_binary | boolean | Default: return hexadecimal |
return | string | Detached signature for the file |
public static sign ( string | resource $filename, SignatureSecretKey $secretKey, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : string | ||
$filename | string | resource | File name or file handle |
$secretKey | SignatureSecretKey | Secret key for digital signatures |
$encoding | mixed | Which encoding scheme to use for the signature? |
return | string | Detached signature for the file |
public static unseal ( string | resource $input, string | resource $output, EncryptionSecretKey $secretKey ) : boolean | ||
$input | string | resource | File name or file handle |
$output | string | resource | File name or file handle |
$secretKey | EncryptionSecretKey | Recipient's encryption secret key |
return | boolean | TRUE on success |
protected static unsealData ( ReadOnlyFile $input, MutableFile $output, EncryptionSecretKey $secretKey ) : boolean | ||
$input | ReadOnlyFile | |
$output | MutableFile | |
$secretKey | EncryptionSecretKey | |
return | boolean |
public static verify ( string | resource $filename, SignaturePublicKey $publicKey, string $signature, boolean $raw_binary = false ) : boolean | ||
$filename | string | resource | File name or file handle |
$publicKey | SignaturePublicKey | Other party's signature public key |
$signature | string | The signature we received |
$raw_binary | boolean | TRUE if the signature is raw binary |
return | boolean |
public static verify ( string | resource $filename, SignaturePublicKey $publicKey, string $signature, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : boolean | ||
$filename | string | resource | File name or file handle |
$publicKey | SignaturePublicKey | Other party's signature public key |
$signature | string | The signature we received |
$encoding | mixed | Which encoding scheme to use for the signature? |
return | boolean |
protected static verifyData ( ReadOnlyFile $input, SignaturePublicKey $publicKey, string $signature, mixed $encoding = Halite::ENCODE_BASE64URLSAFE ) : boolean | ||
$input | ReadOnlyFile | (file handle) |
$publicKey | SignaturePublicKey | |
$signature | string | |
$encoding | mixed | Which encoding scheme to use for the signature? |
return | boolean |