Ejemplo n.º 1
0
  def __init__(self,
               community_string=None,
               snmp_user=None,
               snmp_group=None):

    if community_string:
      community_string_tup = encrypt_string(str.encode(community_string))
      self.community_string_encrypted = community_string_tup[0].decode("utf-8")
      self.community_string_encrypted_salt = community_string_tup[1].decode("utf-8")

    if snmp_user:
      snmp_user_tup = encrypt_string(str.encode(snmp_user))
      self.snmp_user_encrypted = snmp_user_tup[0].decode('utf-8')
      self.snmp_user_encrypted_salt = snmp_user_tup[1].decode('utf-8')

    if snmp_group:
      snmp_group_tup = encrypt_string(str.encode(snmp_group))
      self.snmp_group_encrypted = snmp_group_tup[0].decode('utf-8')
      self.snmp_group_encrypted_salt = snmp_group_tup[1].decode('utf-8')
Ejemplo n.º 2
0
  def __init__(self,
               username=None,
               password=None,
               enable_password=None,
               description=None,
               openvas_lsc_id=None):
    if description:
      self.description = description

    if username:
      self.username = username

    if password:
      password_tup = encrypt_string(str.encode(password))
      self.encrypted_password = password_tup[0].decode("utf-8")
      self.encrypted_password_salt = password_tup[1].decode("utf-8")

    if enable_password:
      enable_password_tup = encrypt_string(str.encode(enable_password))
      self.encrypted_enable_password = enable_password_tup[0].decode('utf-8')
      self.encrypted_enable_password_salt = enable_password_tup[1].decode('utf-8')

    if openvas_lsc_id:
      self.openvas_lsc_id = openvas_lsc_id