PGPManaged..::..VerifySignature Method (String, String, String)
Verifies the signature that is supposed to match the plain text.
Namespace:
Walter.Cypher.PGPAssembly: Walter.Cypher (in Walter.Cypher.dll)
Syntax
[MethodImplAttribute] public bool VerifySignature( string plainText, string signedHashValue, string key )
Parameters
- plainText
- Type: String
The plain text.
- signedHashValue
- Type: String
The signed hash value.
- key
- Type: String
The key.
Return Value
true if signature matches the signed text, false otherwise.Exceptions
Exception | Condition |
---|---|
ArgumentNullException | plainText |
ArgumentNullException | signedHashValue |
ArgumentNullException | key |
Examples
C#
var keyGen = new PGPKeyGenerator(); var keyRing2048 = keyGen.GenerateKeys(PGPKeySize.Key2048); var pgp = new PGPManaged(); var signature = pgp.Sign("sample", keyRing2048.PrivateKey); var actual = pgp.VerifySignature("sample", signature, keyRing2048.PrivateKey); Assert.IsTrue(actual);