/** * Creates a user with user name and associated {@link UsmUser}. * @param userName * the user name of the new entry. * @param user * the <code>UsmUser</code> representing the security information of the * user. */ public UsmUserEntry(OctetString userName, UsmUser user) { this.userName = userName; this.usmUser = user; if (user.isLocalized()) { if ((user.getAuthenticationProtocol() != null) && (user.getAuthenticationPassphrase() != null)) { authenticationKey = user.getAuthenticationPassphrase().getValue(); if ((user.getPrivacyProtocol() != null) && (user.getPrivacyPassphrase() != null)) { privacyKey = user.getPrivacyPassphrase().getValue(); } } } }
/** * Creates a user with user name and associated {@link UsmUser}. * @param userName * the user name of the new entry. * @param user * the <code>UsmUser</code> representing the security information of the * user. */ public UsmUserEntry(OctetString userName, UsmUser user) { this.userName = userName; this.usmUser = user; if (user.isLocalized()) { this.engineID = user.getLocalizationEngineID(); if ((user.getAuthenticationProtocol() != null) && (user.getAuthenticationPassphrase() != null)) { authenticationKey = user.getAuthenticationPassphrase().getValue(); if ((user.getPrivacyProtocol() != null) && (user.getPrivacyPassphrase() != null)) { privacyKey = user.getPrivacyPassphrase().getValue(); } } } }
/** * Creates a user with user name and associated {@link UsmUser}. * @param userName * the user name of the new entry. * @param user * the <code>UsmUser</code> representing the security information of the * user. */ public UsmUserEntry(OctetString userName, UsmUser user) { this.userName = userName; this.usmUser = user; if (user.isLocalized()) { this.engineID = user.getLocalizationEngineID(); if ((user.getAuthenticationProtocol() != null) && (user.getAuthenticationPassphrase() != null)) { authenticationKey = user.getAuthenticationPassphrase().getValue(); if ((user.getPrivacyProtocol() != null) && (user.getPrivacyPassphrase() != null)) { privacyKey = user.getPrivacyPassphrase().getValue(); } } } }
protected UsmUserEntry addLocalizedUsmUserEntry(OctetString engineID, OctetString securityName, UsmUserEntry entry) { OID authProtocolOID = entry.getUsmUser().getAuthenticationProtocol(); OID privProtocolOID = entry.getUsmUser().getPrivacyProtocol(); if (authProtocolOID != null) { byte[] authKey; if (entry.getUsmUser().isLocalized()) { authKey = entry.getUsmUser().getAuthenticationPassphrase().getValue(); } else { authKey = securityProtocols.passwordToKey(authProtocolOID, entry.getUsmUser().getAuthenticationPassphrase(), engineID.getValue()); } byte[] privKey = null; if (privProtocolOID != null) { if (entry.getUsmUser().isLocalized()) { privKey = entry.getUsmUser().getPrivacyPassphrase().getValue(); } else { privKey = securityProtocols.passwordToKey(privProtocolOID, authProtocolOID, entry.getUsmUser().getPrivacyPassphrase(), engineID.getValue()); } } entry = addLocalizedUser(engineID.getValue(), securityName, authProtocolOID, authKey, privProtocolOID, privKey); } return entry; }
authKey = user.getAuthenticationPassphrase().getValue(); } else { authKey = securityProtocols.passwordToKey(user.getAuthenticationProtocol(), user.getAuthenticationPassphrase(), engineID.getValue());
if (user.getAuthenticationProtocol() != null) { if (user.isLocalized()) { authKey = user.getAuthenticationPassphrase().getValue(); user.getAuthenticationPassphrase(), engineID.getValue());
authKey = user.getAuthenticationPassphrase().getValue(); user.getAuthenticationPassphrase(), engineID.getValue());
case colUsmUserAuthPassword: setValue(column, userEntry.getUsmUser().getAuthenticationPassphrase()); break; case colUsmUserPrivPassword:
case colUsmUserAuthPassword: setValue(column, userEntry.getUsmUser().getAuthenticationPassphrase()); break; case colUsmUserPrivPassword:
private Variable[] getValuesFromUsmUser(UsmUserEntry user) { Variable[] row = new Variable[usmUserEntry.getColumnCount()+5]; int n = 0; row[n++] = user.getUsmUser().getSecurityName(); row[n++] = null; row[n++] = user.getUsmUser().getAuthenticationProtocol(); row[n++] = null; row[n++] = null; row[n++] = user.getUsmUser().getPrivacyProtocol(); row[n++] = null; row[n++] = null; row[n++] = new OctetString(); row[n++] = new Integer32(StorageType.nonVolatile); row[n++] = new Integer32(RowStatus.active); row[n++] = user.getUsmUser().getAuthenticationPassphrase(); row[n++] = user.getUsmUser().getPrivacyPassphrase(); row[n++] = user.getUsmUser().getLocalizationEngineID(); row[n++] = (user.getAuthenticationKey() == null) ? null : new OctetString(user.getAuthenticationKey()); row[n++] = (user.getPrivacyKey() == null) ? null : new OctetString(user.getPrivacyKey()); return row; }
private Variable[] getValuesFromUsmUser(UsmUserEntry user) { Variable[] row = new Variable[usmUserEntry.getColumnCount()+5]; int n = 0; row[n++] = user.getUsmUser().getSecurityName(); row[n++] = null; row[n++] = user.getUsmUser().getAuthenticationProtocol(); row[n++] = null; row[n++] = null; row[n++] = user.getUsmUser().getPrivacyProtocol(); row[n++] = null; row[n++] = null; row[n++] = new OctetString(); row[n++] = new Integer32(user.getStorageType().getSmiValue()); row[n++] = new Integer32(RowStatus.active); row[n++] = user.getUsmUser().getAuthenticationPassphrase(); row[n++] = user.getUsmUser().getPrivacyPassphrase(); row[n++] = user.getUsmUser().getLocalizationEngineID(); row[n++] = (user.getAuthenticationKey() == null) ? null : new OctetString(user.getAuthenticationKey()); row[n ] = (user.getPrivacyKey() == null) ? null : new OctetString(user.getPrivacyKey()); return row; }
if (entry.getUsmUser().isLocalized()) { authKey = entry.getUsmUser().getAuthenticationPassphrase().getValue(); entry.getUsmUser().getAuthenticationPassphrase(), engineID.getValue());
if (entry.getUsmUser().isLocalized()) { authKey = entry.getUsmUser().getAuthenticationPassphrase().getValue(); entry.getUsmUser().getAuthenticationPassphrase(), engineID.getValue());
row.setValue(colUsmUserAuthProtocol, user.getAuthenticationProtocol()); row.setValue(colUsmUserPrivProtocol, user.getPrivacyProtocol()); row.setValue(colUsmUserAuthPassword, user.getAuthenticationPassphrase()); row.setValue(colUsmUserPrivPassword, user.getPrivacyPassphrase()); row.setValue(colUsmUserLocalizationEngineID, user.getLocalizationEngineID());