[SNMP4J] Force snmp to use a private key

Frank Fock fock at agentpp.com
Wed Jan 25 09:40:30 CET 2017


Hi,

You can use the following constructor of UsmUserEntry, if you only have 
the keys:
http://www.snmp4j.org/doc/org/snmp4j/security/UsmUserEntry.html#UsmUserEntry(byte[],%20org.snmp4j.smi.OctetString,%20org.snmp4j.smi.OID,%20byte[],%20org.snmp4j.smi.OID,%20byte[])

If you know the passphrase and just want to localize the keys with the 
engineID of the target, then
use:
http://www.snmp4j.org/doc/org/snmp4j/security/UsmUser.html#UsmUser(org.snmp4j.smi.OctetString,%20org.snmp4j.smi.OID,%20org.snmp4j.smi.OctetString,%20org.snmp4j.smi.OID,%20org.snmp4j.smi.OctetString,%20org.snmp4j.smi.OctetString)

Hope this helps.

Best regards,
Frank

Am 24.01.2017 um 10:22 schrieb Maciazek Christophe:
> Hello,
> Until now, I used some linux commands to send snmp requests.
> Using passphrases :
> snmpgetnext -u myUser -n myContextName -v 3 -l authPriv -a SHA -A myAuthPassPhrase -x AES -X myPrivPassPhrase 192.1.1.1 myOid
>
> Directly using local keys for authentification and encryption (no use of the engined id received) :
> snmpget -u myUser -n myContextName -v 3 -l authPriv -a SHA -3k a3f195ebf9390cca7b5cb193e52134852a287c5d -x AES -3K 03cee8d6123ed92b2aa3fba32152c8de 192.1.1.1 myOid
> I have decided to use snmp4j to implement these commands, using snmp4j 2.5.0
>
> No problem for the commands using passphrase. I have found enough exemples to do what I want.
>
> But when I want to implement the second case, I can not understand in which element I have to indicate that I use local keys and that snmp4j has not to calculate keys with the received engined id.
>
> Some help will be usefull please.
> Thank you
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231




More information about the SNMP4J mailing list