1616# under the License.
1717
1818import datetime as dt
19+ import pathlib
1920
2021from collections .abc import Callable
2122
23+ from pyarrow ._fs import FileSystem
2224from ._parquet import FileDecryptionProperties , FileEncryptionProperties
2325from .lib import _Weakrefable
2426
@@ -73,7 +75,7 @@ class KmsConnectionConfig(_Weakrefable):
7375
7476class KmsClient (_Weakrefable ):
7577 def wrap_key (self , key_bytes : bytes , master_key_identifier : str ) -> str : ...
76- def unwrap_key (self , wrapped_key : str , master_key_identifier : str ) -> str : ...
78+ def unwrap_key (self , wrapped_key : str , master_key_identifier : str ) -> bytes : ...
7779
7880
7981class CryptoFactory (_Weakrefable ):
@@ -93,3 +95,47 @@ class CryptoFactory(_Weakrefable):
9395 ) -> FileDecryptionProperties : ...
9496 def remove_cache_entries_for_token (self , access_token : str ) -> None : ...
9597 def remove_cache_entries_for_all_tokens (self ) -> None : ...
98+ def rotate_master_keys (
99+ self ,
100+ kms_connection_config : KmsConnectionConfig ,
101+ parquet_file_path : str | pathlib .Path ,
102+ filesystem : FileSystem | None = None ,
103+ double_wrapping : bool = True ,
104+ cache_lifetime_seconds : int | float = 600 ,
105+ ) -> None : ...
106+
107+
108+ class KeyMaterial (_Weakrefable ):
109+ @property
110+ def is_footer_key (self ) -> bool : ...
111+ @property
112+ def is_double_wrapped (self ) -> bool : ...
113+ @property
114+ def master_key_id (self ) -> str : ...
115+ @property
116+ def wrapped_dek (self ) -> str : ...
117+ @property
118+ def kek_id (self ) -> str : ...
119+ @property
120+ def wrapped_kek (self ) -> str : ...
121+ @property
122+ def kms_instance_id (self ) -> str : ...
123+ @property
124+ def kms_instance_url (self ) -> str : ...
125+ @staticmethod
126+ def wrap (key_material : KeyMaterial ) -> KeyMaterial : ...
127+ @staticmethod
128+ def parse (key_material_string : str ) -> KeyMaterial : ...
129+
130+
131+
132+ class FileSystemKeyMaterialStore (_Weakrefable ):
133+ def get_key_material (self , key_id : str ) -> KeyMaterial : ...
134+ def get_key_id_set (self ) -> list [str ]: ...
135+ @classmethod
136+ def for_file (
137+ cls ,
138+ parquet_file_path : str | pathlib .Path , / ,
139+ filesystem : FileSystem | None = None
140+ ) -> FileSystemKeyMaterialStore :
141+ ...
0 commit comments