kmip/services/server/engine.py
def _get_attribute_from_managed_object(self, managed_object, attr_name):
        """
        Get the attribute value from the kmip.pie managed object.
        """
        if attr_name == 'Unique Identifier':
            return str(managed_object.unique_identifier)
        elif attr_name == 'Name':
            names = list()
            for name in managed_object.names:
                name = attributes.Name(
                    attributes.Name.NameValue(name),
                    attributes.Name.NameType(
                        enums.NameType.UNINTERPRETED_TEXT_STRING
                    )
                )
                names.append(name)
            return names
        elif attr_name == 'Object Type':
            return managed_object._object_type
        elif attr_name == 'Cryptographic Algorithm':
            return managed_object.cryptographic_algorithm
        elif attr_name == 'Cryptographic Length':
            return managed_object.cryptographic_length
        elif attr_name == 'Cryptographic Parameters':
            return None
        elif attr_name == 'Cryptographic Domain Parameters':
            return None
        elif attr_name == 'Certificate Type':
            return managed_object.certificate_type
        elif attr_name == 'Certificate Length':
            return None
        elif attr_name == 'X.509 Certificate Identifier':
            return None
        elif attr_name == 'X.509 Certificate Subject':
            return None
        elif attr_name == 'X.509 Certificate Issuer':
            return None
        elif attr_name == 'Certificate Identifier':
            return None
        elif attr_name == 'Certificate Subject':
            return None
        elif attr_name == 'Certificate Issuer':
            return None
        elif attr_name == 'Digital Signature Algorithm':
            return None
        elif attr_name == 'Digest':
            return None
        elif attr_name == 'Operation Policy Name':
            return managed_object.operation_policy_name
        elif attr_name == 'Cryptographic Usage Mask':
            return managed_object.cryptographic_usage_masks
        elif attr_name == 'Lease Time':
            return None
        elif attr_name == 'Usage Limits':
            return None
        elif attr_name == 'State':
            return managed_object.state
        elif attr_name == 'Initial Date':
            return managed_object.initial_date
        elif attr_name == 'Activation Date':
            return None
        elif attr_name == 'Process Start Date':
            return None
        elif attr_name == 'Protect Stop Date':
            return None
        elif attr_name == 'Deactivation Date':
            return None
        elif attr_name == 'Destroy Date':
            return None
        elif attr_name == 'Compromise Occurrence Date':
            return None
        elif attr_name == 'Compromise Date':
            return None
        elif attr_name == 'Revocation Reason':
            return None
        elif attr_name == 'Archive Date':
            return None
        elif attr_name == 'Object Group':
            return None
        elif attr_name == 'Fresh':
            return None
        elif attr_name == 'Link':
            return None
        elif attr_name == 'Application Specific Information':
            return None
        elif attr_name == 'Contact Information':
            return None
        elif attr_name == 'Last Change Date':
            return None
        else:
            # Since custom attribute names are possible, just return None
            # for unrecognized attributes. This satisfies the spec.
            return None
