| org.snmp4j.security.AuthenticationProtocol
All known Subclasses: org.snmp4j.security.AuthGeneric,
AuthenticationProtocol | public interface AuthenticationProtocol extends SecurityProtocol(Code) | | The AuthenticationProtocol interface defines a common
interface for all SNMP authentication protocols.
author: Frank Fock version: 1.0 |
Method Summary | |
boolean | authenticate(byte[] authenticationKey, byte[] message, int messageOffset, int messageLength, ByteArrayWindow digest) Authenticates an outgoing message.
This method fills the authentication parameters field of the
given message. | byte[] | changeDelta(byte[] oldKey, byte[] newKey, byte[] random) Computes the delta digest needed to remotely change an user's
authenitcation key. | int | getDigestLength() Gets the length of the digest generated by this authentication protocol. | OID | getID() Gets the OID uniquely identifying the authentication protocol. | byte[] | hash(byte[] data) Generates a hash value for the given data. | byte[] | hash(byte[] data, int offset, int length) Generates a hash value for the given data. | boolean | isAuthentic(byte[] authenticationKey, byte[] message, int messageOffset, int messageLength, ByteArrayWindow digest) Authenticates an incoming message. | byte[] | passwordToKey(OctetString passwordString, byte[] engineID) Generates the localized key for the given password and engine id. |
MESSAGE_AUTHENTICATION_CODE_LENGTH | int MESSAGE_AUTHENTICATION_CODE_LENGTH(Code) | | |
authenticate | boolean authenticate(byte[] authenticationKey, byte[] message, int messageOffset, int messageLength, ByteArrayWindow digest)(Code) | | Authenticates an outgoing message.
This method fills the authentication parameters field of the
given message. The parameter digestOffset offset is pointing
inside the message buffer and must be zeroed before the authentication
value is computed.
Parameters: authenticationKey - the authentication key to be used for authenticating the message. Parameters: message - the entire message for which the digest should be determined. Parameters: messageOffset - the offset in message where the message actually starts. Parameters: messageLength - the actual message length (may be smaller thanmessage.length ). Parameters: digest - the offset in message where to store the digest.true if the message digest has been successfully computedand set, false otherwise. |
changeDelta | byte[] changeDelta(byte[] oldKey, byte[] newKey, byte[] random)(Code) | | Computes the delta digest needed to remotely change an user's
authenitcation key. The length of the old key (e.g. 16 for MD5,
20 for SHA) must match the length of the new key.
Parameters: oldKey - the old authentication/privacy key. Parameters: newKey - the new authentication/privacy key. Parameters: random - the random 'seed' to be used to produce the digest.the byte array representing the delta for key change operations.To obtain the key change value, append this delta to therandom array. |
getDigestLength | int getDigestLength()(Code) | | Gets the length of the digest generated by this authentication protocol.
This value can be used to compute the BER encoded length of the security
parameters for authentication.
the number of bytes of digests generated by this authenticationprocotol. |
getID | OID getID()(Code) | | Gets the OID uniquely identifying the authentication protocol.
an OID instance. |
hash | byte[] hash(byte[] data)(Code) | | Generates a hash value for the given data.
Parameters: data - the datathe generated hash. |
hash | byte[] hash(byte[] data, int offset, int length)(Code) | | Generates a hash value for the given data.
Parameters: data - the data Parameters: offset - offset into data Parameters: length - length of data to hashthe generated hash. |
isAuthentic | boolean isAuthentic(byte[] authenticationKey, byte[] message, int messageOffset, int messageLength, ByteArrayWindow digest)(Code) | | Authenticates an incoming message.
This method checks if the value in the authentication parameters
field of the message is valid.
The following procedure is used to verify the authenitcation value
- copy the authentication value to a temp buffer
- zero the auth field
- recalculate the authenthication value
- compare the two authentcation values
- write back the received authentication value
Parameters: authenticationKey - the authentication key to be used for authenticating the message. Parameters: message - the entire message for which the digest should be determined. Parameters: messageOffset - the offset in message where the message actually starts. Parameters: messageLength - the actual message length (may be smaller thanmessage.length ). Parameters: digest - the digest of the message .true if the message is authentic, false otherwise. |
passwordToKey | byte[] passwordToKey(OctetString passwordString, byte[] engineID)(Code) | | Generates the localized key for the given password and engine id.
Parameters: passwordString - the authentication pass phrase. Parameters: engineID - the engine ID of the authoritative engine.the localized authentication key. |
|
|