java.lang.Object
org.snmp4j.security.AuthGeneric
org.snmp4j.security.AuthSHA2
- All Implemented Interfaces:
Serializable
,AuthenticationProtocol
,SecurityProtocol
- Direct Known Subclasses:
AuthHMAC128SHA224
,AuthHMAC192SHA256
,AuthHMAC256SHA384
,AuthHMAC384SHA512
The
SHA-2
class implements the Secure Hash Authentication 2.- Version:
- 2.4.0
- Author:
- Frank Fock
- See Also:
-
Field Summary
Fields inherited from class org.snmp4j.security.AuthGeneric
HMAC_BLOCK_SIZE, hmacBlockSize
-
Constructor Summary
-
Method Summary
Methods inherited from class org.snmp4j.security.AuthGeneric
authenticate, changeDelta, getAuthenticationCodeLength, getDigestLength, getDigestObject, getMaxKeyLength, hash, hash, isAuthentic, isSupported, passwordToKey
-
Constructor Details
-
AuthSHA2
@Deprecated public AuthSHA2(String protocolName, OID protocolOID, int digestLength, int authenticationCodeLength) Deprecated.UseAuthSHA2(String, OID, int, int, int)
instead to specify the correct HMAC block sizeCreates a SHA authentication protocol with the specified digest length.- Parameters:
protocolName
- the SHA protocol name (i.e., "SHA-256").protocolOID
- the OID of the protocol as defined in RFC 7630.digestLength
- the digest length.authenticationCodeLength
- the length of the authentication hash output in octets.
-
AuthSHA2
public AuthSHA2(String protocolName, OID protocolOID, int digestLength, int authenticationCodeLength, int hmacBlockSize) Creates a SHA authentication protocol with the specified digest length.- Parameters:
protocolName
- the SHA protocol name (i.e., "SHA-256").protocolOID
- the OID of the protocol as defined in RFC 7630.digestLength
- the digest length.authenticationCodeLength
- the length of the authentication hash output in octets.hmacBlockSize
- the HMAC block size of the authentication protocol.
-
-
Method Details
-
getID
Description copied from interface:AuthenticationProtocol
Gets the OID uniquely identifying the authentication protocol.- Returns:
- an
OID
instance.
-
AuthSHA2(String, OID, int, int, int)
instead to specify the correct HMAC block size