Class ParagonIE_Sodium_File
| package | WordPress |
|---|---|
| inherited_from | \ParagonIE_Sodium_File |
abs(integer $integer, integer $size = 0) : integer
integer
integer(16, 32, 64)
integerbox(string $inputFile, string $outputFile, string $nonce, string $keyPair) : boolean
stringAbsolute path to a file on the filesystem
stringAbsolute path to a file on the filesystem
stringNumber to be used only once
stringECDH secret key and ECDH public key concatenated
\SodiumException |
|
|---|---|
\TypeError |
booleanbox_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 |
booleanbox_seal(string $inputFile, string $outputFile, string $publicKey) : boolean
stringAbsolute path to a file on the filesystem
stringAbsolute path to a file on the filesystem
stringECDH public key
\SodiumException |
|
|---|---|
\TypeError |
booleanbox_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 |
booleandeclareScalarType(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 |
|---|
stringAbsolute path to a file on the filesystem
stringnullBLAKE2b key
integerLength of hash output
\SodiumException |
|
|---|---|
\TypeError |
stringBLAKE2b hashhashEquals(string $left, string $right) : boolean
string
string
\SodiumException |
|
|---|---|
\TypeError |
booleansecretbox(string $inputFile, string $outputFile, string $nonce, string $key) : boolean
stringAbsolute path to a file on the filesystem
stringAbsolute path to a file on the filesystem
stringNumber to be used only once
stringEncryption key
\SodiumException |
|
|---|---|
\TypeError |
booleansecretbox_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 |
booleansign(string $filePath, string $secretKey) : string
stringAbsolute path to a file on the filesystem
stringSecret signing key
\SodiumException |
|
|---|---|
\TypeError |
stringEd25519 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. |
resourceobject
resource
integer
\SodiumException |
|
|---|---|
\TypeError |
resourceobjectResource on PHP < 7.2, HashContext object on PHP >= 7.2verify(string $sig, string $filePath, string $publicKey) : boolean
stringEd25519 signature
stringAbsolute path to a file on the filesystem
stringSigning public key
\SodiumException |
|
|---|---|
\TypeError |
|
\Exception |
booleanverify_core32(string $sig, string $filePath, string $publicKey) : boolean
stringEd25519 signature
stringAbsolute path to a file on the filesystem
stringSigning public key
\SodiumException |
|
|---|---|
\Exception |
booleanbox_decrypt(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $boxKeypair) : boolean
resource
resource
integer
string
string
\SodiumException |
|
|---|---|
\TypeError |
booleanbox_encrypt(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $boxKeypair) : boolean
resource
resource
integer
string
string
\SodiumException |
|
|---|---|
\TypeError |
booleanonetimeauth_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 |
booleanonetimeauth_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 |
booleansecretbox_decrypt(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $key) : boolean
resource
resource
integer
string
string
\SodiumException |
|
|---|---|
\TypeError |
booleansecretbox_decrypt_core32(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $key) : boolean
resource
resource
integer
string
string
\SodiumException |
|
|---|---|
\TypeError |
booleansecretbox_encrypt(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $key) : boolean
resource
resource
integer
string
string
\SodiumException |
|
|---|---|
\TypeError |
booleansecretbox_encrypt_core32(resource $ifp, resource $ofp, integer $mlen, string $nonce, string $key) : boolean
resource
resource
integer
string
string
\SodiumException |
|
|---|---|
\TypeError |
booleansign_core32(string $filePath, string $secretKey) : string
stringAbsolute path to a file on the filesystem
stringSecret signing key
\SodiumException |
|
|---|---|
\TypeError |
stringEd25519 signatureBUFFER_SIZE = 8192