kmip/pie/objects.py
def key_wrapping_data(self, value):
        """
        Set the key wrapping data attributes using a dictionary.
        """
        if value is None:
            value = {}
        elif not isinstance(value, dict):
            raise TypeError("Key wrapping data must be a dictionary.")

        self._kdw_wrapping_method = value.get('wrapping_method')

        eki = value.get('encryption_key_information')
        if eki is None:
            eki = {}
        self._kdw_eki_unique_identifier = eki.get('unique_identifier')
        eki_cp = eki.get('cryptographic_parameters')
        if eki_cp is None:
            eki_cp = {}
        self._kdw_eki_cp_block_cipher_mode = eki_cp.get('block_cipher_mode')
        self._kdw_eki_cp_padding_method = eki_cp.get('padding_method')
        self._kdw_eki_cp_hashing_algorithm = eki_cp.get('hashing_algorithm')
        self._kdw_eki_cp_key_role_type = eki_cp.get('key_role_type')
        self._kdw_eki_cp_digital_signature_algorithm = \
            eki_cp.get('digital_signature_algorithm')
        self._kdw_eki_cp_cryptographic_algorithm = \
            eki_cp.get('cryptographic_algorithm')
        self._kdw_eki_cp_random_iv = eki_cp.get('random_iv')
        self._kdw_eki_cp_iv_length = eki_cp.get('iv_length')
        self._kdw_eki_cp_tag_length = eki_cp.get('tag_length')
        self._kdw_eki_cp_fixed_field_length = eki_cp.get('fixed_field_length')
        self._kdw_eki_cp_invocation_field_length = \
            eki_cp.get('invocation_field_length')
        self._kdw_eki_cp_counter_length = eki_cp.get('counter_length')
        self._kdw_eki_cp_initial_counter_value = \
            eki_cp.get('initial_counter_value')

        mski = value.get('mac_signature_key_information')
        if mski is None:
            mski = {}
        self._kdw_mski_unique_identifier = mski.get('unique_identifier')
        mski_cp = mski.get('cryptographic_parameters')
        if mski_cp is None:
            mski_cp = {}
        self._kdw_mski_cp_block_cipher_mode = mski_cp.get('block_cipher_mode')
        self._kdw_mski_cp_padding_method = mski_cp.get('padding_method')
        self._kdw_mski_cp_hashing_algorithm = mski_cp.get('hashing_algorithm')
        self._kdw_mski_cp_key_role_type = mski_cp.get('key_role_type')
        self._kdw_mski_cp_digital_signature_algorithm = \
            mski_cp.get('digital_signature_algorithm')
        self._kdw_mski_cp_cryptographic_algorithm = \
            mski_cp.get('cryptographic_algorithm')
        self._kdw_mski_cp_random_iv = mski_cp.get('random_iv')
        self._kdw_mski_cp_iv_length = mski_cp.get('iv_length')
        self._kdw_mski_cp_tag_length = mski_cp.get('tag_length')
        self._kdw_mski_cp_fixed_field_length = \
            mski_cp.get('fixed_field_length')
        self._kdw_mski_cp_invocation_field_length = \
            mski_cp.get('invocation_field_length')
        self._kdw_mski_cp_counter_length = mski_cp.get('counter_length')
        self._kdw_mski_cp_initial_counter_value = \
            mski_cp.get('initial_counter_value')

        self._kdw_mac_signature = value.get('mac_signature')
        self._kdw_iv_counter_nonce = value.get('iv_counter_nonce')
        self._kdw_encoding_option = value.get('encoding_option')
def key_wrapping_data(self, value):
        """
        Set the key wrapping data attributes using a dictionary.
        """
        if value is None:
            value = {}
        elif not isinstance(value, dict):
            raise TypeError("Key wrapping data must be a dictionary.")

        self._kdw_wrapping_method = value.get('wrapping_method')

        eki = value.get('encryption_key_information')
        if eki is None:
            eki = {}
        self._kdw_eki_unique_identifier = eki.get('unique_identifier')
        eki_cp = eki.get('cryptographic_parameters')
        if eki_cp is None:
            eki_cp = {}
        self._kdw_eki_cp_block_cipher_mode = eki_cp.get('block_cipher_mode')
        self._kdw_eki_cp_padding_method = eki_cp.get('padding_method')
        self._kdw_eki_cp_hashing_algorithm = eki_cp.get('hashing_algorithm')
        self._kdw_eki_cp_key_role_type = eki_cp.get('key_role_type')
        self._kdw_eki_cp_digital_signature_algorithm = \
            eki_cp.get('digital_signature_algorithm')
        self._kdw_eki_cp_cryptographic_algorithm = \
            eki_cp.get('cryptographic_algorithm')
        self._kdw_eki_cp_random_iv = eki_cp.get('random_iv')
        self._kdw_eki_cp_iv_length = eki_cp.get('iv_length')
        self._kdw_eki_cp_tag_length = eki_cp.get('tag_length')
        self._kdw_eki_cp_fixed_field_length = eki_cp.get('fixed_field_length')
        self._kdw_eki_cp_invocation_field_length = \
            eki_cp.get('invocation_field_length')
        self._kdw_eki_cp_counter_length = eki_cp.get('counter_length')
        self._kdw_eki_cp_initial_counter_value = \
            eki_cp.get('initial_counter_value')

        mski = value.get('mac_signature_key_information')
        if mski is None:
            mski = {}
        self._kdw_mski_unique_identifier = mski.get('unique_identifier')
        mski_cp = mski.get('cryptographic_parameters')
        if mski_cp is None:
            mski_cp = {}
        self._kdw_mski_cp_block_cipher_mode = mski_cp.get('block_cipher_mode')
        self._kdw_mski_cp_padding_method = mski_cp.get('padding_method')
        self._kdw_mski_cp_hashing_algorithm = mski_cp.get('hashing_algorithm')
        self._kdw_mski_cp_key_role_type = mski_cp.get('key_role_type')
        self._kdw_mski_cp_digital_signature_algorithm = \
            mski_cp.get('digital_signature_algorithm')
        self._kdw_mski_cp_cryptographic_algorithm = \
            mski_cp.get('cryptographic_algorithm')
        self._kdw_mski_cp_random_iv = mski_cp.get('random_iv')
        self._kdw_mski_cp_iv_length = mski_cp.get('iv_length')
        self._kdw_mski_cp_tag_length = mski_cp.get('tag_length')
        self._kdw_mski_cp_fixed_field_length = \
            mski_cp.get('fixed_field_length')
        self._kdw_mski_cp_invocation_field_length = \
            mski_cp.get('invocation_field_length')
        self._kdw_mski_cp_counter_length = mski_cp.get('counter_length')
        self._kdw_mski_cp_initial_counter_value = \
            mski_cp.get('initial_counter_value')

        self._kdw_mac_signature = value.get('mac_signature')
        self._kdw_iv_counter_nonce = value.get('iv_counter_nonce')
        self._kdw_encoding_option = value.get('encoding_option')
Set the key wrapping data attributes using a dictionary.