Home > Contents > Index >
Expanded TOC | Accordion TOC | Annotated TOC | Index
Utilities.cryptoEnabled
Checks if encryption is enabled.
Syntax
public static final boolean cryptoEnabled()Description
The
cryptoEnabledmethod checks whether encryption is enabled. This requires that the encryption package be installed.cryptoEnabledshould always returntrue, since an encryption package is included as part of Sites.Returns
Returns
trueif encryption is enabled,falseotherwise.Example
The following code calls
cryptoEnabledto ensure that encryption is enabled prior to encrypting a string.if (Utilities.cryptoEnabled()) { String clear_text = "Attack at dawn."; String encrypted_text = Utilities.encryptString(clear_text); String decrypted_text = Utilities.decryptString(encrypted_text); if( !decrypted_text.equals(clear_text) ) { // something turned out wrong } }See Also
Home > Contents > Index > ![]()
Oracle JAVA Reference
Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.