Examples of UsmUser


Examples of org.snmp4j.security.UsmUser

    }
  }

  protected void addUsmUser(USM usm)
  {
     UsmUser user = new UsmUser(new OctetString("SHADES"),
                 AuthSHA.ID,
                 new OctetString("SHADESAuthPassword"),
                 PrivDES.ID,
                 new OctetString("SHADESPrivPassword"));
    usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
    user = new UsmUser(new OctetString("TEST"),
                     AuthSHA.ID,
                     new OctetString("maplesyrup"),
                     PrivDES.ID,
                     new OctetString("maplesyrup"));
    usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
    user = new UsmUser(new OctetString("SHA"),
                     AuthSHA.ID,
                     new OctetString("SHAAuthPassword"),
                     null,
                     null);
    usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
  }
View Full Code Here

Examples of org.snmp4j.security.UsmUser

            SecurityProtocols sec = SecurityProtocols.getInstance();
            ((MPv3)snmp.getMessageProcessingModel(MPv3.ID)).setLocalEngineID(localEngineID.getValue());
            USM usm = new USM(sec, localEngineID, 0);
            SecurityModels.getInstance().addSecurityModel(usm);
            UsmUser user = new UsmUser(new OctetString(security_name),
                                           auth,
                                           new OctetString(auth_passphrase),
                                           priv,
                                           new OctetString(privacy_passphrase));
            snmp.getUSM().addUser(user);
View Full Code Here

Examples of org.snmp4j.security.UsmUser

        }
    }

    private void addUsmUser(Snmp snmp) {
        snmp.getUSM().addUser(securityName,
            new UsmUser(securityName, authProtocol, authPassphrase, privProtocol, privPassphrase));
    }
View Full Code Here

Examples of org.snmp4j.security.UsmUser

        }
        else if ("AES256".equals(privP)) {
          privProtocol = PrivAES256.ID;
        }
        OctetString un = createOctetString(sn, null);
        snmp.getUSM().addUser(un, new UsmUser(un,
                                              authProtocol,
                                              createOctetString(authPP, null),
                                              privProtocol,
                                              createOctetString(privPP, null)));
      }
View Full Code Here

Examples of org.snmp4j.security.UsmUser

          new OctetString("public2public").toSubIndex(true), com2sec);
    communityMIB.getSnmpCommunityEntry().addRow(row);
  }

  protected void addUsmUser(USM usm) {
    UsmUser user = new UsmUser(new OctetString("SHADES"),
                               AuthSHA.ID,
                               new OctetString("SHADESAuthPassword"),
                               PrivDES.ID,
                               new OctetString("SHADESPrivPassword"));
    usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
    user = new UsmUser(new OctetString("TEST"),
                               AuthSHA.ID,
                               new OctetString("maplesyrup"),
                               PrivDES.ID,
                               new OctetString("maplesyrup"));
    usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
    user = new UsmUser(new OctetString("SHA"),
                               AuthSHA.ID,
                               new OctetString("SHAAuthPassword"),
                               null,
                               null);
    usm.addUser(user.getSecurityName(), usm.getLocalEngineID(), user);
  }
View Full Code Here

Examples of org.snmp4j.security.UsmUser

    final InetAddress ip = InetAddress.getByName("192.168.0.1");
    this.address = new UdpAddress(ip,
        SnmpConstants.DEFAULT_COMMAND_RESPONDER_PORT);

    final UsmUser usmUser = new UsmUser(V3SECURITYNAME, V3AUTHPROTO,
        V3AUTHPASS, V3PRIVPROTO, V3PRIVPASS);
    this.v1Client = new StandardSNMPv1<UdpAddress>(V1V2COMMUNITY,
        new DefaultUdpTransportMapping());
    this.v2Client = new StandardSNMPv2<UdpAddress>(V1V2COMMUNITY,
        new DefaultUdpTransportMapping());
View Full Code Here

Examples of org.snmp4j.security.UsmUser

    Assert.assertNotNull(response);
    Assert.assertTrue(ResponseEvents.extractBindings(response).containsKey(
        SnmpConstants.sysDescr));

    /* Test an invalid security name */
    final UsmUser invalidUser = new UsmUser(new OctetString("invalidName"),
        V3AUTHPROTO, V3AUTHPASS, V3PRIVPROTO, V3PRIVPASS);
    final SNMPv3<UdpAddress> invalidV3Client = new StandardSNMPv3<UdpAddress>(
        invalidUser, new OctetString(),
        new DefaultUdpTransportMapping());
    response = invalidV3Client
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.