| java.lang.Object org.snmp4j.security.SecurityProtocols
SecurityProtocols | public class SecurityProtocols implements Serializable(Code) | | The SecurityProtocols class holds all authentication and
privacy protocols for a SNMP entity.
To register security protocols other than the default, set the system
property
SecurityProtocols.SECURITY_PROTOCOLS_PROPERTIES to a customized version
of the SecurityProtocols.properties file. The path has to
be specified relatively to this class.
author: Jochen Katz & Frank Fock version: 1.9 |
SECURITY_PROTOCOLS_PROPERTIES | final public static String SECURITY_PROTOCOLS_PROPERTIES(Code) | | |
SecurityProtocols | protected SecurityProtocols()(Code) | | |
addAuthenticationProtocol | public synchronized void addAuthenticationProtocol(AuthenticationProtocol auth)(Code) | | Add the given
AuthenticationProtocol . If an authentication protocol
with the supplied ID already exists, the supplied authentication protocol
will not be added and the security protocols will not be unchang.
Parameters: auth - the AuthenticationProtocol to add (an existing authentication protcolwith auth 's ID remains unchanged). |
addDefaultProtocols | public synchronized void addDefaultProtocols()(Code) | | Add the default SecurityProtocols.
The names of the SecurityProtocols to add are read from a
properties file.
throws: InternalError - if the properties file cannot be opened/read. |
addPrivacyProtocol | public synchronized void addPrivacyProtocol(PrivacyProtocol priv)(Code) | | Add the given
PrivacyProtocol . If a privacy protocol
with the supplied ID already exists, the supplied privacy protocol
will not be added and the security protocols will not be changed.
Parameters: priv - the PrivacyProtocol to add (an existing privacy protcolwith priv 's ID remains unchanged). |
getAuthenticationProtocol | public AuthenticationProtocol getAuthenticationProtocol(OID id)(Code) | | Get the
AuthenticationProtocol with the given ID.
Parameters: id - The unique ID (specified as OID) of the AuthenticationProtocol.the AuthenticationProtocol object if it was added before,or null if not. |
getInstance | public static SecurityProtocols getInstance()(Code) | | Get an instance of class SecurityProtocols.
the globally used SecurityProtocols object. |
getMaxAuthDigestLength | public int getMaxAuthDigestLength()(Code) | | Gets the maximum authentication key length of the all known
authentication protocols.
the maximum authentication key length of all authentication protocolsthat have been added to this SecurityProtocols instance. |
getMaxPrivDecryptParamsLength | public int getMaxPrivDecryptParamsLength()(Code) | | Gets the maximum privacy key length of the currently known
privacy protocols.
the maximum privacy key length of all privacy protocolsthat have been added to this SecurityProtocols instance. |
getPrivacyProtocol | public PrivacyProtocol getPrivacyProtocol(OID id)(Code) | | Get the PrivacyProtocol with the given ID.
Parameters: id - The unique ID (specified as OID) of the PrivacyProtocol.the PrivacyProtocol object if it was added before,or null if not. |
passwordToKey | public byte[] passwordToKey(OID authProtocolID, OctetString passwordString, byte[] engineID)(Code) | | Generates the localized key for the given password and engine id for the
authentication protocol specified by the supplied OID.
Parameters: authProtocolID - an OID identifying the authentication protocol touse. Parameters: passwordString - the authentication pass phrase. Parameters: engineID - the engine ID of the authoritative engine.the localized authentication key. |
passwordToKey | public byte[] passwordToKey(OID privProtocolID, OID authProtocolID, OctetString passwordString, byte[] engineID)(Code) | | Generates the localized key for the given password and engine id for the
privacy protocol specified by the supplied OID.
Parameters: privProtocolID - an OID identifying the privacy protocol the key shouldbe created for. Parameters: authProtocolID - an OID identifying the authentication protocol to use. Parameters: passwordString - the authentication pass phrase. Parameters: engineID - the engine ID of the authoritative engine.the localized privacy key. |
setSecurityProtocols | public static void setSecurityProtocols(SecurityProtocols securityProtocols)(Code) | | Set the SecurityProtocols
Parameters: securityProtocols - SecurityProtocols |
truncateKey | public byte[] truncateKey(byte[] key, int maxKeyLength)(Code) | | Limits the supplied key value to the specified maximum length
Parameters: key - the key to truncate. Parameters: maxKeyLength - the maximum length of the returned key.the truncated key with a length ofmin(key.length, maxKeyLength) . since: 1.9 |
|
|