|
54 | 54 | # 'rsa/oaep-mgf1/sha384': WrappingAlgorithm.RSA_OAEP_SHA384_MGF1,
|
55 | 55 | # 'rsa/oaep-mgf1/sha512': WrappingAlgorithm.RSA_OAEP_SHA512_MGF1,
|
56 | 56 | }
|
57 |
| -_NOT_YET_IMPLEMENTED = {'rsa/oaep-mgf1/sha384', 'rsa/oaep-mgf1/sha512'} |
| 57 | +_NOT_YET_IMPLEMENTED = {"rsa/oaep-mgf1/sha384", "rsa/oaep-mgf1/sha512"} |
58 | 58 | _RAW_ENCRYPTION_KEY_TYPE = {
|
59 | 59 | "symmetric": EncryptionKeyType.SYMMETRIC,
|
60 | 60 | "private": EncryptionKeyType.PRIVATE,
|
@@ -93,14 +93,10 @@ def __attrs_post_init__(self):
|
93 | 93 |
|
94 | 94 | if self.type_name == "raw":
|
95 | 95 | if None in (self.provider_id, self.encryption_algorithm):
|
96 |
| - raise ValueError( |
97 |
| - "Provider ID and encryption algorithm are both required for raw keys" |
98 |
| - ) |
| 96 | + raise ValueError("Provider ID and encryption algorithm are both required for raw keys") |
99 | 97 |
|
100 | 98 | if self.encryption_algorithm == "rsa" and self.padding_algorithm is None:
|
101 |
| - raise ValueError( |
102 |
| - "Padding algorithm is required for raw RSA keys" |
103 |
| - ) |
| 99 | + raise ValueError("Padding algorithm is required for raw RSA keys") |
104 | 100 |
|
105 | 101 | if self.padding_algorithm == "oaep-mgf1" and self.padding_hash is None:
|
106 | 102 | raise ValueError('Padding hash must be specified if padding algorithm is "oaep-mgf1"')
|
@@ -149,7 +145,7 @@ def _wrapping_algorithm(self, key_bits):
|
149 | 145 | key_spec_name = "/".join(key_spec_values)
|
150 | 146 |
|
151 | 147 | if key_spec_name in _NOT_YET_IMPLEMENTED:
|
152 |
| - raise NotImplementedError("Key spec \"{}\" is not yet available.") |
| 148 | + raise NotImplementedError('Key spec "{}" is not yet available.') |
153 | 149 |
|
154 | 150 | return _RAW_WRAPPING_KEY_ALGORITHMS[key_spec_name]
|
155 | 151 |
|
|
0 commit comments