ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ILIAS\WOPI\Discovery\ProofKeyRepository Class Reference
+ Collaboration diagram for ILIAS\WOPI\Discovery\ProofKeyRepository:

Public Member Functions

 __construct (private \ilSetting $settings)
 
 get ()
 
 store (?ProofKeys $keys)
 Stores the keys of the latest discovery, null removes them (the client offers none). More...
 
 clear ()
 

Private Attributes

const MODULUS = 'wopi_proof_modulus'
 
const EXPONENT = 'wopi_proof_exponent'
 
const OLD_MODULUS = 'wopi_proof_old_modulus'
 
const OLD_EXPONENT = 'wopi_proof_old_exponent'
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 26 of file ProofKeyRepository.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\WOPI\Discovery\ProofKeyRepository::__construct ( private \ilSetting  $settings)

Definition at line 33 of file ProofKeyRepository.php.

35 {
36 }

Member Function Documentation

◆ clear()

ILIAS\WOPI\Discovery\ProofKeyRepository::clear ( )

Definition at line 74 of file ProofKeyRepository.php.

74 : void
75 {
76 foreach ([self::MODULUS, self::EXPONENT, self::OLD_MODULUS, self::OLD_EXPONENT] as $key) {
77 $this->settings->delete($key);
78 }
79 }

References ILIAS\Repository\settings().

Referenced by ILIAS\WOPI\Discovery\ProofKeyRepository\store().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get()

ILIAS\WOPI\Discovery\ProofKeyRepository::get ( )

Definition at line 38 of file ProofKeyRepository.php.

38 : ?ProofKeys
39 {
40 $modulus = $this->settings->get(self::MODULUS);
41 $exponent = $this->settings->get(self::EXPONENT);
42 if (empty($modulus) || empty($exponent)) {
43 return null;
44 }
45 $old_modulus = $this->settings->get(self::OLD_MODULUS);
46 $old_exponent = $this->settings->get(self::OLD_EXPONENT);
47
48 return new ProofKeys(
49 new ProofKey($modulus, $exponent),
50 empty($old_modulus) || empty($old_exponent) ? null : new ProofKey($old_modulus, $old_exponent)
51 );
52 }
The current and the previous proof key of a WOPI client.
Definition: ProofKeys.php:30

References ILIAS\Repository\settings().

+ Here is the call graph for this function:

◆ store()

ILIAS\WOPI\Discovery\ProofKeyRepository::store ( ?ProofKeys  $keys)

Stores the keys of the latest discovery, null removes them (the client offers none).

Definition at line 57 of file ProofKeyRepository.php.

57 : void
58 {
59 if ($keys === null) {
60 $this->clear();
61 return;
62 }
63 $this->settings->set(self::MODULUS, $keys->current->modulus);
64 $this->settings->set(self::EXPONENT, $keys->current->exponent);
65 if ($keys->old === null) {
66 $this->settings->delete(self::OLD_MODULUS);
67 $this->settings->delete(self::OLD_EXPONENT);
68 return;
69 }
70 $this->settings->set(self::OLD_MODULUS, $keys->old->modulus);
71 $this->settings->set(self::OLD_EXPONENT, $keys->old->exponent);
72 }

References ILIAS\WOPI\Discovery\ProofKeyRepository\clear(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Field Documentation

◆ EXPONENT

const ILIAS\WOPI\Discovery\ProofKeyRepository::EXPONENT = 'wopi_proof_exponent'
private

Definition at line 29 of file ProofKeyRepository.php.

◆ MODULUS

const ILIAS\WOPI\Discovery\ProofKeyRepository::MODULUS = 'wopi_proof_modulus'
private

Definition at line 28 of file ProofKeyRepository.php.

◆ OLD_EXPONENT

const ILIAS\WOPI\Discovery\ProofKeyRepository::OLD_EXPONENT = 'wopi_proof_old_exponent'
private

Definition at line 31 of file ProofKeyRepository.php.

◆ OLD_MODULUS

const ILIAS\WOPI\Discovery\ProofKeyRepository::OLD_MODULUS = 'wopi_proof_old_modulus'
private

Definition at line 30 of file ProofKeyRepository.php.


The documentation for this class was generated from the following file: