Class ParagonIE_Sodium_File
package | Default |
---|
abs(integer $integer,integer $size): integer
integer
integer
(16, 32, 64)
integer
box(string $inputFile,string $outputFile,string $nonce,string $keyPair): boolean
Throws |
|
---|
string
Absolute path to a file on the filesystem
string
Absolute path to a file on the filesystem
string
Number to be used only once
string
ECDH secret key and ECDH public key concatenated
boolean
box_decrypt(resource $ifp,resource $ofp,integer $mlen,string $nonce,string $boxKeypair): boolean
Throws |
|
---|
resource
resource
integer
string
string
boolean
box_encrypt(resource $ifp,resource $ofp,integer $mlen,string $nonce,string $boxKeypair): boolean
Throws |
|
---|
resource
resource
integer
string
string
boolean
box_open(string $inputFile,string $outputFile,string $nonce,string $keypair): boolean
Warning: Does not protect against TOCTOU attacks. You should just load the file into memory and use crypto_box_open() if you are worried about those.
Throws |
|
---|
string
string
string
string
boolean
box_seal(string $inputFile,string $outputFile,string $publicKey): boolean
Throws |
|
---|
string
Absolute path to a file on the filesystem
string
Absolute path to a file on the filesystem
string
ECDH public key
boolean
box_seal_open(string $inputFile,string $outputFile,string $ecdhKeypair): boolean
Warning: Does not protect against TOCTOU attacks. You should just load the file into memory and use crypto_box_seal_open() if you are worried about those.
Throws |
|
---|
string
string
string
boolean
declareScalarType(mixed &$mixedVar = null,string $type = 'void',integer $argumentIndex): void
Throws |
|
---|
mixed
string
integer
ftell(resource $resource): integer
Throws |
|
---|
resource
integer
generichash(string $filePath,string|null $key = '',integer $outputLength = 32): string
psalm-suppress | FailedTypeResolution |
---|---|
Throws |
|
string
Absolute path to a file on the filesystem
string|null
BLAKE2b key
integer
Length of hash output
string
BLAKE2b hash
hash_update( &$hs,string $data): void
psalm-suppress | PossiblyInvalidArgument |
---|---|
Throws |
|
string
hashEquals(string $left,string $right): boolean
Throws |
|
---|
string
string
boolean
onetimeauth_verify(\ParagonIE_Sodium_Core_Poly1305_State $state,resource $ifp,string $tag = '',integer $mlen): boolean
Throws |
|
---|
resource
string
integer
boolean
onetimeauth_verify_core32(\ParagonIE_Sodium_Core32_Poly1305_State $state,resource $ifp,string $tag = '',integer $mlen): boolean
Throws |
|
---|
resource
string
integer
boolean
secretbox(string $inputFile,string $outputFile,string $nonce,string $key): boolean
Throws |
|
---|
string
Absolute path to a file on the filesystem
string
Absolute path to a file on the filesystem
string
Number to be used only once
string
Encryption key
boolean
secretbox_decrypt(resource $ifp,resource $ofp,integer $mlen,string $nonce,string $key): boolean
Throws |
|
---|
resource
resource
integer
string
string
boolean
secretbox_decrypt_core32(resource $ifp,resource $ofp,integer $mlen,string $nonce,string $key): boolean
Throws |
|
---|
resource
resource
integer
string
string
boolean
secretbox_encrypt(resource $ifp,resource $ofp,integer $mlen,string $nonce,string $key): boolean
Throws |
|
---|
resource
resource
integer
string
string
boolean
secretbox_encrypt_core32(resource $ifp,resource $ofp,integer $mlen,string $nonce,string $key): boolean
Throws |
|
---|
resource
resource
integer
string
string
boolean
secretbox_open(string $inputFile,string $outputFile,string $nonce,string $key): boolean
Warning: Does not protect against TOCTOU attacks. You should just load the file into memory and use crypto_secretbox_open() if you are worried about those.
Throws |
|
---|
string
string
string
string
boolean
sign(string $filePath,string $secretKey): string
Throws |
|
---|
string
Absolute path to a file on the filesystem
string
Secret signing key
string
Ed25519 signature
sign_core32(string $filePath,string $secretKey): string
Throws |
|
---|
string
Absolute path to a file on the filesystem
string
Secret signing key
string
Ed25519 signature
updateHashWithFile(resource|\HashContext $hash,resource $fp,integer $size): resource|object
psalm-suppress | PossiblyInvalidArgument PHP 7.2 changes from a resource to an object, which causes Psalm to complain about an error. TypeCoercion Ditto. |
---|---|
Throws |
|
resource|\HashContext
resource
integer
resource|object
Resource on PHP < 7.2, HashContext object on PHP >= 7.2
verify(string $sig,string $filePath,string $publicKey): boolean
Throws |
|
---|
string
Ed25519 signature
string
Absolute path to a file on the filesystem
string
Signing public key
boolean
verify_core32(string $sig,string $filePath,string $publicKey): boolean
Throws |
|
---|
string
Ed25519 signature
string
Absolute path to a file on the filesystem
string
Signing public key
boolean
BUFFER_SIZE