CSJCurrent 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(List<String>). The method takes a list of recipient email 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, Paths.get("C:\\\\temp"));

// The list of recipient email addresses which this sender wants to send 
// files to. 
List<String> recipients = new ArrayList<String>();
recipients.add("john.smith@abc.com");
recipients.add("jane.adams@xyz.com");
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").
System.out.println("Will the sender be notified of downloads? " + 
                policy.isDownloadNotification());
System.out.println("Is it possible to change the option 'Notify sender of downloads'? " + 
                policy.isDownloadNotificationChangeable());
System.out.println("Will the file names be shown in the email message? " + 
                policy.isShowFilenames());
System.out.println("Is it possible to change the option 'Show file names in email message'? " + 
                policy.isShowFilenamesChangeable());
System.out.println("Will the files inside a zip file displayed in the email message? " + 
                policy.isShowZipContent());
System.out.println("Is sending of confidential message allowed?: " + 
				policy.isAllowConfidentialMessage());
System.out.println("Is sending of confidential message enforced?: " + 
                policy.isForceConfidentialMessage());
System.out.println("Is setting a custom recipient notification message allowed?: " + 
                policy.isAllowCustomRecipientMessage());
System.out.println("The storage duration of the transferred files in days: " + 
                policy.getStorageDuration());
System.out.println("The maximum total size of the transfer in MB: " + 
                policy.getTransferLimit());
System.out.println("Recipients not allowed for this sender by the policy" + 
				policy.getFailedAddresses());
System.out.println("The allowed password modes for a non-QUICK transfer: " + 
				policy.getAllowedStandardPasswordModes());
System.out.println("The allowed password modes for a QUICK transfer: " + 
                policy.getAllowedQuickPasswordModes());
System.out.println("How is the usage of QUICK defined: " + 
                policy.getQuickMode());