Aplus Framework Docs

BoxSeal
in package
Uses BoxTrait

Class BoxSeal.

Table of Contents

decrypt()  : false|string
Decrypts a message ciphertext.
encrypt()  : string
Encrypts a message with an anonymous public key.
makeKeyPair()  : string
Makes a keypair.
makeNonce()  : string
Makes a box nonce with the correct length.
makePublicKey()  : string
Makes the public key from a keypair.
makeSecretKey()  : string
Makes the secret key from a keypair.

Methods

decrypt()

Decrypts a message ciphertext.

public static decrypt(string $ciphertext, string $keyPair) : false|string
Parameters
$ciphertext : string
$keyPair : string
Tags
see
BoxTrait::makeKeyPair()
throws
SodiumException
Return values
false|string

The message or false if the ciphertext could not be decrypted

encrypt()

Encrypts a message with an anonymous public key.

public static encrypt(string $message, string $publicKey) : string
Parameters
$message : string
$publicKey : string
Tags
see
BoxTrait::makePublicKey()
throws
SodiumException
Return values
string

makeKeyPair()

Makes a keypair.

public static makeKeyPair() : string
Tags
throws
SodiumException
Return values
string

makeNonce()

Makes a box nonce with the correct length.

public static makeNonce() : string
Tags
throws
Exception

if fail to get random bytes

Return values
string

makePublicKey()

Makes the public key from a keypair.

public static makePublicKey(string $keyPair) : string
Parameters
$keyPair : string
Tags
see
BoxTrait::makeKeyPair()
throws
SodiumException
Return values
string

makeSecretKey()

Makes the secret key from a keypair.

public static makeSecretKey(string $keyPair) : string
Parameters
$keyPair : string
Tags
see
BoxTrait::makeKeyPair()
throws
SodiumException
Return values
string

Search results