Net Encryption Library
VerifyTimeOneTimePassword Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class : VerifyTimeOneTimePassword Method
Verify that the timed one time password is still valid
Syntax
'Declaration
 
Public Function VerifyTimeOneTimePassword( _
   ByVal key As System.String, _
   ByVal validSeconds As System.Integer, _
   ByVal oneTimePassword As System.String _
) As System.Boolean
'Usage
 
Dim instance As Encryption
Dim key As System.String
Dim validSeconds As System.Integer
Dim oneTimePassword As System.String
Dim value As System.Boolean
 
value = instance.VerifyTimeOneTimePassword(key, validSeconds, oneTimePassword)
public System.bool VerifyTimeOneTimePassword( 
   System.string key,
   System.int validSeconds,
   System.string oneTimePassword
)
public function VerifyTimeOneTimePassword( 
    key: System.String;
    validSeconds: System.Integer;
    oneTimePassword: System.String
): System.Boolean; 
public function VerifyTimeOneTimePassword( 
   key : System.String,
   validSeconds : System.int,
   oneTimePassword : System.String
) : System.boolean;
public: System.bool VerifyTimeOneTimePassword( 
   System.string* key,
   System.int validSeconds,
   System.string* oneTimePassword
) 
public:
System.bool VerifyTimeOneTimePassword( 
   System.String^ key,
   System.int validSeconds,
   System.String^ oneTimePassword
) 

Parameters

key
validSeconds
oneTimePassword
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