@@ -11,26 +11,26 @@ class FieldLevelEncryptionConfig {
1111 /**
1212 * A certificate object whose public key will be used for encryption.
1313 */
14- public $ encryptionCertificate ;
14+ private $ encryptionCertificate ;
1515
1616 /**
1717 * The SHA-256 hex-encoded digest of the certificate used for encryption (optional, the digest will be
1818 * automatically computed if this field is null or empty).
1919 * Example: '4d9d7540be320429ffc8e6506f054525816e2d0e95a85247d5b58be713f28be0'
2020 */
21- public $ encryptionCertificateFingerprint ;
21+ private $ encryptionCertificateFingerprint ;
2222
2323 /**
2424 * The SHA-256 hex-encoded digest of the key used for encryption (optional, the digest will be
2525 * automatically computed if this field is null or empty).
2626 * Example: 'c3f8ef7053c4fb306f7476e7d1956f0aa992ff9dfdd5244b912a1d377ff3a84f'
2727 */
28- public $ encryptionKeyFingerprint ;
28+ private $ encryptionKeyFingerprint ;
2929
3030 /**
3131 * A private key object to be used for decryption.
3232 */
33- public $ decryptionKey ;
33+ private $ decryptionKey ;
3434
3535 /**
3636 * A list of JSON paths to encrypt in request payloads.
@@ -41,7 +41,7 @@ class FieldLevelEncryptionConfig {
4141 * )
4242 * </pre>
4343 */
44- public $ encryptionPaths = array ();
44+ private $ encryptionPaths = array ();
4545
4646 /**
4747 * A list of JSON paths to decrypt in response payloads.
@@ -52,78 +52,78 @@ class FieldLevelEncryptionConfig {
5252 * )
5353 * </pre>
5454 */
55- public $ decryptionPaths = array ();
55+ private $ decryptionPaths = array ();
5656
5757 /**
5858 * The digest algorithm to be used for the RSA OAEP padding. Example: 'SHA-512'.
5959 */
60- public $ oaepPaddingDigestAlgorithm ;
60+ private $ oaepPaddingDigestAlgorithm ;
6161
6262 /**
6363 * The name of the payload field where to write/read the digest algorithm used for
6464 * the RSA OAEP padding (optional, the field won't be set if the name is null or empty).
6565 */
66- public $ oaepPaddingDigestAlgorithmFieldName ;
66+ private $ oaepPaddingDigestAlgorithmFieldName ;
6767
6868 /**
6969 * The name of the HTTP header where to write/read the digest algorithm used for
7070 * the RSA OAEP padding (optional, the header won't be set if the name is null or empty).
7171 */
72- public $ oaepPaddingDigestAlgorithmHeaderName ;
72+ private $ oaepPaddingDigestAlgorithmHeaderName ;
7373
7474 /**
7575 * The name of the payload field where to write/read the initialization vector value.
7676 */
77- public $ ivFieldName ;
77+ private $ ivFieldName ;
7878
7979 /**
8080 * The name of the header where to write/read the initialization vector value.
8181 */
82- public $ ivHeaderName ;
82+ private $ ivHeaderName ;
8383
8484 /**
8585 * The name of the payload field where to write/read the one-time usage encrypted symmetric key.
8686 */
87- public $ encryptedKeyFieldName ;
87+ private $ encryptedKeyFieldName ;
8888
8989 /**
9090 * The name of the header where to write/read the one-time usage encrypted symmetric key.
9191 */
92- public $ encryptedKeyHeaderName ;
92+ private $ encryptedKeyHeaderName ;
9393
9494 /**
9595 * The name of the payload field where to write/read the encrypted data value.
9696 */
97- public $ encryptedValueFieldName ;
97+ private $ encryptedValueFieldName ;
9898
9999 /**
100100 * The name of the payload field where to write/read the digest of the encryption
101101 * certificate (optional, the field won't be set if the name is null or empty).
102102 */
103- public $ encryptionCertificateFingerprintFieldName ;
103+ private $ encryptionCertificateFingerprintFieldName ;
104104
105105 /**
106106 * The name of the header where to write/read the digest of the encryption
107107 * certificate (optional, the header won't be set if the name is null or empty).
108108 */
109- public $ encryptionCertificateFingerprintHeaderName ;
109+ private $ encryptionCertificateFingerprintHeaderName ;
110110
111111 /**
112112 * The name of the payload field where to write/read the digest of the encryption
113113 * key (optional, the field won't be set if the name is null or empty).
114114 */
115- public $ encryptionKeyFingerprintFieldName ;
115+ private $ encryptionKeyFingerprintFieldName ;
116116
117117 /**
118118 * The name of the header where to write/read the digest of the encryption
119119 * key (optional, the header won't be set if the name is null or empty).
120120 */
121- public $ encryptionKeyFingerprintHeaderName ;
121+ private $ encryptionKeyFingerprintHeaderName ;
122122
123123 /**
124124 * How the field/header values have to be encoded.
125125 */
126- public $ fieldValueEncoding ;
126+ private $ fieldValueEncoding ;
127127
128128 /**
129129 * If the encryption parameters must be written to/read from HTTP headers.
@@ -139,31 +139,104 @@ public function useHttpPayloads() {
139139 return !empty ($ this ->encryptedKeyFieldName ) && !empty ($ this ->ivFieldName );
140140 }
141141
142+ /**
143+ * FieldLevelEncryptionConfig constructor.
144+ */
145+ public function __construct ($ encryptionCertificate , $ encryptionCertificateFingerprint , $ encryptionKeyFingerprint , $ decryptionKey , $ encryptionPaths , $ decryptionPaths , $ oaepPaddingDigestAlgorithm , $ oaepPaddingDigestAlgorithmFieldName , $ oaepPaddingDigestAlgorithmHeaderName , $ ivFieldName , $ ivHeaderName , $ encryptedKeyFieldName , $ encryptedKeyHeaderName , $ encryptedValueFieldName , $ encryptionCertificateFingerprintFieldName , $ encryptionCertificateFingerprintHeaderName , $ encryptionKeyFingerprintFieldName , $ encryptionKeyFingerprintHeaderName , $ fieldValueEncoding ) {
146+ $ this ->encryptionCertificate = $ encryptionCertificate ;
147+ $ this ->encryptionCertificateFingerprint = $ encryptionCertificateFingerprint ;
148+ $ this ->encryptionKeyFingerprint = $ encryptionKeyFingerprint ;
149+ $ this ->decryptionKey = $ decryptionKey ;
150+ $ this ->encryptionPaths = $ encryptionPaths ;
151+ $ this ->decryptionPaths = $ decryptionPaths ;
152+ $ this ->oaepPaddingDigestAlgorithm = $ oaepPaddingDigestAlgorithm ;
153+ $ this ->oaepPaddingDigestAlgorithmFieldName = $ oaepPaddingDigestAlgorithmFieldName ;
154+ $ this ->oaepPaddingDigestAlgorithmHeaderName = $ oaepPaddingDigestAlgorithmHeaderName ;
155+ $ this ->ivFieldName = $ ivFieldName ;
156+ $ this ->ivHeaderName = $ ivHeaderName ;
157+ $ this ->encryptedKeyFieldName = $ encryptedKeyFieldName ;
158+ $ this ->encryptedKeyHeaderName = $ encryptedKeyHeaderName ;
159+ $ this ->encryptedValueFieldName = $ encryptedValueFieldName ;
160+ $ this ->encryptionCertificateFingerprintFieldName = $ encryptionCertificateFingerprintFieldName ;
161+ $ this ->encryptionCertificateFingerprintHeaderName = $ encryptionCertificateFingerprintHeaderName ;
162+ $ this ->encryptionKeyFingerprintFieldName = $ encryptionKeyFingerprintFieldName ;
163+ $ this ->encryptionKeyFingerprintHeaderName = $ encryptionKeyFingerprintHeaderName ;
164+ $ this ->fieldValueEncoding = $ fieldValueEncoding ;
165+ }
166+
167+ public function getEncryptionCertificate () {
168+ return $ this ->encryptionCertificate ;
169+ }
170+
171+ public function getEncryptionCertificateFingerprint () {
172+ return $ this ->encryptionCertificateFingerprint ;
173+ }
174+
175+ public function getEncryptionKeyFingerprint () {
176+ return $ this ->encryptionKeyFingerprint ;
177+ }
178+
179+ public function getDecryptionKey () {
180+ return $ this ->decryptionKey ;
181+ }
182+
183+ public function getEncryptionPaths () {
184+ return $ this ->encryptionPaths ;
185+ }
186+
187+ public function getDecryptionPaths () {
188+ return $ this ->decryptionPaths ;
189+ }
190+
191+ public function getOaepPaddingDigestAlgorithm () {
192+ return $ this ->oaepPaddingDigestAlgorithm ;
193+ }
194+
195+ public function getOaepPaddingDigestAlgorithmFieldName () {
196+ return $ this ->oaepPaddingDigestAlgorithmFieldName ;
197+ }
198+
142199 public function getOaepPaddingDigestAlgorithmHeaderName () {
143200 return $ this ->oaepPaddingDigestAlgorithmHeaderName ;
144201 }
145202
203+ public function getIvFieldName () {
204+ return $ this ->ivFieldName ;
205+ }
206+
146207 public function getIvHeaderName () {
147208 return $ this ->ivHeaderName ;
148209 }
149210
211+ public function getEncryptedKeyFieldName () {
212+ return $ this ->encryptedKeyFieldName ;
213+ }
214+
150215 public function getEncryptedKeyHeaderName () {
151216 return $ this ->encryptedKeyHeaderName ;
152217 }
153218
219+ public function getEncryptedValueFieldName () {
220+ return $ this ->encryptedValueFieldName ;
221+ }
222+
223+ public function getEncryptionCertificateFingerprintFieldName () {
224+ return $ this ->encryptionCertificateFingerprintFieldName ;
225+ }
226+
154227 public function getEncryptionCertificateFingerprintHeaderName () {
155228 return $ this ->encryptionCertificateFingerprintHeaderName ;
156229 }
157230
158- public function getEncryptionKeyFingerprintHeaderName () {
159- return $ this ->encryptionKeyFingerprintHeaderName ;
231+ public function getEncryptionKeyFingerprintFieldName () {
232+ return $ this ->encryptionKeyFingerprintFieldName ;
160233 }
161234
162- public function getEncryptionCertificateFingerprint () {
163- return $ this ->encryptionCertificateFingerprint ;
235+ public function getEncryptionKeyFingerprintHeaderName () {
236+ return $ this ->encryptionKeyFingerprintHeaderName ;
164237 }
165238
166- public function getEncryptionKeyFingerprint () {
167- return $ this ->encryptionKeyFingerprint ;
239+ public function getFieldValueEncoding () {
240+ return $ this ->fieldValueEncoding ;
168241 }
169242}
0 commit comments