public interface AuthenticationProtocol extends SecurityProtocol
AuthenticationProtocol interface defines a common
interface for all SNMP authentication protocols.| Modifier and Type | Method and Description |
|---|---|
boolean |
authenticate(byte[] authenticationKey,
byte[] message,
int messageOffset,
int messageLength,
ByteArrayWindow digest)
Authenticates an outgoing message.
|
byte[] |
changeDelta(byte[] oldKey,
byte[] newKey,
byte[] random)
Computes the delta digest needed to remotely change an user's
authenitcation key.
|
int |
getAuthenticationCodeLength()
The length of the authentication code (the hashing output length) in octets.
|
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.
|
boolean authenticate(byte[] authenticationKey,
byte[] message,
int messageOffset,
int messageLength,
ByteArrayWindow digest)
digestOffset offset is pointing
inside the message buffer and must be zeroed before the authentication
value is computed.authenticationKey - the authentication key to be used for authenticating the message.message - the entire message for which the digest should be determined.messageOffset - the offset in message where the message actually starts.messageLength - the actual message length (may be smaller than
message.length).digest - the offset in message where to store the digest.true if the message digest has been successfully computed
and set, false otherwise.boolean isAuthentic(byte[] authenticationKey,
byte[] message,
int messageOffset,
int messageLength,
ByteArrayWindow digest)
authenticationKey - the authentication key to be used for authenticating the message.message - the entire message for which the digest should be determined.messageOffset - the offset in message where the message actually starts.messageLength - the actual message length (may be smaller than
message.length).digest - the digest of the message.true if the message is authentic, false
otherwise.byte[] changeDelta(byte[] oldKey,
byte[] newKey,
byte[] random)
oldKey - the old authentication/privacy key.newKey - the new authentication/privacy key.random - the random 'seed' to be used to produce the digest.random array.OID getID()
getID in interface SecurityProtocolOID instance.byte[] passwordToKey(OctetString passwordString, byte[] engineID)
passwordString - the authentication pass phrase.engineID - the engine ID of the authoritative engine.byte[] hash(byte[] data)
data - the databyte[] hash(byte[] data,
int offset,
int length)
data - the dataoffset - offset into datalength - length of data to hashint getDigestLength()
int getAuthenticationCodeLength()
Copyright © 2016 SNMP4J.org. All Rights Reserved.