def _get_attribute_from_managed_object(self, managed_object, attr_name):
        if attr_name == 'Unique Identifier':
            return str(managed_object.unique_identifier)
        elif attr_name == 'Name':
            names = list()
            for name in managed_object.names:
                name = attributes.Name(
                    attributes.Name.NameValue(name),
                    attributes.Name.NameType(
                        enums.NameType.UNINTERPRETED_TEXT_STRING
                    )
                )
                names.append(name)
            return names
        elif attr_name == 'Object Type':
            return managed_object._object_type
        elif attr_name == 'Cryptographic Algorithm':
            return managed_object.cryptographic_algorithm
        elif attr_name == 'Cryptographic Length':
            return managed_object.cryptographic_length
        elif attr_name == 'Cryptographic Parameters':
            return None
        elif attr_name == 'Cryptographic Domain Parameters':
            return None
        elif attr_name == 'Certificate Type':
            return managed_object.certificate_type
        elif attr_name == 'Certificate Length':
            return None
        elif attr_name == 'X.509 Certificate Identifier':
            return None
        elif attr_name == 'X.509 Certificate Subject':
            return None
        elif attr_name == 'X.509 Certificate Issuer':
            return None
        elif attr_name == 'Certificate Identifier':
            return None
        elif attr_name == 'Certificate Subject':
            return None
        elif attr_name == 'Certificate Issuer':
            return None
        elif attr_name == 'Digital Signature Algorithm':
            return None
        elif attr_name == 'Digest':
            return None
        elif attr_name == 'Operation Policy Name':
            return managed_object.operation_policy_name
        elif attr_name == 'Cryptographic Usage Mask':
            return managed_object.cryptographic_usage_masks
        elif attr_name == 'Lease Time':
            return None
        elif attr_name == 'Usage Limits':
            return None
        elif attr_name == 'State':
            return managed_object.state
        elif attr_name == 'Initial Date':
            return managed_object.initial_date
        elif attr_name == 'Activation Date':
            return None
        elif attr_name == 'Process Start Date':
            return None
        elif attr_name == 'Protect Stop Date':
            return None
        elif attr_name == 'Deactivation Date':
            return None
        elif attr_name == 'Destroy Date':
            return None
        elif attr_name == 'Compromise Occurrence Date':
            return None
        elif attr_name == 'Compromise Date':
            return None
        elif attr_name == 'Revocation Reason':
            return None
        elif attr_name == 'Archive Date':
            return None
        elif attr_name == 'Object Group':
            return None
        elif attr_name == 'Fresh':
            return None
        elif attr_name == 'Link':
            return None
        elif attr_name == 'Application Specific Information':
            return None
        elif attr_name == 'Contact Information':
            return None
        elif attr_name == 'Last Change Date':
            return None
        else:
            # Since custom attribute names are possible, just return None
            # for unrecognized attributes. This satisfies the spec.
            return None
def _get_attribute_from_managed_object ( self , managed_object , attr_name ) : if attr_name == 'Unique Identifier' : return str ( managed_object . unique_identifier ) elif attr_name == 'Name' : names = list ( ) for name in managed_object . names : name = attributes . Name ( attributes . Name . NameValue ( name ) , attributes . Name . NameType ( enums . NameType . UNINTERPRETED_TEXT_STRING ) ) names . append ( name ) return names elif attr_name == 'Object Type' : return managed_object . _object_type elif attr_name == 'Cryptographic Algorithm' : return managed_object . cryptographic_algorithm elif attr_name == 'Cryptographic Length' : return managed_object . cryptographic_length elif attr_name == 'Cryptographic Parameters' : return None elif attr_name == 'Cryptographic Domain Parameters' : return None elif attr_name == 'Certificate Type' : return managed_object . certificate_type elif attr_name == 'Certificate Length' : return None elif attr_name == 'X.509 Certificate Identifier' : return None elif attr_name == 'X.509 Certificate Subject' : return None elif attr_name == 'X.509 Certificate Issuer' : return None elif attr_name == 'Certificate Identifier' : return None elif attr_name == 'Certificate Subject' : return None elif attr_name == 'Certificate Issuer' : return None elif attr_name == 'Digital Signature Algorithm' : return None elif attr_name == 'Digest' : return None elif attr_name == 'Operation Policy Name' : return managed_object . operation_policy_name elif attr_name == 'Cryptographic Usage Mask' : return managed_object . cryptographic_usage_masks elif attr_name == 'Lease Time' : return None elif attr_name == 'Usage Limits' : return None elif attr_name == 'State' : return managed_object . state elif attr_name == 'Initial Date' : return managed_object . initial_date elif attr_name == 'Activation Date' : return None elif attr_name == 'Process Start Date' : return None elif attr_name == 'Protect Stop Date' : return None elif attr_name == 'Deactivation Date' : return None elif attr_name == 'Destroy Date' : return None elif attr_name == 'Compromise Occurrence Date' : return None elif attr_name == 'Compromise Date' : return None elif attr_name == 'Revocation Reason' : return None elif attr_name == 'Archive Date' : return None elif attr_name == 'Object Group' : return None elif attr_name == 'Fresh' : return None elif attr_name == 'Link' : return None elif attr_name == 'Application Specific Information' : return None elif attr_name == 'Contact Information' : return None elif attr_name == 'Last Change Date' : return None else : # Since custom attribute names are possible, just return None # for unrecognized attributes. This satisfies the spec. return None
Get the attribute value from the kmip.pie managed object.
Get the attribute value from the kmip . pie managed object .