\PrivateBin\PersistenceServerSalt

ServerSalt

This is a random string which is unique to each PrivateBin installation. It is automatically created if not present.

Salt is used:

  • to generate unique VizHash in discussions (which are not reproductible across PrivateBin servers)
  • to generate unique deletion token (which are not re-usable across PrivateBin servers)

Summary

Methods
Properties
Constants
setPath()
getPath()
generate()
get()
No public properties found
No constants found
_exists()
_initialize()
_store()
No protected properties found
N/A
No private methods found
$_path
$_file
$_salt
N/A

Properties

$_path

$_path : string

path in which to persist something

Type

string

$_file

$_file : string

file where salt is saved to

Type

string

$_salt

$_salt : string

generated salt

Type

string

Methods

setPath()

setPath(string  $path) 

set the path

Parameters

string $path

getPath()

getPath(string  $filename = null) : string

get the path

Parameters

string $filename

Returns

string

generate()

generate() : string

generate a large random hexadecimal salt

Returns

string

get()

get() : string

get server salt

Throws

\Exception

Returns

string

_exists()

_exists(string  $filename) : boolean

checks if the file exists

Parameters

string $filename

Returns

boolean

_initialize()

_initialize() 

prepares path for storage

Throws

\Exception

_store()

_store(string  $filename, string  $data) : string

store the data

Parameters

string $filename
string $data

Throws

\Exception

Returns

string