12
12
from cryptography .hazmat .primitives .asymmetric import padding , rsa
13
13
from cryptography .hazmat .primitives .ciphers import Cipher , algorithms , modes
14
14
15
- from apify_shared .utils import ignore_docs
16
15
from crawlee ._utils .crypto import crypto_random_object_id
17
16
18
17
from apify ._consts import ENCRYPTED_INPUT_VALUE_REGEXP , ENCRYPTED_JSON_VALUE_PREFIX , ENCRYPTED_STRING_VALUE_PREFIX
22
21
ENCRYPTION_AUTH_TAG_LENGTH = 16
23
22
24
23
25
- @ignore_docs
26
24
def public_encrypt (value : str , * , public_key : rsa .RSAPublicKey ) -> dict :
27
25
"""Encrypts the given value using AES cipher and the password for encryption using the public key.
28
26
@@ -66,7 +64,6 @@ def public_encrypt(value: str, *, public_key: rsa.RSAPublicKey) -> dict:
66
64
}
67
65
68
66
69
- @ignore_docs
70
67
def private_decrypt (
71
68
encrypted_password : str ,
72
69
encrypted_value : str ,
@@ -118,7 +115,6 @@ def private_decrypt(
118
115
return decipher_bytes .decode ('utf-8' )
119
116
120
117
121
- @ignore_docs
122
118
def load_private_key (private_key_file_base64 : str , private_key_password : str ) -> rsa .RSAPrivateKey :
123
119
private_key = serialization .load_pem_private_key (
124
120
base64 .b64decode (private_key_file_base64 .encode ('utf-8' )),
@@ -138,7 +134,6 @@ def _load_public_key(public_key_file_base64: str) -> rsa.RSAPublicKey:
138
134
return public_key
139
135
140
136
141
- @ignore_docs
142
137
def decrypt_input_secrets (private_key : rsa .RSAPrivateKey , input_data : Any ) -> Any :
143
138
"""Decrypt input secrets."""
144
139
if not isinstance (input_data , dict ):
@@ -180,7 +175,6 @@ def encode_base62(num: int) -> str:
180
175
return res
181
176
182
177
183
- @ignore_docs
184
178
def create_hmac_signature (secret_key : str , message : str ) -> str :
185
179
"""Generate an HMAC signature and encodes it using Base62. Base62 encoding reduces the signature length.
186
180
0 commit comments