Source code for sdkms.v1.models.rsa_options

# coding: utf-8

"""
    Fortanix DSM REST API

    This is a set of REST APIs for accessing the Fortanix Data Security Manager. This includes APIs for managing accounts, and for performing cryptographic and key management operations. 

    OpenAPI spec version: 1.0.0-20200608
    Contact: support@fortanix.com
    Generated by: https://github.com/swagger-api/swagger-codegen.git

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
    
        http://www.apache.org/licenses/LICENSE-2.0
    
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
"""


from pprint import pformat
from six import iteritems
import re




# NOTE: This class is auto generated by the swagger code generator program.
# Do not edit the class manually.
[docs]class RsaOptions(object): """ Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ swagger_types = { 'key_size': 'int', 'public_exponent': 'int', 'encryption_policy': 'list[RsaEncryptionPolicy]', 'signature_policy': 'list[RsaSignaturePolicy]' } attribute_map = { 'key_size': 'key_size', 'public_exponent': 'public_exponent', 'encryption_policy': 'encryption_policy', 'signature_policy': 'signature_policy' }
[docs] def __init__(self, key_size=None, public_exponent=None, encryption_policy=None, signature_policy=None): """ RsaOptions - a model defined in Swagger """ self._key_size = None self._public_exponent = None self._encryption_policy = None self._signature_policy = None if key_size is not None: self.key_size = key_size if public_exponent is not None: self.public_exponent = public_exponent if encryption_policy is not None: self.encryption_policy = encryption_policy if signature_policy is not None: self.signature_policy = signature_policy
@property def key_size(self): """ Gets the key_size of this RsaOptions. Specify on Create only. Returned on Get. Size in bits (not bytes) of the RSA key. Type: `int` :setter: Sets the key_size of this RsaOptions. """ return self._key_size @key_size.setter def key_size(self, key_size): """ Sets the key_size of this RsaOptions. Specify on Create only. Returned on Get. Size in bits (not bytes) of the RSA key. """ self._key_size = key_size @property def public_exponent(self): """ Gets the public_exponent of this RsaOptions. Specify on Create only. Public exponent to use for generating the RSA key. Type: `int` :setter: Sets the public_exponent of this RsaOptions. """ return self._public_exponent @public_exponent.setter def public_exponent(self, public_exponent): """ Sets the public_exponent of this RsaOptions. Specify on Create only. Public exponent to use for generating the RSA key. """ self._public_exponent = public_exponent @property def encryption_policy(self): """ Gets the encryption_policy of this RsaOptions. Encryption policy for this RSA key. When doing an encryption or key wrapping operation, the policies are evaluated against the specified parameters one by one. If one matches, the operation is allowed. If none match, including if the policy list is empty, the operation is disallowed. Missing optional parameters will have their defaults specified according to the matched policy. The default for new keys is `[{\"padding\":{\"OAEP\":{}}]`. If (part of) a constraint is not specified, anything is allowed for that constraint. To impose no constraints, specify `[{}]`. Type: list[`RsaEncryptionPolicy`] :setter: Sets the encryption_policy of this RsaOptions. """ return self._encryption_policy @encryption_policy.setter def encryption_policy(self, encryption_policy): """ Sets the encryption_policy of this RsaOptions. Encryption policy for this RSA key. When doing an encryption or key wrapping operation, the policies are evaluated against the specified parameters one by one. If one matches, the operation is allowed. If none match, including if the policy list is empty, the operation is disallowed. Missing optional parameters will have their defaults specified according to the matched policy. The default for new keys is `[{\"padding\":{\"OAEP\":{}}]`. If (part of) a constraint is not specified, anything is allowed for that constraint. To impose no constraints, specify `[{}]`. """ self._encryption_policy = encryption_policy @property def signature_policy(self): """ Gets the signature_policy of this RsaOptions. Signature policy for this RSA key. When doing a signature operation, the policies are evaluated against the specified parameters one by one. If one matches, the operation is allowed. If none match, including if the policy list is empty, the operation is disallowed. Missing optional parameters will have their defaults specified according to the matched policy. The default for new keys is `[{}]` (no constraints). If (part of) a constraint is not specified, anything is allowed for that constraint. Type: list[`RsaSignaturePolicy`] :setter: Sets the signature_policy of this RsaOptions. """ return self._signature_policy @signature_policy.setter def signature_policy(self, signature_policy): """ Sets the signature_policy of this RsaOptions. Signature policy for this RSA key. When doing a signature operation, the policies are evaluated against the specified parameters one by one. If one matches, the operation is allowed. If none match, including if the policy list is empty, the operation is disallowed. Missing optional parameters will have their defaults specified according to the matched policy. The default for new keys is `[{}]` (no constraints). If (part of) a constraint is not specified, anything is allowed for that constraint. """ self._signature_policy = signature_policy def to_dict(self): """ Returns the model properties as a dict """ result = {} for attr, _ in iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value )) elif hasattr(value, "to_dict"): result[attr] = value.to_dict() elif isinstance(value, dict): result[attr] = dict(map( lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, value.items() )) else: result[attr] = value return result def to_str(self): """ Returns the string representation of the model """ return pformat(self.to_dict()) def __repr__(self): """ For `print` and `pprint` """ return self.to_str() def __eq__(self, other): """ Returns true if both objects are equal """ if not isinstance(other, RsaOptions): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """ Returns true if both objects are not equal """ return not self == other