\Threema\MsgApi\PublicKeyStoresPhpFile

Store the PublicKeys in a PHP file

Summary

Methods
Properties
Constants
getPublicKey()
findPublicKey()
setPublicKey()
savePublicKey()
__construct()
create()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
initFile()
$cache
$fileBlocker
$file
$keystore
N/A

Properties

$cache

$cache : array

threemaId => publicKey cache

Type

array

$fileBlocker

$fileBlocker : string

PHP code used to prevent unauthorized access

Type

string

$file

$file : string

Type

string

$keystore

$keystore : array

cache of array

Type

array

Methods

getPublicKey()

getPublicKey(string  $threemaId) : string|null

return null if the public key not found in the store

Parameters

string $threemaId

Returns

string|null

findPublicKey()

findPublicKey(string  $threemaId) : null|string

return null if the public key not found in the store

Parameters

string $threemaId

Returns

null|string

setPublicKey()

setPublicKey(string  $threemaId, string  $publicKey) : boolean

set and save a public key

Parameters

string $threemaId
string $publicKey

Returns

boolean

savePublicKey()

savePublicKey(string  $threemaId, string  $publicKey) : boolean

save a public key

Parameters

string $threemaId
string $publicKey

Throws

\Threema\Core\Exception

Returns

boolean

__construct()

__construct(string  $file) 

Parameters

string $file

path to a read and writable (empty) PHP file

Throws

\Threema\Core\Exception

if the file does not exist, is not writable or no valid PHP file

create()

create(string  $path) : \Threema\MsgApi\PublicKeyStores\PhpFile

Initialize a new PhpFile Public Key Store

Parameters

string $path

the file will be created it it does not exist

Returns

\Threema\MsgApi\PublicKeyStores\PhpFile

initFile()

initFile(  $fileHandle = null) : boolean

initiate a php file

Parameters

$fileHandle

Throws

\Threema\Core\Exception

Returns

boolean