Setter method for key_algorithm, mapped from YANG variable /keychain/key/key_algorithm (key_algo)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_key_algorithm is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_key_algorithm() directly.

def _set_key_algorithm(self, v, load=False):
    """
    Setter method for key_algorithm, mapped from YANG variable /keychain/key/key_algorithm (key_algo)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_key_algorithm is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_key_algorithm() directly.
    """
    if hasattr(v, "_utype"):
      v = v._utype(v)
    try:
      t = YANGDynClass(v,base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'HMAC-SHA-256': {'value': 1}, u'HMAC-SHA-512': {'value': 3}, u'HMAC-SHA-1': {'value': 0}, u'HMAC-SHA-384': {'value': 2}},), is_leaf=True, yang_name="key-algorithm", rest_name="key-algorithm", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'info': u'specify HMAC algorithm for the key', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-keychain', defining_module='brocade-keychain', yang_type='key_algo', is_config=True)
    except (TypeError, ValueError):
      raise ValueError({
          'error-string': """key_algorithm must be of a type compatible with key_algo""",
          'defined-type': "brocade-keychain:key_algo",
          'generated-type': """YANGDynClass(base=RestrictedClassType(base_type=unicode,                                     restriction_type="dict_key",                                     restriction_arg={u'HMAC-SHA-256': {'value': 1}, u'HMAC-SHA-512': {'value': 3}, u'HMAC-SHA-1': {'value': 0}, u'HMAC-SHA-384': {'value': 2}},), is_leaf=True, yang_name="key-algorithm", rest_name="key-algorithm", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'cli-full-command': None, u'info': u'specify HMAC algorithm for the key', u'cli-full-no': None}}, namespace='urn:brocade.com:mgmt:brocade-keychain', defining_module='brocade-keychain', yang_type='key_algo', is_config=True)""",
        })

    self.__key_algorithm = t
    if hasattr(self, '_set'):
      self._set()