Debian Codegraph @

lib/3rdParty/composer/web-token/jwt-library/Encryption/Algorithm/ContentEncryptionAlgorithm.php

raw symbols SCIP
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Jose\Component\Encryption\Algorithm;
6
7 use Jose\Component\Core\Algorithm;
8
9 interface ContentEncryptionAlgorithm extends Algorithm
10 {
11 /**
12 * This method encrypts the data using the given CEK, IV, AAD and protected header. The variable $tag is populated
13 * on success.
14 *
15 * @param string $data The data to encrypt
16 * @param string $cek The content encryption key
17 * @param string $iv The Initialization Vector
18 * @param string|null $aad Additional Additional Authenticated Data
19 * @param string $encoded_protected_header The Protected Header encoded in Base64Url
20 * @param string $tag Tag
21 */
22 public function encryptContent(
23 string $data,
24 string $cek,
25 string $iv,
26 ?string $aad,
27 string $encoded_protected_header,
28 ?string &$tag = null
29 ): string;
30
31 /**
32 * This method tries to decrypt the data using the given CEK, IV, AAD, protected header and tag.
33 *
34 * @param string $data The data to decrypt
35 * @param string $cek The content encryption key
36 * @param string $iv The Initialization Vector
37 * @param string|null $aad Additional Additional Authenticated Data
38 * @param string $encoded_protected_header The Protected Header encoded in Base64Url
39 * @param string $tag Tag
40 */
41 public function decryptContent(
42 string $data,
43 string $cek,
44 string $iv,
45 ?string $aad,
46 string $encoded_protected_header,
47 string $tag
48 ): string;
49
50 /**
51 * Returns the size of the IV used by this encryption method.
52 */
53 public function getIVSize(): int;
54
55 /**
56 * Returns the size of the CEK used by this encryption method.
57 */
58 public function getCEKSize(): int;
59 }