HOTP Control
Properties Methods Events Config Settings Errors
The HOTP control allows creation of HMAC-Based One-Time passwords.
Syntax
HOTP
Remarks
The HOTP control implements the HOTP algorithm defined in RFC 4226 (HMAC-Based One-Time Password). These types of passwords are commonly used as a second factor of authentication in multi-factor authentication scenarios.
To begin specify the shared secret in the Secret property.
Next, you may set Counter. If this property is not set, the control will use a default value.
To create the password call CreatePassword. The Password property will be populated with the new password.
To validate a password set the Password property and call ValidatePassword. The method will return True or False to indicate success or failure.
Property List
The following is the full list of the properties of the control with short descriptions. Click on the links for further details.
Counter | The counter used for HMAC-Based One Time Password creation or validation. |
Password | The HMAC-Based One Time Password. |
Secret | The Base32 encoded shared secret used when creating and validating a password. |
Method List
The following is the full list of the methods of the control with short descriptions. Click on the links for further details.
Config | Sets or retrieves a configuration setting. |
CreatePassword | Creates a HMAC-Based One Time Password. |
Reset | Reset the variables to default value. |
ValidatePassword | Validates a HMAC-Based One Time Password. |
Event List
The following is the full list of the events fired by the control with short descriptions. Click on the links for further details.
Error | Information about errors during data delivery. |
Config Settings
The following is a list of config settings for the control with short descriptions. Click on the links for further details.
HashAlgorithm | The hash algorithm used to sign the password. |
PasswordLength | The length of the generated password. |
SecretLength | The length of secret to generate. |
CodePage | The system code page used for Unicode to Multibyte translations. |
UseInternalSecurityAPI | Tells the control whether or not to use the system security libraries or an internal implementation. |
Counter Property (HOTP Control)
The counter used for HMAC-Based One Time Password creation or validation.
Syntax
hotpcontrol.Counter[=long64]
Default Value
0
Remarks
This property holds the counter value used for HMAC-Based One Time Password creation or validation. This value must be specified before calling CreatePassword or ValidatePassword. The value should be incremented each time a password is created.
The default value is 0.
Data Type
Long64
Password Property (HOTP Control)
The HMAC-Based One Time Password.
Syntax
hotpcontrol.Password[=string]
Default Value
""
Remarks
This property holds the HMAC-Based One Time Password. This property is populated after calling CreatePassword. This property must be set before calling ValidatePassword.
Data Type
String
Secret Property (HOTP Control)
The Base32 encoded shared secret used when creating and validating a password.
Syntax
hotpcontrol.Secret[=string]
Default Value
""
Remarks
This property specifies the Base32 encoded shared secret used when creating and validating a password. This should be set before calling CreatePassword or ValidatePassword.
If this is not set before calling CreatePassword a random secret will be automatically generated. This functionality provides an easy way to create new secret values. The length of the secret is defined by SecretLength.
Data Type
String
Config Method (HOTP Control)
Sets or retrieves a configuration setting.
Syntax
hotpcontrol.Config ConfigurationString
Remarks
Config is a generic method available in every control. It is used to set and retrieve configuration settings for the control.
These settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the control, access to these internal properties is provided through the Config method.
To set a configuration setting named PROPERTY, you must call Config("PROPERTY=VALUE"), where VALUE is the value of the setting expressed as a string. For boolean values, use the strings "True", "False", "0", "1", "Yes", or "No" (case does not matter).
To read (query) the value of a configuration setting, you must call Config("PROPERTY"). The value will be returned as a string.
CreatePassword Method (HOTP Control)
Creates a HMAC-Based One Time Password.
Syntax
hotpcontrol.CreatePassword
Remarks
This method creates a HMAC-Based One Time Password.
The following properties are applicable when calling CreatePassword.
Calling CreatePassword populates the Password property with the created password.
If Secret is not specified before calling this method a random secret will be automatically generated.
Reset Method (HOTP Control)
Reset the variables to default value.
Syntax
hotpcontrol.Reset
Remarks
This method will reset the variables to default value.
ValidatePassword Method (HOTP Control)
Validates a HMAC-Based One Time Password.
Syntax
hotpcontrol.ValidatePassword
Remarks
This method validates a HMAC-Based One Time Password.
The following properties are applicable when calling ValidatePassword.
The method will return True if the password is validated, False otherwise.
Error Event (HOTP Control)
Information about errors during data delivery.
Syntax
Sub hotpcontrol_Error(ErrorCode As Integer, Description As String)
Remarks
The Error event is fired in case of exceptional conditions during message processing. Normally the control fails with an error.
ErrorCode contains an error code and Description contains a textual description of the error. For a list of valid error codes and their descriptions, please refer to the Error Codes section.
Config Settings (HOTP Control)
The control accepts one or more of the following configuration settings. Configuration settings are similar in functionality to properties, but they are rarely used. In order to avoid "polluting" the property namespace of the control, access to these internal properties is provided through the Config method.HOTP Config Settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
HashAlgorithm:
The hash algorithm used to sign the password.This setting specifies the hash algorithm used to sign the password. Possible values are:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
PasswordLength:
The length of the generated password.This setting specifies the length of the generated password. Possible values are:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SecretLength: The length of secret to generate.When Secret is empty and CreatePassword is called a random secret value will be generated. This setting determines the length of the randomly generated secret. The default value is 32. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Base Config Settings | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
CodePage:
The system code page used for Unicode to Multibyte translations.The default code page is Unicode UTF-8 (65001).
The following is a list of valid code page identifiers:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
UseInternalSecurityAPI: Tells the control whether or not to use the system security libraries or an internal implementation. By default the control will use the system security libraries to perform cryptographic functions where applicable. Setting this to tells the control to use the internal implementation instead of using the system's security API. |
Trappable Errors (HOTP Control)
HOTP Errors
20115 Can't create password. | |
20116 Can't validate password. |