pangea-sdk 4.4.0__py3-none-any.whl → 5.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pangea/__init__.py +1 -1
- pangea/asyncio/request.py +19 -9
- pangea/asyncio/services/__init__.py +1 -0
- pangea/asyncio/services/share.py +621 -0
- pangea/asyncio/services/vault.py +1571 -787
- pangea/crypto/rsa.py +88 -0
- pangea/request.py +46 -41
- pangea/response.py +12 -0
- pangea/services/__init__.py +1 -0
- pangea/services/audit/signing.py +5 -4
- pangea/services/share/file_format.py +170 -0
- pangea/services/share/share.py +1256 -0
- pangea/services/vault/models/asymmetric.py +120 -20
- pangea/services/vault/models/common.py +293 -171
- pangea/services/vault/models/keys.py +94 -0
- pangea/services/vault/models/secret.py +27 -3
- pangea/services/vault/models/symmetric.py +66 -24
- pangea/services/vault/vault.py +1551 -782
- pangea/tools.py +6 -7
- pangea/utils.py +92 -18
- pangea/verify_audit.py +4 -4
- {pangea_sdk-4.4.0.dist-info → pangea_sdk-5.1.0.dist-info}/METADATA +3 -4
- {pangea_sdk-4.4.0.dist-info → pangea_sdk-5.1.0.dist-info}/RECORD +24 -20
- {pangea_sdk-4.4.0.dist-info → pangea_sdk-5.1.0.dist-info}/WHEEL +0 -0
@@ -1,40 +1,29 @@
|
|
1
1
|
# Copyright 2022 Pangea Cyber Corporation
|
2
2
|
# Author: Pangea Cyber Corporation
|
3
|
-
from
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from enum import Enum
|
6
|
+
from typing import List, Optional, Union
|
7
|
+
|
8
|
+
from typing_extensions import Literal
|
4
9
|
|
5
10
|
from pangea.response import APIRequestModel, PangeaResponseResult
|
6
11
|
from pangea.services.vault.models.common import (
|
7
|
-
AsymmetricAlgorithm,
|
8
|
-
CommonGenerateRequest,
|
9
12
|
CommonGenerateResult,
|
10
|
-
CommonStoreRequest,
|
11
13
|
CommonStoreResult,
|
12
|
-
EncodedPrivateKey,
|
13
14
|
EncodedPublicKey,
|
14
|
-
|
15
|
+
ItemType,
|
16
|
+
ItemVersion,
|
17
|
+
Key,
|
15
18
|
)
|
16
19
|
|
17
20
|
|
18
|
-
class AsymmetricGenerateRequest(CommonGenerateRequest):
|
19
|
-
algorithm: AsymmetricAlgorithm
|
20
|
-
purpose: KeyPurpose
|
21
|
-
exportable: Optional[bool] = None
|
22
|
-
|
23
|
-
|
24
21
|
class AsymmetricGenerateResult(CommonGenerateResult):
|
25
22
|
algorithm: str
|
26
23
|
purpose: str
|
27
24
|
public_key: EncodedPublicKey
|
28
25
|
|
29
26
|
|
30
|
-
class AsymmetricStoreRequest(CommonStoreRequest):
|
31
|
-
algorithm: AsymmetricAlgorithm
|
32
|
-
public_key: EncodedPublicKey
|
33
|
-
private_key: EncodedPrivateKey
|
34
|
-
purpose: KeyPurpose
|
35
|
-
exportable: Optional[bool] = None
|
36
|
-
|
37
|
-
|
38
27
|
class AsymmetricStoreResult(CommonStoreResult):
|
39
28
|
algorithm: str
|
40
29
|
purpose: str
|
@@ -49,10 +38,19 @@ class SignRequest(APIRequestModel):
|
|
49
38
|
|
50
39
|
class SignResult(PangeaResponseResult):
|
51
40
|
id: str
|
41
|
+
"""The ID of the item."""
|
42
|
+
|
52
43
|
version: int
|
44
|
+
"""The item version."""
|
45
|
+
|
53
46
|
algorithm: str
|
47
|
+
"""The algorithm of the key."""
|
48
|
+
|
54
49
|
signature: str
|
50
|
+
"""The signature of the message."""
|
51
|
+
|
55
52
|
public_key: Optional[EncodedPublicKey] = None
|
53
|
+
"""The public key (in PEM format)."""
|
56
54
|
|
57
55
|
|
58
56
|
class VerifyRequest(APIRequestModel):
|
@@ -64,6 +62,108 @@ class VerifyRequest(APIRequestModel):
|
|
64
62
|
|
65
63
|
class VerifyResult(PangeaResponseResult):
|
66
64
|
id: str
|
65
|
+
"""The ID of the item."""
|
66
|
+
|
67
67
|
version: int
|
68
|
+
"""The item version."""
|
69
|
+
|
68
70
|
algorithm: str
|
71
|
+
"""The algorithm of the key."""
|
72
|
+
|
69
73
|
valid_signature: bool
|
74
|
+
"""Indicates if messages have been verified."""
|
75
|
+
|
76
|
+
|
77
|
+
class AsymmetricKeyPurpose(str, Enum):
|
78
|
+
"""The purpose of an asymmetric key."""
|
79
|
+
|
80
|
+
SIGNING = "signing"
|
81
|
+
ENCRYPTION = "encryption"
|
82
|
+
JWT = "jwt"
|
83
|
+
PKI = "pki"
|
84
|
+
|
85
|
+
|
86
|
+
class AsymmetricKeySigningAlgorithm(str, Enum):
|
87
|
+
"""The algorithm of the key for purpose=`signing`."""
|
88
|
+
|
89
|
+
ED25519 = "ED25519"
|
90
|
+
RSA_PKCS1V15_2048_SHA256 = "RSA-PKCS1V15-2048-SHA256"
|
91
|
+
ES256 = "ES256"
|
92
|
+
ES384 = "ES384"
|
93
|
+
ES512 = "ES512"
|
94
|
+
ES256K = "ES256K"
|
95
|
+
RSA_PSS_2048_SHA256 = "RSA-PSS-2048-SHA256"
|
96
|
+
RSA_PSS_3072_SHA256 = "RSA-PSS-3072-SHA256"
|
97
|
+
RSA_PSS_4096_SHA256 = "RSA-PSS-4096-SHA256"
|
98
|
+
RSA_PSS_4096_SHA512 = "RSA-PSS-4096-SHA512"
|
99
|
+
ED25519_DILITHIUM2_BETA = "ED25519-DILITHIUM2-BETA"
|
100
|
+
ED448_DILITHIUM3_BETA = "ED448-DILITHIUM3-BETA"
|
101
|
+
SPHINCSPLUS_128F_SHAKE256_SIMPLE_BETA = "SPHINCSPLUS-128F-SHAKE256-SIMPLE-BETA"
|
102
|
+
SPHINCSPLUS_128F_SHAKE256_ROBUST_BETA = "SPHINCSPLUS-128F-SHAKE256-ROBUST-BETA"
|
103
|
+
SPHINCSPLUS_128F_SHA256_SIMPLE_BETA = "SPHINCSPLUS-128F-SHA256-SIMPLE-BETA"
|
104
|
+
SPHINCSPLUS_128F_SHA256_ROBUST_BETA = "SPHINCSPLUS-128F-SHA256-ROBUST-BETA"
|
105
|
+
SPHINCSPLUS_192F_SHAKE256_SIMPLE_BETA = "SPHINCSPLUS-192F-SHAKE256-SIMPLE-BETA"
|
106
|
+
SPHINCSPLUS_192F_SHAKE256_ROBUST_BETA = "SPHINCSPLUS-192F-SHAKE256-ROBUST-BETA"
|
107
|
+
SPHINCSPLUS_192F_SHA256_SIMPLE_BETA = "SPHINCSPLUS-192F-SHA256-SIMPLE-BETA"
|
108
|
+
SPHINCSPLUS_192F_SHA256_ROBUST_BETA = "SPHINCSPLUS-192F-SHA256-ROBUST-BETA"
|
109
|
+
SPHINCSPLUS_256F_SHAKE256_SIMPLE_BETA = "SPHINCSPLUS-256F-SHAKE256-SIMPLE-BETA"
|
110
|
+
SPHINCSPLUS_256F_SHAKE256_ROBUST_BETA = "SPHINCSPLUS-256F-SHAKE256-ROBUST-BETA"
|
111
|
+
SPHINCSPLUS_256F_SHA256_SIMPLE_BETA = "SPHINCSPLUS-256F-SHA256-SIMPLE-BETA"
|
112
|
+
SPHINCSPLUS_256F_SHA256_ROBUST_BETA = "SPHINCSPLUS-256F-SHA256-ROBUST-BETA"
|
113
|
+
FALCON_1024_BETA = "FALCON-1024-BETA"
|
114
|
+
|
115
|
+
|
116
|
+
class AsymmetricKeyEncryptionAlgorithm(str, Enum):
|
117
|
+
"""The algorithm of the key for purpose=`encryption`."""
|
118
|
+
|
119
|
+
RSA_OAEP_2048_SHA1 = "RSA-OAEP-2048-SHA1"
|
120
|
+
RSA_OAEP_2048_SHA256 = "RSA-OAEP-2048-SHA256"
|
121
|
+
RSA_OAEP_2048_SHA512 = "RSA-OAEP-2048-SHA512"
|
122
|
+
RSA_OAEP_3072_SHA1 = "RSA-OAEP-3072-SHA1"
|
123
|
+
RSA_OAEP_3072_SHA256 = "RSA-OAEP-3072-SHA256"
|
124
|
+
RSA_OAEP_3072_SHA512 = "RSA-OAEP-3072-SHA512"
|
125
|
+
RSA_OAEP_4096_SHA1 = "RSA-OAEP-4096-SHA1"
|
126
|
+
RSA_OAEP_4096_SHA256 = "RSA-OAEP-4096-SHA256"
|
127
|
+
RSA_OAEP_4096_SHA512 = "RSA-OAEP-4096-SHA512"
|
128
|
+
|
129
|
+
|
130
|
+
class AsymmetricKeyJwtAlgorithm(str, Enum):
|
131
|
+
"""The algorithm of the key for purpose=`jwt`."""
|
132
|
+
|
133
|
+
ES256 = "ES256"
|
134
|
+
ES384 = "ES384"
|
135
|
+
ES512 = "ES512"
|
136
|
+
|
137
|
+
|
138
|
+
class AsymmetricKeyPkiAlgorithm(str, Enum):
|
139
|
+
"""The algorithm of the key for purpose=`pki`."""
|
140
|
+
|
141
|
+
ED25519 = "ED25519"
|
142
|
+
RSA_2048_SHA256 = "RSA-2048-SHA256"
|
143
|
+
RSA_3072_SHA256 = "RSA-3072-SHA256"
|
144
|
+
RSA_4096_SHA256 = "RSA-4096-SHA256"
|
145
|
+
RSA_PSS_2048_SHA256 = "RSA-PSS-2048-SHA256"
|
146
|
+
RSA_PSS_3072_SHA256 = "RSA-PSS-3072-SHA256"
|
147
|
+
RSA_PSS_4096_SHA256 = "RSA-PSS-4096-SHA256"
|
148
|
+
RSA_PSS_4096_SHA512 = "RSA-PSS-4096-SHA512"
|
149
|
+
ECDSA_SHA256 = "ECDSA-SHA256"
|
150
|
+
ECDSA_SHA384 = "ECDSA-SHA384"
|
151
|
+
ECDSA_SHA512 = "ECDSA-SHA512"
|
152
|
+
|
153
|
+
|
154
|
+
AsymmetricKeyAlgorithm = Union[
|
155
|
+
AsymmetricKeySigningAlgorithm,
|
156
|
+
AsymmetricKeyEncryptionAlgorithm,
|
157
|
+
AsymmetricKeyJwtAlgorithm,
|
158
|
+
AsymmetricKeyPkiAlgorithm,
|
159
|
+
]
|
160
|
+
"""The algorithm of an asymmetric key."""
|
161
|
+
|
162
|
+
|
163
|
+
class AsymmetricKeyVersion(ItemVersion):
|
164
|
+
public_key: Optional[EncodedPublicKey] = None
|
165
|
+
|
166
|
+
|
167
|
+
class AsymmetricKey(Key):
|
168
|
+
type: Literal[ItemType.ASYMMETRIC_KEY] = ItemType.ASYMMETRIC_KEY
|
169
|
+
item_versions: List[AsymmetricKeyVersion]
|