@@ -61,6 +61,9 @@ class RestoringChunkPart implements JsonSerializable, IDeserializable {
61
61
/** @var bool */
62
62
private $ encrypted = false ;
63
63
64
+ /** @var string */
65
+ private $ algorithm = '' ;
66
+
64
67
/** @var string */
65
68
private $ encryptedChecksum = '' ;
66
69
@@ -126,8 +129,9 @@ public function getOrder(): int {
126
129
*
127
130
* @return RestoringChunkPart
128
131
*/
129
- public function setEncrypted (bool $ encrypted ): self {
132
+ public function setEncrypted (bool $ encrypted, string $ algorithm = '' ): self {
130
133
$ this ->encrypted = $ encrypted ;
134
+ $ this ->algorithm = $ algorithm ;
131
135
132
136
return $ this ;
133
137
}
@@ -140,6 +144,25 @@ public function isEncrypted(): bool {
140
144
}
141
145
142
146
147
+ /**
148
+ * @param string $algorithm
149
+ *
150
+ * @return RestoringChunkPart
151
+ */
152
+ public function setAlgorithm (string $ algorithm ): self {
153
+ $ this ->algorithm = $ algorithm ;
154
+
155
+ return $ this ;
156
+ }
157
+
158
+ /**
159
+ * @return string
160
+ */
161
+ public function getAlgorithm (): string {
162
+ return $ this ->algorithm ;
163
+ }
164
+
165
+
143
166
/**
144
167
* @return string
145
168
*/
@@ -219,6 +242,7 @@ public function import(array $data): IDeserializable {
219
242
->setOrder ($ this ->getInt ('order ' , $ data ))
220
243
->setContent ($ this ->get ('content ' , $ data ))
221
244
->setEncrypted ($ this ->getBool ('encrypted ' , $ data ))
245
+ ->setAlgorithm ($ this ->get ('algorithm ' , $ data ))
222
246
->setChecksum ($ this ->get ('checksum ' , $ data ))
223
247
->setEncryptedChecksum ($ this ->get ('encryptedChecksum ' , $ data ));
224
248
@@ -234,6 +258,7 @@ public function jsonSerialize(): array {
234
258
'name ' => $ this ->getName (),
235
259
'order ' => $ this ->getOrder (),
236
260
'encrypted ' => $ this ->isEncrypted (),
261
+ 'algorithm ' => $ this ->getAlgorithm (),
237
262
'checksum ' => $ this ->getChecksum (),
238
263
'encryptedChecksum ' => $ this ->getEncryptedChecksum ()
239
264
];
0 commit comments