new UsmUser( new OctetString( userName ), AuthMD5.ID, new OctetString( passPhrase ), PrivDES.ID, new OctetString( passPhrase ) );
new UsmUser(new OctetString(username), SNMPUtils.getAuth(authProtocol), aPwd, SNMPUtils.getPriv(privProtocol), pPwd));
public Object clone() { UsmUser copy = new UsmUser(this.securityName, this.authenticationProtocol, this.authenticationPassphrase, this.privacyProtocol, this.privacyPassphrase, this.localizationEngineID); return copy; }
public Object clone() { UsmUser copy = new UsmUser(this.securityName, this.authenticationProtocol, this.authenticationPassphrase, this.privacyProtocol, this.privacyPassphrase, this.localizationEngineID); return copy; }
public Object clone() { UsmUser copy = new UsmUser(this.securityName, this.authenticationProtocol, this.authenticationPassphrase, this.privacyProtocol, this.privacyPassphrase, this.localizationEngineID); return copy; }
private UsmUser getUsmUser(Profile profile) { OID authenticationProtocol = null; OctetString authenticationPassphrase = null; OID privacyProtocol = null; OctetString privacyPassphrase = null; switch(profile.securityLevel) { case SecurityLevel.AUTH_NOPRIV: authenticationProtocol = profile.authProtocol; authenticationPassphrase = profile.authPassphrase; break; case SecurityLevel.AUTH_PRIV: authenticationProtocol = profile.authProtocol; authenticationPassphrase = profile.authPassphrase; privacyProtocol = profile.privProtocol; privacyPassphrase = profile.privacyPassphrase; break; } return new UsmUser(profile.username, authenticationProtocol, authenticationPassphrase, privacyProtocol, privacyPassphrase); }
private void addUsmUser(Snmp snmp) { snmp.getUSM().addUser(securityName, new UsmUser(securityName, authProtocol, authPassphrase, privProtocol, privPassphrase)); }
private void addUsmUser(Snmp snmp) { snmp.getUSM().addUser(securityName, new UsmUser(securityName, authProtocol, authPassphrase, privProtocol, privPassphrase)); }
private void addUsmUser(Snmp snmp) { snmp.getUSM().addUser(securityName, new UsmUser(securityName, authProtocol, authPassphrase, privProtocol, privPassphrase)); }
private UsmUser createUser() { OID privacyOID = null; OctetString privacyPasswd = null; if (securityMethod == SecurityLevel.AUTH_PRIV) { final String privacyProtocolUpper = privacyProtocol.toUpperCase(Locale.ENGLISH); if ("PRIVDES".equals(privacyProtocolUpper)) { privacyOID = PrivDES.ID; } else if ("PRIV3DES".equals(privacyProtocolUpper)) { privacyOID = Priv3DES.ID; } else if ("PRIVAES128".equals(privacyProtocolUpper)) { privacyOID = PrivAES128.ID; } else if ("PRIVAES192".equals(privacyProtocolUpper)) { privacyOID = PrivAES192.ID; } else if ("PRIVAES256".equals(privacyProtocolUpper)) { privacyOID = PrivAES256.ID; } else if ("PRIVAES192WITH3DESKEYEXTENSION".equals(privacyProtocolUpper)) { privacyOID = PrivAES192With3DESKeyExtension.ID; } else if ("PRIVAES256WITH3DESKEYEXTENSION".equals(privacyProtocolUpper)) { privacyOID = PrivAES256With3DESKeyExtension.ID; } else { log.debug("Privacy protocol " + privacyProtocolUpper + " unsupported or invalid."); } privacyPasswd = new OctetString(privacyPassword); } return new UsmUser(new OctetString(username), authMethod, new OctetString(password), privacyOID, privacyPasswd); }
/** * Creates a new user entry with empty engine ID and empty user. */ public UsmUserEntry() { engineID = new OctetString(); userName = new OctetString(); usmUser = new UsmUser(new OctetString(), null, null, null, null); }
/** * Creates a new user entry with empty engine ID and empty user. */ public UsmUserEntry() { engineID = new OctetString(); userName = new OctetString(); usmUser = new UsmUser(new OctetString(), null, null, null, null); }
/** * Creates a new user entry with empty engine ID and empty user. */ public UsmUserEntry() { engineID = new OctetString(); userName = new OctetString(); usmUser = new UsmUser(new OctetString(), null, null, null, null); }
/** * Creates a localized user entry. * @param engineID * the engine ID for which the users has bee localized. * @param securityName * the user and security name of the new entry. * @param authProtocol * the authentication protocol ID. * @param authKey * the authentication key. * @param privProtocol * the privacy protocol ID. * @param privKey * the privacy key. */ public UsmUserEntry(byte[] engineID, OctetString securityName, OID authProtocol, byte[] authKey, OID privProtocol, byte[] privKey) { this.engineID = (engineID == null) ? null : new OctetString(engineID); this.userName = securityName; this.authenticationKey = authKey; this.privacyKey = privKey; this.usmUser = new UsmUser(userName, authProtocol, ((authenticationKey != null) ? new OctetString(authenticationKey) : null), privProtocol, ((privacyKey != null) ? new OctetString(privacyKey) : null), this.engineID); }
/** * Adds all the necessary initial users to the USM. * * @param usm the USM instance used by this agent. */ @Override protected void addUsmUser(USM usm) { if (securityName == null || securityName.equals("")) { logger.info("No security name."); return; } UsmUser user = new UsmUser( new OctetString(securityName), AUTHENTICATION_PROTOCOL, new OctetString(AUTHENTICATION_PASSWORD), PRIVACY_PROTOCOL, new OctetString(PRIVACY_PASSWORD) ); usm.addUser(user.getSecurityName(), null, user); }
new UsmUser(new OctetString(ver3Username), null, null, null, null)); new UsmUser(new OctetString(ver3Username), authenticationProtocolOID, new OctetString(ver3AuthPasscode), null, null)); new UsmUser(new OctetString(ver3Username), authenticationProtocolOID, new OctetString(ver3AuthPasscode), privacyProtocolOID, new OctetString(privacyProtocolPassShare)));
User user = userIt.next(); UsmUser usmUser = new UsmUser(new OctetString(user.getSecurityName()), user.getAuthenticationProtocolID(), new OctetString(user.getAuthenticationPassphrase()),
/** {@inheritDoc} */ @Override 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("opennmsUser"), AuthMD5.ID, new OctetString("0p3nNMSv3"), PrivDES.ID, new OctetString("0p3nNMSv3")); 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); }
/** {@inheritDoc} */ @Override 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("opennmsUser"), AuthMD5.ID, new OctetString("0p3nNMSv3"), PrivDES.ID, new OctetString("0p3nNMSv3")); 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); }
public Snmp createSnmpSession() throws IOException { final TransportMapping<?> transport = new DefaultUdpTransportMapping(); final MessageDispatcher disp = new MessageDispatcherImpl(); final Snmp session; // Here we create the SNMP session, while only adding the message processing // models we need for the specific agent if (!isSnmpV3()) { disp.addMessageProcessingModel(new MPv1()); disp.addMessageProcessingModel(new MPv2c()); session = new Snmp(disp, transport); } else { // Make a new USM final USM usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0); // Add the specified user to the USM usm.addUser( getSecurityName(), new UsmUser( getSecurityName(), getAuthProtocol(), getAuthPassPhrase(), getPrivProtocol(), getPrivPassPhrase() ) ); disp.addMessageProcessingModel(new MPv3(usm)); session = new Snmp(disp, transport); } return session; }