Cypher for .net

PGPManaged..::..TryDecrypt Method (String, Boolean, array<String>[]()[][])

Attempts to decrypt a message using a set of private key

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

Syntax


[NotNullAttribute]
public ValueTuple<string, int> TryDecrypt(
	string encryptedText,
	bool paralell,
	params string[] privateKeys
)

Parameters

encryptedText
Type: String
the encrypted text to decipher
paralell
Type: Boolean
perform decryption as a parallel operation
privateKeys
Type: array<String>[]()[][]
the keys to use for the decryption

Return Value

Returns a tuple with the result and they index of the key used, the key is -1 if no valid key was found

Exceptions


ExceptionCondition
[ArgumentException]encryptedText not provided
[ArgumentNullException]privateKeys is null

Remarks


This option allows you to send a set public keys of a key-rings and then to pick the private key that is valid. this was you are able to have a key buffer that can be used in an asynchronous environment and take a key of a queue of possible keys to use. when the keys are a bout to b consumed the client can request the server for a new set of keys