Exemple #1
0
 public byte[] getContextEngineId() {
   String param = getContextEngineIdStr();
   byte[] engineId = new byte[0];
   if (param != null) {
     engineId = SnmpUtilities.toBytes(param);
   }
   return engineId;
 }
 /**
  * Returns a string representation of the object.
  *
  * @return The string
  */
 public String toString() {
   StringBuffer buffer = new StringBuffer("SnmpContextv3[");
   buffer.append("host=").append(hostAddr);
   buffer.append(", port=").append(hostPort);
   buffer.append(", socketType=").append(typeSocket);
   buffer.append(", contextEngineId=").append(SnmpUtilities.toHexString(contextEngineId));
   buffer.append(", contextName=").append(contextName);
   buffer.append(", userName="******", useAuthentication=").append(useAuthentication);
   buffer.append(", authenticationProtocol=").append(ProtocolNames[authenticationProtocol]);
   buffer.append(", userAuthenticationPassword="******", usePrivacy=").append(usePrivacy);
   buffer.append(", userPrivacyPassword="******"]");
   return buffer.toString();
 }
 byte[] getPrivacyPasswordKeySHA1() {
   if (userPrivKeySHA1 == null) {
     userPrivKeySHA1 = SnmpUtilities.passwordToKeySHA1(userPrivacyPassword);
   }
   return userPrivKeySHA1;
 }
 byte[] getPrivacyPasswordKeyMD5() {
   if (userPrivKeyMD5 == null) {
     userPrivKeyMD5 = SnmpUtilities.passwordToKeyMD5(userPrivacyPassword);
   }
   return userPrivKeyMD5;
 }
 byte[] getAuthenticationPasswordKeySHA1() {
   if (userAuthKeySHA1 == null) {
     userAuthKeySHA1 = SnmpUtilities.passwordToKeySHA1(userAuthenticationPassword);
   }
   return userAuthKeySHA1;
 }
 byte[] getAuthenticationPasswordKeyMD5() {
   if (userAuthKeyMD5 == null) {
     userAuthKeyMD5 = SnmpUtilities.passwordToKeyMD5(userAuthenticationPassword);
   }
   return userAuthKeyMD5;
 }