AddUser Method

Adds a user to the internal authentication cache.

Syntax

ANSI (Cross Platform)
int AddUser(const char* lpszUser, int iAuthenticationProtocol, const char* lpszAuthenticationPassword, int iEncryptionAlgorithm, const char* lpszEncryptionPassword);

Unicode (Windows)
INT AddUser(LPCWSTR lpszUser, INT iAuthenticationProtocol, LPCWSTR lpszAuthenticationPassword, INT iEncryptionAlgorithm, LPCWSTR lpszEncryptionPassword);
- (void)addUser:(NSString*)user :(int)authenticationProtocol :(NSString*)authenticationPassword :(int)encryptionAlgorithm :(NSString*)encryptionPassword;
#define MID_SNMPTCPAGENT_ADDUSER 2

IPWORKSSNMP_EXTERNAL int IPWORKSSNMP_CALL IPWorksSNMP_SNMPTCPAgent_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

The internal authentication cache can be used as an alternative to the GetUserPassword event, automatically checking the cache against the security parameters provided in the request signature.

The ShowCache method is used to show the contents of the internal authentication cache.

The ClearCache method can be used to completely clear the cache.

Valid Authentication Protocols are:

HMAC-MD5-96 (1)Message-Digest algorithm 5.
HMAC-SHA-96 (2)Secure Hash Algorithm.
HMAC-192-SHA-256 (3)Secure Hash Algorithm.
HMAC-384-SHA-512 (4)Secure Hash Algorithm.

Valid Encryption Algorithms are:

DES (1)Data Encryption Standard.
AES (2)Advanced Encryption Standard with key length of 128.
3DES (3)Triple Data Encryption Standard.
AES192 (4)Advanced Encryption Standard with key length of 192.
AES256 (5)Advanced Encryption Standard with key length of 256.

NOTE: Specifying an authentication protocol of 0 is a special case where the class will attempt to verify users with all valid authentication protocols.

Error Handling (C++)

This method returns a result code; 0 indicates success, while a non-zero error code indicates that this method encountered an error during its execution. If an error occurs, the GetLastError() method can be called to retrieve the associated error message. (Note: This method's result code can also be obtained by calling the GetLastErrorCode() method after it returns.)

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks SNMP 2020 C++ Edition - Version 20.0 [Build 8202]