Skip to content

Commit a0719dd

Browse files
committed
ASN.1: minor improvements to conversion docstrings
Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
1 parent 20ec4d1 commit a0719dd

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

tuf/encoding/asn1_convert.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,9 @@ def public_key_to_pyasn1(public_key_dict):
243243

244244
def hex_str_to_pyasn1_octets(hex_string):
245245
"""
246-
246+
Convert a hex string into a pyasn1 OctetString object.
247+
Example arg: '12345abcd' (string / unicode)
248+
Returns a pyasn1.type.univ.OctetString object.
247249
"""
248250
# TODO: Verify hex_string type.
249251

@@ -273,8 +275,8 @@ def hex_str_to_pyasn1_octets(hex_string):
273275

274276
def hex_str_from_pyasn1_octets(octets_pyasn1):
275277
"""
276-
Convert a pyasn1 OctetString object into a hex string.
277-
Example return: '4b394ae2'
278+
Convert a pyasn1.type.univ.OctetString object into a hex string.
279+
Example return: '4b394ae2' (string / unicode)
278280
Raises Error() if an individual octet's supposed integer value is out of
279281
range (0 <= x <= 255).
280282
"""

tuf/encoding/asn1_metadata_definitions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ class HashesContainer(ac.Sequence):
110110
"""
111111
Single-element, vapid wrapper for Hashes, solely to match structure of the
112112
TUF-internal metadata. (This layer could be removed from both metadata
113-
formats without loss of semantics or clarity, but would break backward
114-
compatibility.)
113+
formats to result in a clearer definition without change to the implicit
114+
semantics, but would break backward compatibility.)
115115
Conceptual ASN.1 structure (Python pseudocode):
116116
{'hashes': [
117117
{'function': 'sha256', 'digest': '...'},

0 commit comments

Comments
 (0)