[SNMP4J] null in authPassPhrase..even though initialized user to "authUser"
Frank Fock
fock at agentpp.com
Fri May 12 01:25:03 CEST 2006
Hi Rajesh,
The behavior is intended. The returned UsmUserEntry
represents a localized user. Therefore the contained
UsmUser class does not contain any passphrases.
Why do you think that you need any help here?
In other words, what are you trying to accomplish?
Best regards,
Frank
Rajesh Reddy wrote:
> Hi,
>
> I am getting null while displaying the UsmUSer object in the authPassPhrase
> and PrivPassPhrase..
>
> please see the sample code
>
> TransportMapping transport = new DefaultUdpTransportMapping();
> Snmp snmp = new Snmp(transport);
> byte[] b=MPv3.createLocalEngineID();
> MPv3 mpv3 =
> (MPv3)snmp.getMessageProcessingModel(MessageProcessingModel.MPv3);
>
> USM usm = new USM(mpv3.getSecurityProtocols().getInstance(),
> new OctetString(b), 1);
>
> SecurityModels.getInstance().addSecurityModel(usm);
>
> UsmUser user1=new UsmUser(new OctetString("privUser"),
> AuthMD5.ID,
> new OctetString("authUser".getBytes()),
> PrivDES.ID,
> new OctetString("privUser")
> );
>
> System.out.println("passphrase:"+user1.getPrivacyPassphrase());
> //////Output:passphrase:privUser
>
> snmp.getUSM().addUser(new OctetString("privUser"),user1);
> System.out.println(snmp.getUSM().getUser(new OctetString(b),new
> OctetString("privUser")));
> /////Output:
> UsmUserEntry[userName=privUser,usmUser=UsmUser[secName=privUser,authProtocol
> =1.3.6.1.6.3.10.1.1.2,authPassphrase=null,privProtocol=1.3.6.1.6.3.10.1.2.2,
> privPassphrase=null]]
>
> UsmUserEntry user=snmp.getUSM().getUser(new OctetString(b),new
> OctetString("privUser"));
>
> UsmUser user2=user.getUsmUser();
> System.out.println("pass:"+user2.getPrivacyPassphrase()); /////////Output
> is : pass:null
>
>
> Help me to get out of it
> Thanks in Advance
>
> regards,
> Rajesh.
>
>
> ------------------------------------------------------------------------
>
> The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s)and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender or administrator at tataelxsi.co.in
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j
--
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com
More information about the SNMP4J
mailing list