| @@ 91-102 (lines=12) @@ | ||
| 88 | * |
|
| 89 | * @return string|string[] The JSON (Compact/Flattened) Serialized representation |
|
| 90 | */ |
|
| 91 | private function encryptData($input, array $instructions, $serialization, array $shared_protected_header = [], array $shared_unprotected_header = [], $aad = null) |
|
| 92 | { |
|
| 93 | $jot = $this->jot_manager->createJot(); |
|
| 94 | $shared_protected_header['jti'] = $jot->getJti(); |
|
| 95 | ||
| 96 | $jwe = $this->encrypter->encrypt($input, $instructions, $serialization, $shared_protected_header, $shared_unprotected_header, $aad); |
|
| 97 | ||
| 98 | $jot = $jot->withData($jwe); |
|
| 99 | $this->jot_manager->saveJot($jot); |
|
| 100 | ||
| 101 | return $jwe; |
|
| 102 | } |
|
| 103 | } |
|
| 104 | ||
| @@ 93-104 (lines=12) @@ | ||
| 90 | * |
|
| 91 | * @return string|string[] The JSON (Compact/Flattened) Serialized representation |
|
| 92 | */ |
|
| 93 | private function signData($input, array $instructions, $serialization, $detached_signature = false, &$detached_payload = null) |
|
| 94 | { |
|
| 95 | $jot = $this->jot_manager->createJot(); |
|
| 96 | $instructions = $this->getNewInstructions($instructions, $jot); |
|
| 97 | ||
| 98 | $jws = $this->signer->sign($input, $instructions, $serialization, $detached_signature, $detached_payload); |
|
| 99 | ||
| 100 | $jot = $jot->withData($jws); |
|
| 101 | $this->jot_manager->saveJot($jot); |
|
| 102 | ||
| 103 | return $jws; |
|
| 104 | } |
|
| 105 | ||
| 106 | /** |
|
| 107 | * @param \Jose\Object\SignatureInstructionInterface[] $instructions A list of instructions used to sign the input |
|