\Threema\MsgApi\PublicKeyStoresFile

Store the PublicKeys in a ascii file

Summary

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

Properties

$cache

$cache : array

threemaId => publicKey cache

Type

array

$file

$file : string

Type

string

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

Throws

\Threema\Core\Exception

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

Returns

boolean

__construct()

__construct(string  $file) 

Parameters

string $file

Valid, read and writable file

Throws

\Threema\Core\Exception

if the file does not exist or not writable