Net Encryption Library
CreateTimedOneTimePassword Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class : CreateTimedOneTimePassword Method
Creates a timed one time password based on the passed key for the valid number of seconds.
Syntax
'Declaration
 
Public Function CreateTimedOneTimePassword( _
   ByVal key As System.String, _
   ByVal validSeconds As System.Integer _
) As System.String
'Usage
 
Dim instance As Encryption
Dim key As System.String
Dim validSeconds As System.Integer
Dim value As System.String
 
value = instance.CreateTimedOneTimePassword(key, validSeconds)
public System.string CreateTimedOneTimePassword( 
   System.string key,
   System.int validSeconds
)
public function CreateTimedOneTimePassword( 
    key: System.String;
    validSeconds: System.Integer
): System.String; 
public function CreateTimedOneTimePassword( 
   key : System.String,
   validSeconds : System.int
) : System.String;
public: System.string* CreateTimedOneTimePassword( 
   System.string* key,
   System.int validSeconds
) 
public:
System.String^ CreateTimedOneTimePassword( 
   System.String^ key,
   System.int validSeconds
) 

Parameters

key
validSeconds
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
string oneTimePassword = encryption.CreateTimedOneTimePassword("SecretPassword", 1);
Console.WriteLine(oneTimePassword);
Assert.IsTrue(encryption.VerifyTimeOneTimePassword("SecretPassword", 1, oneTimePassword));
 
System.Threading.Thread.Sleep(1000);
 
string anotherOneTimePassword = encryption.CreateTimedOneTimePassword("SecretPassword", 1);
Console.WriteLine(anotherOneTimePassword);
Assert.AreNotEqual(oneTimePassword, anotherOneTimePassword);
Dim encryption As New Encryption() 'Trial Mode
'Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
Dim oneTimePassword As String = encryption.CreateTimedOneTimePassword("SecretPassword", 1)
Console.WriteLine(oneTimePassword)
Assert.IsTrue(encryption.VerifyTimeOneTimePassword("SecretPassword", 1, oneTimePassword))
 
System.Threading.Thread.Sleep(1000)
 
Dim anotherOneTimePassword As String = encryption.CreateTimedOneTimePassword("SecretPassword", 1)
Console.WriteLine(anotherOneTimePassword)
Assert.AreNotEqual(oneTimePassword, anotherOneTimePassword)
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

Encryption Class
Encryption Members