def encryption_key_set(enctype, password)
      password = Utils.add_quotes(password)
      # if enctype is TACACS_SERVER_ENC_UNKNOWN, we will unset the key
      if enctype == TACACS_SERVER_ENC_UNKNOWN
        # if current encryption type is not TACACS_SERVER_ENC_UNKNOWN, we
        # need to unset it. Otherwise the box is not configured with key, we
        # don't need to do anything
        if encryption_type != TACACS_SERVER_ENC_UNKNOWN
          config_set('tacacs_server', 'encryption', state:  'no',
                                                    option: encryption_type,
                                                    key:    encryption_password)
        end
      else
        config_set('tacacs_server', 'encryption', state: '', option: enctype,
                    key: password)
      end
    end
def encryption_key_set(enctype, password)
      password = Utils.add_quotes(password)
      # if enctype is TACACS_SERVER_ENC_UNKNOWN, we will unset the key
      if enctype == TACACS_SERVER_ENC_UNKNOWN
        # if current encryption type is not TACACS_SERVER_ENC_UNKNOWN, we
        # need to unset it. Otherwise the box is not configured with key, we
        # don't need to do anything
        if encryption_type != TACACS_SERVER_ENC_UNKNOWN
          config_set('tacacs_server', 'encryption', state:  'no',
                                                    option: encryption_type,
                                                    key:    encryption_password)
        end
      else
        config_set('tacacs_server', 'encryption', state: '', option: enctype,
                    key: password)
      end
    end
Set encryption type and password