Net Encryption Library
GenerateKey(EncryptionProvider) Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class > GenerateKey Method : GenerateKey(EncryptionProvider) Method
Create a cryptographically strong key consisting of printable characters for the passed algorithm
Syntax
'Declaration
 
Public Overloads Function GenerateKey( _
   ByVal encryptionType As EncryptionProvider _
) As System.String
'Usage
 
Dim instance As Encryption
Dim encryptionType As EncryptionProvider
Dim value As System.String
 
value = instance.GenerateKey(encryptionType)
public System.string GenerateKey( 
   EncryptionProvider encryptionType
)
public function GenerateKey( 
    encryptionType: EncryptionProvider
): System.String; 
public function GenerateKey( 
   encryptionType : EncryptionProvider
) : System.String;
public: System.string* GenerateKey( 
   EncryptionProvider encryptionType
) 
public:
System.String^ GenerateKey( 
   EncryptionProvider encryptionType
) 

Parameters

encryptionType
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
string key = encryption.GenerateKey(EncryptionProvider.Rijndael);
Console.WriteLine("Key");
Console.WriteLine(key);
Dim encryption As New Encryption() 'Trial Mode
'Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
Dim key As String = encryption.GenerateKey(EncryptionProvider.Rijndael)
Console.WriteLine("Key")
Console.WriteLine(key)
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