[SNMP4J] Need help on USM
Reddy Alok-a22624
alokreddy at motorola.com
Thu Mar 9 07:19:37 CET 2006
Hi Frank,
I got to use SHA and AES128 as auth and priv protocols respectively.
But, the problem is I am generating auth and priv keys separately (using
Diffie Hellman and PBKDF2) and want the USM to use them instead of the
keys generated based on passwords. So, what I have done is I have passed
in some dummy passwords and then once the user is added to the USM, I
tried to put in the auth and priv keys that I generated separately.
Below is the code snippet that I have written to implement the above
said. Can you pls confirm if this procedure is fine (does USM use the
auth and priv keys that I have put in while encryption and
authentication)?
----------------START----------------------------------------
snmp.getUSM ().addUser (new OctetString ("admin"),
new OctetString ("000000A1112233445566"),
// Engine ID
new UsmUser (new OctetString ("admin"),
AuthSHA.ID,
new OctetString ("dummy"),
PrivAES128.ID,
new OctetString ("dummy")));
byte[] authKey = ..... // Auth Key
byte[] privKey = ..... // Priv Key
UsmUserEntry userEntry = snmp.getUSM ().getUser (new OctetString
("000000A1112233445566"), new OctetString (curUser));
userEntry.setAuthenticationKey (authKey);
userEntry.setPrivacyKey (privKey);
----------------END------------------------------------------------
Thanks,
Alok.
More information about the SNMP4J
mailing list