Helper class to make dealing with multiple (if 2 qualifies as multiple) authentication protocols in a
transparent way.
Calling class keeps the authentication protocol selection (as defined on the agent) in an integer
variable that can have 3 values: None, MD5, or
SHA1. Using GetInstance(AuthenticationDigests), calling method can
get authentication protocol implementation class instance cast as IAuthenticationDigest interface
and perform authentication operations (either authenticate outgoing packets to verify authentication of incoming packets)
without needing to further care about which authentication protocol is used.
Example of how to use this class:
CopyC#
Namespace:
SnmpSharpNetIAuthenticationDigest authenticationImplementation = Authentication.GetInstance(AuthenticationDigests.MD5); authenticationImplementation.authenticateIncomingMsg(...); authenticationImplementation.authenticateOutgoingMsg(...);
Assembly: SnmpSharpNet (in SnmpSharpNet.dll) Version: 0.5.0.0 (0.5.0.0)
Syntax
| C# | Visual Basic | Visual C++ |
public sealed class Authentication
Public NotInheritable Class Authentication
public ref class Authentication sealed
Members
| All Members | Methods |
| Member | Description | |
|---|---|---|
| Equals(Object) | (Inherited from Object.) | |
| GetHashCode()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
| GetInstance(AuthenticationDigests) |
Get instance of authentication protocol.
| |
| GetType()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
| ToString()()() | (Inherited from Object.) |