File tree 1 file changed +14
-0
lines changed 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,13 @@ def to_bytes(
232
232
) -> bytes :
233
233
"""Return the serialized TUF file format as bytes.
234
234
235
+ Note that if bytes are first deserialized into ``Metadata`` and then
236
+ serialized with ``to_bytes()``, the two are not required to be
237
+ identical even though the signatures are guaranteed to stay valid. If
238
+ byte-for-byte equivalence is required (which is the case when content
239
+ hashes are used in other metadata), the original content should be used
240
+ instead of re-serializing.
241
+
235
242
Arguments:
236
243
serializer: A MetadataSerializer instance that implements the
237
244
desired serialization format. Default is JSONSerializer.
@@ -265,6 +272,13 @@ def to_file(
265
272
) -> None :
266
273
"""Writes TUF metadata to file storage.
267
274
275
+ Note that if a file is first deserialized into ``Metadata`` and then
276
+ serialized with ``to_file()``, the two files are not required to be
277
+ identical even though the signatures are guaranteed to stay valid. If
278
+ byte-for-byte equivalence is required (which is the case when file
279
+ hashes are used in other metadata), the original file should be used
280
+ instead of re-serializing.
281
+
268
282
Arguments:
269
283
filename: The path to write the file to.
270
284
serializer: A MetadataSerializer instance that implements the
You can’t perform that action at this time.
0 commit comments