GenRandomPassword Method

Returns a server-generated random password that complies with the given criteria.

Syntax

ANSI (Cross Platform)
char* GenRandomPassword(int iLength, int bLowercase, int bUppercase, int bNumbers, int bPunctuation, int bSpaces, const char* lpszExcludeChars, int bRequireEach);

Unicode (Windows)
LPWSTR GenRandomPassword(INT iLength, BOOL bLowercase, BOOL bUppercase, BOOL bNumbers, BOOL bPunctuation, BOOL bSpaces, LPCWSTR lpszExcludeChars, BOOL bRequireEach);
- (NSString*)genRandomPassword:(int)length :(BOOL)lowercase :(BOOL)uppercase :(BOOL)numbers :(BOOL)punctuation :(BOOL)spaces :(NSString*)excludeChars :(BOOL)requireEach;
#define MID_AMAZONSECRETS_GENRANDOMPASSWORD 9

CLOUDKEYS_EXTERNAL int CLOUDKEYS_CALL CloudKeys_AmazonSecrets_Do(void *lpObj, int methid, int cparam, void *param[], int cbparam[], int64 *lpllVal);

Remarks

This method requests and returns a random password generated by the server based on a number of criteria.

The Length parameter specifies how long the password must be; it must be a value in the range 1 to 4096 (inclusive).

The Lowercase, Uppercase, Numbers, Punctuation, and Spaces parameters specify whether the server is allowed to include characters of each type. The Lowercase and Uppercase types cover ASCII characters only. For Punctuation, the applicable characters are: ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~

The ExcludeChars parameters specifies a list of characters that must not be included in the password. For example, passing &" - would exclude ampersands, double quotes, spaces, and hyphens.

The RequireEach parameter specifies whether the server must include at least one of each allowed character type in the password.

Error Handling (C++)

This method returns a String value; after it returns, call the GetLastErrorCode() method to obtain its 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.

Copyright (c) 2022 /n software inc. - All rights reserved.
Cloud Keys 2020 C++ Edition - Version 20.0 [Build 8157]