Click or drag to resize
IRSAKeys Interface
Interface for signature providers based on RSA algorithm.

Namespace:  Babel.Licensing
Assemblies:   Babel.Licensing (in Babel.Licensing.dll) Version:
  Babel.Licensing (in Babel.Licensing.dll) Version:
public interface IRSAKeys

The IRSAKeys type exposes the following members.

Public propertyHasPrivateKey
Gets a value indicating whether this object has private key.
Public propertyHasPublicKey
Gets a value indicating whether this object has public key.
Public propertyKeyPair
Gets or sets the RSA key pair.
// Sign data using RSA algorithm with 1024 bit key size
RSASignature signer = new RSASignature();

// A private key is needed to sign data

byte[] data = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
byte[] signature = signer.SignData(data);

// Create a new RSASignature with the public key needed 
// to verify the signature
string publicKey = signer.ExportKeys(true);
RSASignature verifier = RSASignature.FromKeys(publicKey);

// Returns true
bool result = verifier.VerifyData(data, signature);
See Also