Net Encryption Library
GenerateKey() Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class > GenerateKey Method : GenerateKey() Method
Generate a cryptographically strong random string to use as a key, salt, or initialization vector
Syntax
'Declaration
 
<System.ObsoleteAttribute("This method is obsolete. Use GenerateKey(EncryptionProvider encryptionType) instead")>
Public Overloads Function GenerateKey() As System.String
'Usage
 
Dim instance As Encryption
Dim value As System.String
 
value = instance.GenerateKey()
[System.Obsolete("This method is obsolete. Use GenerateKey(EncryptionProvider encryptionType) instead")]
public System.string GenerateKey()
public function GenerateKey(): System.String; 
System.ObsoleteAttribute("This method is obsolete. Use GenerateKey(EncryptionProvider encryptionType) instead")
public function GenerateKey() : System.String;
[System.Obsolete("This method is obsolete. Use GenerateKey(EncryptionProvider encryptionType) instead")]
public: System.string* GenerateKey(); 
[System.Obsolete("This method is obsolete. Use GenerateKey(EncryptionProvider encryptionType) instead")]
public:
System.String^ GenerateKey(); 
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
string results = encryption.GenerateKey();
 
Console.WriteLine(results);
Dim encryption As New Encryption() 'Trial Mode
'Dim encryption As New Encryption("place user name here", "place license key here") 'License Mode
 
Dim results As String = encryption.GenerateKey()
 
Console.WriteLine(results)
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
Overload List