@@ -290,10 +290,10 @@ def __init__(self, *, primitive: Optional[CryptoPrimitive] = None,
290
290
self .curve = curve
291
291
self .execution_environment = execution_environment
292
292
self .implementation_platform = implementation_platform
293
- self .certification_levels = certification_levels
293
+ self .certification_levels = certification_levels or [] # type:ignore[assignment]
294
294
self .mode = mode
295
295
self .padding = padding
296
- self .crypto_functions = crypto_functions
296
+ self .crypto_functions = crypto_functions or [] # type:ignore[assignment]
297
297
self .classical_security_level = classical_security_level
298
298
self .nist_quantum_security_level = nist_quantum_security_level
299
299
@@ -686,16 +686,16 @@ class RelatedCryptoMaterialType(str, Enum):
686
686
INITIALIZATION_VECTOR = 'initialization-vector'
687
687
KEY = 'key'
688
688
NONCE = 'nonce'
689
- PASSWORD = 'password'
689
+ PASSWORD = 'password' # nosec
690
690
PRIVATE_KEY = 'private-key'
691
691
PUBLIC_KEY = 'public-key'
692
692
SALT = 'salt'
693
- SECRET_KEY = 'secret-key'
693
+ SECRET_KEY = 'secret-key' # nosec
694
694
SEED = 'seed'
695
- SHARED_SECRET = 'shared-secret'
695
+ SHARED_SECRET = 'shared-secret' # nosec
696
696
SIGNATURE = 'signature'
697
697
TAG = 'tag'
698
- TOKEN = 'token'
698
+ TOKEN = 'token' # nosec
699
699
700
700
OTHER = 'other'
701
701
UNKNOWN = 'unknown'
@@ -968,7 +968,7 @@ def size(self) -> Optional[int]:
968
968
969
969
@size .setter
970
970
def size (self , size : Optional [int ]) -> None :
971
- if size < 0 :
971
+ if size and size < 0 :
972
972
raise InvalidRelatedCryptoMaterialSizeException ('Size must be greater than zero' )
973
973
self ._size = size
974
974
@@ -1272,7 +1272,7 @@ def __init__(self, *, type: Optional[ProtocolPropertiesType] = None, version: Op
1272
1272
ikev2_transform_types : Optional [Ikev2TransformTypes ] = None ) -> None :
1273
1273
self .type = type
1274
1274
self .version = version
1275
- self .cipher_suites = cipher_suites
1275
+ self .cipher_suites = cipher_suites or [] # type:ignore[assignment]
1276
1276
self .ikev2_transform_types = ikev2_transform_types
1277
1277
1278
1278
@property
@@ -1375,7 +1375,7 @@ def __init__(self, *, asset_type: Optional[CryptoAssetType] = None,
1375
1375
1376
1376
@property
1377
1377
@serializable .xml_sequence (10 )
1378
- def asset_type (self ) -> CryptoAssetType :
1378
+ def asset_type (self ) -> Optional [ CryptoAssetType ] :
1379
1379
"""
1380
1380
Cryptographic assets occur in several forms. Algorithms and protocols are most commonly implemented in
1381
1381
specialized cryptographic libraries. They may however also be 'hardcoded' in software components. Certificates
@@ -1388,7 +1388,7 @@ def asset_type(self) -> CryptoAssetType:
1388
1388
return self ._asset_type
1389
1389
1390
1390
@asset_type .setter
1391
- def asset_type (self , asset_type : CryptoAssetType ) -> None :
1391
+ def asset_type (self , asset_type : Optional [ CryptoAssetType ] ) -> None :
1392
1392
self ._asset_type = asset_type
1393
1393
1394
1394
@property
0 commit comments