Cypher for .net

PGPManaged..::..Validate Method

Validates the specified key ring is safe to use.

Namespace:  Walter.Cypher.PGP
Assembly:  Walter.Cypher (in Walter.Cypher.dll)

Syntax


public bool Validate(
	KeyRing keyRing
)

Parameters

keyRing
Type: Walter.Cypher.PGP..::..KeyRing
The key ring to validate.

Return Value

true if the key-ring round trips without data loss, false otherwise.

Exceptions


ExceptionCondition
[ArgumentNullException]a valid KeyRing should be provided

Examples


The bellow test shows how to create and validate a keyring.
C#
var keyGen = new PGPKeyGenerator();        ///
   var keyRing2048 = keyGen.GenerateKeys(PGPKeySize.Key2048);
   var keyRing4096 = keyGen.GenerateKeys(PGPKeySize.Key4096);
   var pgp = new PGPManaged();
   var v2048 = pgp.Validate(keyRing2048);
   var v4096 = pgp.Validate(keyRing4096);

   Assert.IsTrue(v2048);
   Assert.AreEqual(v2048, v4096);