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; }
OctetString privKey = (OctetString)row.getValue(colUsmUserPrivKey); usm.addLocalizedUser(idxValues[0].getValue(), idxValues[1], row.getAuthProtocolOID(row),
OctetString privKey = (OctetString)row.getValue(colUsmUserPrivKey); usm.addLocalizedUser(idxValues[0].getValue(), idxValues[1], row.getAuthProtocolOID(row),
entry = addLocalizedUser(engineID.getValue(), securityName, authProtocolOID, authKey, privProtocolOID, privKey);
entry = addLocalizedUser(engineID.getValue(), securityName, authProtocolOID, authKey, privProtocolOID, privKey);