@@ -51,7 +51,7 @@ def _create_policy_object(self, attributes: list[str]) -> PolicyObject:
5151 return PolicyObject (uuid = policy_uuid , body = body )
5252
5353 def _serialize_policy_object (self , obj ):
54- """Custom serializer for policy objects to match otdfctl format."""
54+ """Custom NanoTDF serializer to convert to compatible JSON format."""
5555 from otdf_python .policy_object import PolicyBody , AttributeObject
5656
5757 if isinstance (obj , PolicyBody ):
@@ -123,7 +123,7 @@ def _prepare_policy_data(self, config: NanoTDFConfig) -> tuple[bytes, str]:
123123 return policy_body , policy_type
124124
125125 def _prepare_encryption_key (self , config : NanoTDFConfig ) -> bytes :
126- """Get encryption key from config or generate a new one ."""
126+ """Get encryption key from config if provided as hex string, otherwise generate a new random key ."""
127127 key = None
128128 if (
129129 config .cipher
@@ -438,7 +438,7 @@ def _handle_legacy_key_config(
438438 return key , config
439439
440440 def create_nanotdf (self , data : bytes , config : dict | NanoTDFConfig ) -> bytes :
441- """Legacy method for backwards compatibility with existing tests """
441+ """Create a NanoTDF from input data using the provided configuration. """
442442 if len (data ) > self .K_MAX_TDF_SIZE :
443443 raise NanoTDFMaxSizeLimit ("exceeds max size for nano tdf" )
444444
@@ -512,7 +512,7 @@ def _extract_key_for_reading(
512512 def read_nanotdf (
513513 self , nanotdf_bytes : bytes , config : dict | NanoTDFConfig | None = None
514514 ) -> bytes :
515- """Legacy method for backwards compatibility with existing tests """
515+ """Read and decrypt a NanoTDF, returning the original plaintext data. """
516516 output = BytesIO ()
517517 from otdf_python .header import Header # Local import to avoid circular import
518518
0 commit comments