CSDNCurrent en:Sender Verification

Aus Cryptshare Documentation
Wechseln zu:Navigation, Suche

Sender Verification

With Sender Verification mode, a verification has to be performed for each sender email address that is used. This makes sure that the sender address that is being used for a transfer through the API is valid and authorized for use by its owner. That's important, because the Cryptshare Policy set up on the server grants usage permissions and settings based on the email addresses used for a transfer.

To verify a specific sender email address, you need to send a verification request for that email address to the Cryptshare Server. The Cryptshare Server will then send a verification email containing a verification code to the specified sender email address.

This verification code will then need to be stored in the Client's verification store for the corresponding sender email address. Once this verification process is complete, the Client will then subsequently read the verification code for the sender email address from its verification store and include that data in each request it sends to the Cryptshare Server. The Cryptshare Server then checks the email address / verification code combination against its own database entry, to make sure the sender email address is indeed verified, before performing any requested operations.

You can find information regarding the maximum number of verification codes to be entered here.
Example: Performing a Sender Verification

// First create the Client instance
// Create a WebServiceUri for your Cryptshare Server 
WebServiceUri serviceUri = new WebServiceUri("https://cryptshare.server.com");
// Create a CryptshareConnection instance for your WebServiceUri
CryptshareConnection connection = new CryptshareConnection(serviceUri);
// Create the Client instance with the sender's email address, 
// the CryptshareConnection, and the path to the verification store.
Client client = new Client("sender_email@server.com", connection, @"C:\temp");

// now you can call the CheckVerification() method, to first check the
// current verification status of the specified sender email address
CheckVerificationResult result = client.CheckVerification();

if (result.senderVerification) { 
	// Verification Mode is indeed set to Sender Verification
	if (!result.verified) {
		// Sender email address is NOT verified, so request a new verification code
		// Cryptshare Server will now have sent an email containing the new
		// verification code to the email address "sender_email@server.com".
		// So now you could, for instance, prompt the user of your application
		// to enter that code on the command line, or if your application
		// has access to the user's emails, you could automatically parse the
		// email for the verification code.
		// Let's ask the user to enter the code:
		Console.WriteLine("Please type in the verification code:");
        String vericode = Console.ReadLine();

		// now tell the client to store the verification code in the 
		// verification store