예제 #1
0
파일: Util.java 프로젝트: bartoszm/snmp123
 public byte[] getContextEngineId() {
   String param = getContextEngineIdStr();
   byte[] engineId = new byte[0];
   if (param != null) {
     engineId = SnmpUtilities.toBytes(param);
   }
   return engineId;
 }
예제 #2
0
 /**
  * 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();
 }
예제 #3
0
 byte[] getPrivacyPasswordKeySHA1() {
   if (userPrivKeySHA1 == null) {
     userPrivKeySHA1 = SnmpUtilities.passwordToKeySHA1(userPrivacyPassword);
   }
   return userPrivKeySHA1;
 }
예제 #4
0
 byte[] getPrivacyPasswordKeyMD5() {
   if (userPrivKeyMD5 == null) {
     userPrivKeyMD5 = SnmpUtilities.passwordToKeyMD5(userPrivacyPassword);
   }
   return userPrivKeyMD5;
 }
예제 #5
0
 byte[] getAuthenticationPasswordKeySHA1() {
   if (userAuthKeySHA1 == null) {
     userAuthKeySHA1 = SnmpUtilities.passwordToKeySHA1(userAuthenticationPassword);
   }
   return userAuthKeySHA1;
 }
예제 #6
0
 byte[] getAuthenticationPasswordKeyMD5() {
   if (userAuthKeyMD5 == null) {
     userAuthKeyMD5 = SnmpUtilities.passwordToKeyMD5(userAuthenticationPassword);
   }
   return userAuthKeyMD5;
 }