Class ParagonIE_Sodium_File
package | WordPress |
---|---|
inherited_from | \ParagonIE_Sodium_File |
abs(integer $integer, integer $size = 0
) : integer
integer
integer
(16, 32, 64)
integer
box(string $inputFile, string $outputFile, string $nonce, string $keyPair) : boolean
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
\SodiumException |
|
---|---|
\TypeError |
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.
string
string
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
box_seal(string $inputFile, string $outputFile, string $publicKey) : boolean
string
Absolute path to a file on the filesystem
string
Absolute path to a file on the filesystem
string
ECDH public key
\SodiumException |
|
---|---|
\TypeError |
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.
string
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
declareScalarType(mixed $mixedVar= null
, string $type= 'void'
, integer $argumentIndex= 0
) : void
mixed
string
integer
\TypeError |
|
---|---|
\SodiumException |
generichash(string $filePath, string|null $key= ''
, integer $outputLength= 32
) : string
psalm-suppress | FailedTypeResolution |
---|
string
Absolute path to a file on the filesystem
string
null
BLAKE2b key
integer
Length of hash output
\SodiumException |
|
---|---|
\TypeError |
string
BLAKE2b hashhashEquals(string $left, string $right) : boolean
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
secretbox(string $inputFile, string $outputFile, string $nonce, string $key) : boolean
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
\SodiumException |
|
---|---|
\TypeError |
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.
string
string
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
sign(string $filePath, string $secretKey) : string
string
Absolute path to a file on the filesystem
string
Secret signing key
\SodiumException |
|
---|---|
\TypeError |
string
Ed25519 signatureupdateHashWithFile(resource|object $hash, resource $fp, integer $size = 0
) : resource | object
psalm-suppress | PossiblyInvalidArgument PHP 7.2 changes from a resource to an object, which causes Psalm to complain about an error. |
---|---|
psalm-suppress | TypeCoercion Ditto. |
resource
object
resource
integer
\SodiumException |
|
---|---|
\TypeError |
resource
object
Resource on PHP < 7.2, HashContext object on PHP >= 7.2verify(string $sig, string $filePath, string $publicKey) : boolean
string
Ed25519 signature
string
Absolute path to a file on the filesystem
string
Signing public key
\SodiumException |
|
---|---|
\TypeError |
|
\Exception |
boolean
verify_core32(string $sig, string $filePath, string $publicKey) : boolean
string
Ed25519 signature
string
Absolute path to a file on the filesystem
string
Signing public key
\SodiumException |
|
---|---|
\Exception |
boolean
box_decrypt(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $boxKeypair) : boolean
resource
resource
integer
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
box_encrypt(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $boxKeypair) : boolean
resource
resource
integer
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
onetimeauth_verify(\ParagonIE_Sodium_Core_Poly1305_State $state, resource $ifp, string $tag= ''
, integer $mlen= 0
) : boolean
\ParagonIE_Sodium_Core_Poly1305_State
resource
string
integer
\SodiumException |
|
---|---|
\TypeError |
boolean
onetimeauth_verify_core32(\ParagonIE_Sodium_Core32_Poly1305_State $state, resource $ifp, string $tag= ''
, integer $mlen= 0
) : boolean
\ParagonIE_Sodium_Core32_Poly1305_State
resource
string
integer
\SodiumException |
|
---|---|
\TypeError |
boolean
secretbox_decrypt(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $key) : boolean
resource
resource
integer
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
secretbox_decrypt_core32(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $key) : boolean
resource
resource
integer
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
secretbox_encrypt(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $key) : boolean
resource
resource
integer
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
secretbox_encrypt_core32(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $key) : boolean
resource
resource
integer
string
string
\SodiumException |
|
---|---|
\TypeError |
boolean
sign_core32(string $filePath, string $secretKey) : string
string
Absolute path to a file on the filesystem
string
Secret signing key
\SodiumException |
|
---|---|
\TypeError |
string
Ed25519 signatureBUFFER_SIZE = 8192