Net Encryption Library
GenerateRSAKeys Method
Example 






KellermanSoftware.NetEncryptionLibrary Namespace > Encryption Class : GenerateRSAKeys Method
Create public and private keys
Syntax
'Declaration
 
Public Function GenerateRSAKeys() As AsymmetricKeyPair
'Usage
 
Dim instance As Encryption
Dim value As AsymmetricKeyPair
 
value = instance.GenerateRSAKeys()
public AsymmetricKeyPair GenerateRSAKeys()
public function GenerateRSAKeys(): AsymmetricKeyPair; 
public function GenerateRSAKeys() : AsymmetricKeyPair;
public: AsymmetricKeyPair* GenerateRSAKeys(); 
public:
AsymmetricKeyPair^ GenerateRSAKeys(); 

Return Value

Public and private key pairs in XML
Example
Encryption encryption = new Encryption(); //Trial Mode
//Encryption encryption = new Encryption("place user name here", "place license key here"); //License Mode
 
AsymmetricKeyPair results = encryption.GenerateRSAKeys();
 
Console.WriteLine("Public Key Only:");
Console.WriteLine(results.PublicKeyOnly);
Console.WriteLine();
 
Console.WriteLine("Public and Private Key:");
Console.WriteLine(results.PublicPrivateKeyPair);
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 AsymmetricKeyPair = encryption.GenerateRSAKeys()
 
Console.WriteLine("Public Key Only:")
Console.WriteLine(results.PublicKeyOnly)
Console.WriteLine()
 
Console.WriteLine("Public and Private Key:")
Console.WriteLine(results.PublicPrivateKeyPair)
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