CSJCurrent en:Terms of Use

Aus Cryptshare Documentation
Wechseln zu:Navigation, Suche



The Terms of Use that are defined under the Legal tab on the Cryptshare Server administration website can be downloaded by the Client, so that they can be presented to a user in a client side application. The Terms of Use can be downloaded using the Client's method requestTermsOfUse(). The method returns a TermsOfUse object, that consists of a LastChanged date and a key-value pairs containing the Terms of Use texts as the values, and their corresponding language codes as the keys.

Example: Requesting the Terms of Use

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

// Request the Terms of Use
TermsOfUse termsOfUse = client.requestTermsOfUse();
Map<Locale, String> terms = termsOfUse.getTextByLanguage();
for (Map.Entry<Locale,String> entry : terms.entrySet()) {
    System.out.println("Terms of use for language '"
              + entry.getKey() + "': " + entry.getValue());
}