IRSAKeys

Namespace: Babel.Licensing Assembly: Babel.Licensing.dll

Interface for signature providers based on RSA algorithm.

public interface IRSAKeys

Examples

// Sign data using RSA algorithm with 1024 bit key size
RSASignature signer = new RSASignature();

// A private key is needed to sign data
signer.CreateKeyPair();

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);

Properties

HasPrivateKey

Gets a value indicating whether this object has private key.

bool HasPrivateKey { get; }

Property Value

bool

HasPublicKey

Gets a value indicating whether this object has public key.

bool HasPublicKey { get; }

Property Value

bool

KeyPair

Gets or sets the RSA key pair.

byte[] KeyPair { get; set; }

Property Value

byte[]

RSA

Gets or sets the RSA key pair.

RSA RSA { get; set; }

Property Value

RSA

Last updated