/** * Builds target resource. * @param context Process context */ private void buildTargetResource(ProcessContext context) { if((this.transportMapping == null) || !this.transportMapping.isListening() || (this.snmp == null)) { try { this.transportMapping = new DefaultUdpTransportMapping(); this.snmp = new Snmp(this.transportMapping); if("SNMPv3".equals(context.getProperty(SNMP_VERSION).getValue())) { USM usm = new USM(SecurityProtocols.getInstance(), new OctetString(MPv3.createLocalEngineID()), 0); SecurityModels.getInstance().addSecurityModel(usm); } this.transportMapping.listen(); } catch (Exception e) { throw new IllegalStateException("Failed to initialize UDP transport mapping", e); } } if (this.snmpTarget == null) { this.snmpTarget = this.createSnmpTarget(context); } if (this.targetResource == null) { this.targetResource = this.finishBuildingTargetResource(context); } }
new UsmUser( new OctetString( userName ), AuthMD5.ID, new OctetString( passPhrase ), PrivDES.ID, new OctetString( passPhrase ) ); throw new KettleException( "Null Usm" ); } else { usm = new USM( SecurityProtocols.getInstance(), new OctetString( MPv3.createLocalEngineID() ), 0 ); usm.addUser( new OctetString( userName ), uu ); if ( log.isDebug() ) { logDebug( "Valid Usm" );
/** * Initializes a new set of default security protocols. */ private DefaultSecurityProtocols(){ addAuthenticationProtocol(new AuthMD5()); addAuthenticationProtocol(new AuthSHA()); addPrivacyProtocol(new Priv3DES()); addPrivacyProtocol(new PrivDES()); addPrivacyProtocol(new PrivAES128()); addPrivacyProtocol(new PrivAES192()); addPrivacyProtocol(new PrivAES256()); }
public UsmUserKey(UsmUserEntry entry) { setEngineID(entry.getEngineID()); this.securityName = entry.getUsmUser().getSecurityName(); }
public UsmTimeEntry getLocalTime() { UsmTimeEntry entry = new UsmTimeEntry(localTime.getEngineID(), localTime.getEngineBoots(), getEngineTime()); entry.setTimeDiff(entry.getTimeDiff() * ( -1) + localTime.getTimeDiff()); return entry; }
public Priv3DES() { super.initVectorLength = INIT_VECTOR_LENGTH; super.protocolId = PROTOCOL_ID; super.protocolClass = PROTOCOL_CLASS; super.keyBytes = KEY_LENGTH; this.salt = Salt.getInstance(); cipherPool = new CipherPool(); }
public String toString() { return "UsmUser[secName="+securityName+ ",authProtocol="+authenticationProtocol+ ",authPassphrase="+authenticationPassphrase+ ",privProtocol="+privacyProtocol+ ",privPassphrase="+privacyPassphrase+ ",localizationEngineID="+getLocalizationEngineID()+"]"; }
public void clearUsers() { if (m_usm != null) { m_usm.removeAllUsers(); } }
public int getAuthParametersPosition() { if (authParametersPosition >= 0) { return authParametersPosition; } else { return getBEREncodedAuthParamsPosition(); } }
/** * The number of times that the SNMP engine has (re-)initialized itself * since snmpEngineID was last configured. * @return * the number of SNMP engine reboots. */ public int getEngineBoots() { return localTime.getEngineBoots(); }
/** * Removes the specified engine ID from the internal time cache and thus * forces an engine time rediscovery the next time the SNMP engine with * the supplied ID is contacted. * * @param engineID * the SNMP engine ID whose engine time to remove. * @since 1.6 */ public void removeEngineTime(OctetString engineID) { timeTable.removeEntry(engineID); }
/** * Get a initialized Salt object. * * @return the Salt object */ public static Salt getInstance() { if (instance == null) { instance = new Salt(); } return instance; }
public UsmUserKey(UsmUserEntry entry) { setEngineID(entry.getEngineID()); this.securityName = entry.getUsmUser().getSecurityName(); }
public UsmTimeEntry getLocalTime() { UsmTimeEntry entry = new UsmTimeEntry(localTime.getEngineID(), localTime.getEngineBoots(), getEngineTime()); entry.setTimeDiff(entry.getTimeDiff() * ( -1) + localTime.getTimeDiff()); return entry; }
public PrivDES() { super.initVectorLength = INIT_VECTOR_LENGTH; super.protocolId = PROTOCOL_ID; super.protocolClass = PROTOCOL_CLASS; super.keyBytes = KEY_LENGTH; this.salt = Salt.getInstance(); cipherPool = new CipherPool(); }
public UsmUserKey(UsmUserEntry entry) { setEngineID(entry.getEngineID()); this.securityName = entry.getUsmUser().getSecurityName(); }
public UsmTimeEntry getLocalTime() { UsmTimeEntry entry = new UsmTimeEntry(localTime.getEngineID(), localTime.getEngineBoots(), getEngineTime()); entry.setTimeDiff(entry.getTimeDiff() * ( -1) + localTime.getTimeDiff()); return entry; }
public Priv3DES() { super.initVectorLength = INIT_VECTOR_LENGTH; super.protocolId = PROTOCOL_ID; super.protocolClass = PROTOCOL_CLASS; super.keyBytes = KEY_LENGTH; this.salt = Salt.getInstance(); cipherPool = new CipherPool(); }
public PrivDES() { super.initVectorLength = INIT_VECTOR_LENGTH; super.protocolId = PROTOCOL_ID; super.protocolClass = PROTOCOL_CLASS; super.keyBytes = KEY_LENGTH; this.salt = Salt.getInstance(); cipherPool = new CipherPool(); }