CSDNCurrent en:Policy Rules

Aus Cryptshare Documentation
Wechseln zu:Navigation, Suche

Cryptshare uses Policy Settings that can be defined on the server side to allow or deny usage of the system to certain senders and recipients and to control the transfer options pertaining to specific senders and recipients. You can request the policy rules configured for a specific sender/recipients combination by calling the Client's method RequestPolicy(string[]). The method takes a list of recipient e-mail addresses and returns a Policy object containing the resulting policy rules. Please note that the Cryptshare Server only allows this operation for verified sender addresses or verified Client instances (see Verification).

Example: Querying the Policy Settings

// 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");

// The list of recipient e-mail addresses which this sender wants to send 
// files to. 
string[] recipients = new string[]
Policy policy = client.RequestPolicy(recipients);

// The returned Policy object contains the rules defined for transfers
// between this sender ("sender_email@server.com") and the specified 
// recipients ("john.smith@abc.com","jane.adams@xyz.com").
Console.WriteLine("Will the sender be notified of downloads? " +
Console.WriteLine("Will the file names be shown in the email message? " +
Console.WriteLine("Is sending of confidential message allowed?: " +
Console.WriteLine("The storage duration of the transferred files in days: " +
Console.WriteLine("The maximum total size of the transfer in MB: " +
Console.WriteLine("Recipients not allowed for this sender by the policy: " +
    string.Join(", ", policy.FailedAddresses != null ? policy.FailedAddresses : new string[] { } ));
Console.WriteLine("The allowed password modes for a transfer: " +
    string.Join(", ", policy.PasswordMode != null ? policy.PasswordMode : new passwordMode[] { } ));