Source code for sdkms.v1.models.unwrap_key_request_ex

# 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 UnwrapKeyRequestEx(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': 'SobjectDescriptor', 'alg': 'ObjectType', 'group_id': 'str', 'obj_type': 'ObjectType', 'wrapped_key': 'bytearray', 'mode': 'CryptMode', 'iv': 'bytearray', 'ad': 'bytearray', 'tag': 'bytearray', 'name': 'str', 'description': 'str', 'key_ops': 'list[KeyOperations]', 'custom_metadata': 'dict(str, str)', 'enabled': 'bool', 'rsa': 'RsaOptions' } attribute_map = { 'key': 'key', 'alg': 'alg', 'group_id': 'group_id', 'obj_type': 'obj_type', 'wrapped_key': 'wrapped_key', 'mode': 'mode', 'iv': 'iv', 'ad': 'ad', 'tag': 'tag', 'name': 'name', 'description': 'description', 'key_ops': 'key_ops', 'custom_metadata': 'custom_metadata', 'enabled': 'enabled', 'rsa': 'rsa' }
[docs] def __init__(self, key=None, alg=None, group_id=None, obj_type=None, wrapped_key=None, mode=None, iv=None, ad=None, tag=None, name=None, description=None, key_ops=None, custom_metadata=None, enabled=None, rsa=None): """ UnwrapKeyRequestEx - a model defined in Swagger """ self._key = None self._alg = None self._group_id = None self._obj_type = None self._wrapped_key = None self._mode = None self._iv = None self._ad = None self._tag = None self._name = None self._description = None self._key_ops = None self._custom_metadata = None self._enabled = None self._rsa = None self.key = key self.alg = alg if group_id is not None: self.group_id = group_id self.obj_type = obj_type self.wrapped_key = wrapped_key if mode is not None: self.mode = mode if iv is not None: self.iv = iv if ad is not None: self.ad = ad if tag is not None: self.tag = tag self.name = name if description is not None: self.description = description if key_ops is not None: self.key_ops = key_ops if custom_metadata is not None: self.custom_metadata = custom_metadata if enabled is not None: self.enabled = enabled if rsa is not None: self.rsa = rsa
@property def key(self): """ Gets the key of this UnwrapKeyRequestEx. Type: `SobjectDescriptor` :setter: Sets the key of this UnwrapKeyRequestEx. """ return self._key @key.setter def key(self, key): """ Sets the key of this UnwrapKeyRequestEx. """ self._key = key @property def alg(self): """ Gets the alg of this UnwrapKeyRequestEx. Type: `ObjectType` :setter: Sets the alg of this UnwrapKeyRequestEx. """ return self._alg @alg.setter def alg(self, alg): """ Sets the alg of this UnwrapKeyRequestEx. """ self._alg = alg @property def group_id(self): """ Gets the group_id of this UnwrapKeyRequestEx. Group ID (not name) of the security group that this security object should belong to. The user or application creating this security object must be a member of this group. If no group is specified, the default group for the user or application will be used. Type: `str` :setter: Sets the group_id of this UnwrapKeyRequestEx. """ return self._group_id @group_id.setter def group_id(self, group_id): """ Sets the group_id of this UnwrapKeyRequestEx. Group ID (not name) of the security group that this security object should belong to. The user or application creating this security object must be a member of this group. If no group is specified, the default group for the user or application will be used. """ self._group_id = group_id @property def obj_type(self): """ Gets the obj_type of this UnwrapKeyRequestEx. Type: `ObjectType` :setter: Sets the obj_type of this UnwrapKeyRequestEx. """ return self._obj_type @obj_type.setter def obj_type(self, obj_type): """ Sets the obj_type of this UnwrapKeyRequestEx. """ self._obj_type = obj_type @property def wrapped_key(self): """ Gets the wrapped_key of this UnwrapKeyRequestEx. A Security Object previously wrapped with another key. Type: `bytearray` :setter: Sets the wrapped_key of this UnwrapKeyRequestEx. """ return self._wrapped_key @wrapped_key.setter def wrapped_key(self, wrapped_key): """ Sets the wrapped_key of this UnwrapKeyRequestEx. A Security Object previously wrapped with another key. """ if not isinstance(wrapped_key, bytearray): raise ValueError("Invalid value for `wrapped_key`, `wrapped_key` must be a bytearray") self._wrapped_key = wrapped_key @property def mode(self): """ Gets the mode of this UnwrapKeyRequestEx. Type: `CryptMode` :setter: Sets the mode of this UnwrapKeyRequestEx. """ return self._mode @mode.setter def mode(self, mode): """ Sets the mode of this UnwrapKeyRequestEx. """ self._mode = mode @property def iv(self): """ Gets the iv of this UnwrapKeyRequestEx. The initialization value used to encrypt this ciphertext. This field is required for symmetric ciphers, and ignored for asymmetric ciphers. Type: `bytearray` :setter: Sets the iv of this UnwrapKeyRequestEx. """ return self._iv @iv.setter def iv(self, iv): """ Sets the iv of this UnwrapKeyRequestEx. The initialization value used to encrypt this ciphertext. This field is required for symmetric ciphers, and ignored for asymmetric ciphers. """ if not isinstance(iv, bytearray): raise ValueError("Invalid value for `iv`, `iv` must be a bytearray") self._iv = iv @property def ad(self): """ Gets the ad of this UnwrapKeyRequestEx. The authenticated data used with this ciphertext and authentication tag. This field is required for symmetric ciphers using cipher mode GCM or CCM, and must not be specified for all other ciphers. Type: `bytearray` :setter: Sets the ad of this UnwrapKeyRequestEx. """ return self._ad @ad.setter def ad(self, ad): """ Sets the ad of this UnwrapKeyRequestEx. The authenticated data used with this ciphertext and authentication tag. This field is required for symmetric ciphers using cipher mode GCM or CCM, and must not be specified for all other ciphers. """ if not isinstance(ad, bytearray): raise ValueError("Invalid value for `ad`, `ad` must be a bytearray") self._ad = ad @property def tag(self): """ Gets the tag of this UnwrapKeyRequestEx. The authentication tag used with this ciphertext and authenticated data. This field is required for symmetric ciphers using cipher mode GCM or CCM, and must not be specified for all other ciphers. Type: `bytearray` :setter: Sets the tag of this UnwrapKeyRequestEx. """ return self._tag @tag.setter def tag(self, tag): """ Sets the tag of this UnwrapKeyRequestEx. The authentication tag used with this ciphertext and authenticated data. This field is required for symmetric ciphers using cipher mode GCM or CCM, and must not be specified for all other ciphers. """ if not isinstance(tag, bytearray): raise ValueError("Invalid value for `tag`, `tag` must be a bytearray") self._tag = tag @property def name(self): """ Gets the name of this UnwrapKeyRequestEx. Name of the security object to unwrap. Security object names must be unique within an account. Type: `str` :setter: Sets the name of this UnwrapKeyRequestEx. """ return self._name @name.setter def name(self, name): """ Sets the name of this UnwrapKeyRequestEx. Name of the security object to unwrap. Security object names must be unique within an account. """ self._name = name @property def description(self): """ Gets the description of this UnwrapKeyRequestEx. Description of the Security object to unwrap. Type: `str` :setter: Sets the description of this UnwrapKeyRequestEx. """ return self._description @description.setter def description(self, description): """ Sets the description of this UnwrapKeyRequestEx. Description of the Security object to unwrap. """ self._description = description @property def key_ops(self): """ Gets the key_ops of this UnwrapKeyRequestEx. Optional array of key operations to be enabled for this security object. If this property is not provided, the DSM server will provide a default set of key operations. Note that if you provide an empty array, all key operations will be disabled. Type: list[`KeyOperations`] :setter: Sets the key_ops of this UnwrapKeyRequestEx. """ return self._key_ops @key_ops.setter def key_ops(self, key_ops): """ Sets the key_ops of this UnwrapKeyRequestEx. Optional array of key operations to be enabled for this security object. If this property is not provided, the DSM server will provide a default set of key operations. Note that if you provide an empty array, all key operations will be disabled. """ self._key_ops = key_ops @property def custom_metadata(self): """ Gets the custom_metadata of this UnwrapKeyRequestEx. User-defined metadata for this key. Stored as key-value pairs. Type: map[`str`] :setter: Sets the custom_metadata of this UnwrapKeyRequestEx. """ return self._custom_metadata @custom_metadata.setter def custom_metadata(self, custom_metadata): """ Sets the custom_metadata of this UnwrapKeyRequestEx. User-defined metadata for this key. Stored as key-value pairs. """ self._custom_metadata = custom_metadata @property def enabled(self): """ Gets the enabled of this UnwrapKeyRequestEx. Whether the new security object should be enabled. Disabled security objects may not perform cryptographic operations. Type: `bool` :setter: Sets the enabled of this UnwrapKeyRequestEx. """ return self._enabled @enabled.setter def enabled(self, enabled): """ Sets the enabled of this UnwrapKeyRequestEx. Whether the new security object should be enabled. Disabled security objects may not perform cryptographic operations. """ self._enabled = enabled @property def rsa(self): """ Gets the rsa of this UnwrapKeyRequestEx. Type: `RsaOptions` :setter: Sets the rsa of this UnwrapKeyRequestEx. """ return self._rsa @rsa.setter def rsa(self, rsa): """ Sets the rsa of this UnwrapKeyRequestEx. """ self._rsa = rsa 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, UnwrapKeyRequestEx): return False return self.__dict__ == other.__dict__ def __ne__(self, other): """ Returns true if both objects are not equal """ return not self == other