WALTER | Workable Algorithms for Location-aware Transmission, Encryption Response

PGPManaged..::..Validate Method

Validates the specified key ring is safe to use.

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

Syntax


[MethodImplAttribute]
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
ArgumentNullExceptiona 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);