- java.lang.Object
-
- org.snmp4j.security.AuthGeneric
-
- org.snmp4j.security.AuthSHA2
-
- All Implemented Interfaces:
Serializable
,AuthenticationProtocol
,SecurityProtocol
- Direct Known Subclasses:
AuthHMAC128SHA224
,AuthHMAC192SHA256
,AuthHMAC256SHA384
,AuthHMAC384SHA512
public class AuthSHA2 extends AuthGeneric
TheSHA-2
class implements the Secure Hash Authentication 2.- Version:
- 2.4.0
- Author:
- Frank Fock
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.snmp4j.security.AuthGeneric
HMAC_BLOCK_SIZE, hmacBlockSize
-
-
Constructor Summary
Constructors Constructor Description AuthSHA2(String protocolName, OID protocolOID, int digestLength, int authenticationCodeLength)
Deprecated.UseAuthSHA2(String, OID, int, int, int)
instead to specify the correct HMAC block sizeAuthSHA2(String protocolName, OID protocolOID, int digestLength, int authenticationCodeLength, int hmacBlockSize)
Creates a SHA authentication protocol with the specified digest length.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OID
getID()
Gets the OID uniquely identifying the authentication protocol.-
Methods inherited from class org.snmp4j.security.AuthGeneric
authenticate, changeDelta, getAuthenticationCodeLength, getDigestLength, getDigestObject, getMaxKeyLength, hash, hash, isAuthentic, isSupported, passwordToKey
-
-
-
-
Constructor Detail
-
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 Detail
-
getID
public OID getID()
Description copied from interface:AuthenticationProtocol
Gets the OID uniquely identifying the authentication protocol.- Returns:
- an
OID
instance.
-
-