A class encapsulating user-specific configuration information and default variable values. More...
Static Public Member Functions | |
static void | setUserName (String name) |
static String | userName () |
static void | setUserConfigurationDirectory (String path) |
static String | userConfigurationDirectory () |
static void | setDefaultNamespacePrefix (String defaultNamespacePrefix) throws MalformedContentNameStringException |
static ContentName | defaultNamespace () |
static void | setUserNamespace (String userNamespace) throws MalformedContentNameStringException |
static ContentName | userNamespace () |
static ContentName | userNamespace (String userName) |
User the userNamespacePrefix() to generate a namespace for a particular user. | |
static void | setUserNamespacePrefix (String userNamespacePrefix) throws MalformedContentNameStringException |
static ContentName | userNamespacePrefix () |
static void | setKeystoreFileName (String fileName) |
static String | keystoreFileName () |
static String | configurationFileName () |
static String | keyCacheFileName () |
static void | setKeystorePassword (String password) |
static String | keystorePassword () |
static String | defaultKeyLocator () |
Don't provide a mechanism to set this here; this is actually configured on the KeyManagers. | |
static boolean | useKeyConfiguration () |
static boolean | saveAndLoadKeyCache () |
Do we save the key cache when asked, and retrieve it on startup? | |
static void | setSaveAndLoadKeyCache (boolean saveKeyCache) |
static boolean | publishKeys () |
static void | setPublishKeys (boolean publish) |
static String | keyRepositoryDirectory () |
static String | addressBookFileName () |
static String | defaultKeyAlgorithm () |
static String | defaultKeyAlias () |
static String | defaultKeystoreType () |
static int | defaultKeyLength () |
static String | defaultKeyNamespaceMarker () |
Static Public Attributes | |
static String | FILE_SEP = System.getProperty("file.separator") |
Static Protected Attributes | |
static final String | DEFAULT_CONFIGURATION_FILE_NAME = "ccnx_config.bin" |
Our eventual configuration file location. | |
static final String | DEFAULT_KEYSTORE_FILE_NAME = ".ccnx_keystore" |
static final String | DEFAULT_KEY_CACHE_FILE_NAME = "secure_key_cache.bin" |
static final String | KEY_DIRECTORY = "keyCache" |
static final String | ADDRESSBOOK_FILE_NAME = "ccnx_addressbook.xml" |
static final String | CCNX_DEFAULT_NAMESPACE = "/ccnx.org" |
static final String | DEFAULT_USER_NAMESPACE_MARKER = "Users" |
static final String | DEFAULT_KEY_NAMESPACE_MARKER = "Keys" |
static final String | DEFAULT_KEYSTORE_PASSWORD = "Th1s1sn0t8g00dp8ssw0rd." |
Currently very cheezy keystore handling. | |
static final int | DEFAULT_KEY_LENGTH = 1024 |
static final String | DEFAULT_KEY_ALG = "RSA" |
static final String | DEFAULT_KEY_ALIAS = "ccnxuser" |
Change to all lower case. | |
static final String | DEFAULT_KEYSTORE_TYPE = "PKCS12" |
static final String | CCNX_DEFAULT_NAMESPACE_PROPERTY |
Default prefix to use, e.g. | |
static final String | CCNX_DEFAULT_NAMESPACE_ENVIRONMENT_VARIABLE = "CCNX_NAMESPACE" |
static final String | CCNX_DEFAULT_USER_CONFIG_DIR_NAME = ".ccnx" |
Default value of user configuration directory name -- this is not the full path, merely the directory name itself; by default we interpret the directory name as <user_home>/.ccnx. | |
static final String | CCNX_USER_CONFIG_DIR_PROPERTY |
Directory (subdirectory of User.home) where all user metadata is kept. | |
static final String | CCNX_USER_CONFIG_DIR_ENVIRONMENT_VARIABLE = "CCNX_DIR" |
static final String | CCNX_USER_NAME_PROPERTY |
User friendly name, by default user.name Java property. | |
static final String | CCNX_USER_NAME_ENVIRONMENT_VARIABLE = "CCNX_USER_NAME" |
static final String | CCNX_USER_NAMESPACE_PREFIX_PROPERTY |
User namespace, by default ccnxNamespace()/<DEFAULT_USER_NAMESPACE_MARKER>/userName(); the user namespace prefix will be set to the value given here -- so the user namespace will be userNamespacePrefix()/<DEFAULT_USER_NAMESPACE_MARKER>/<user name>=""> for either a user name we are given or our default user name. | |
static final String | CCNX_USER_NAMESPACE_PREFIX_ENVIRONMENT_VARIABLE = "CCNX_USER_NAMESPACE_PREFIX" |
static final String | CCNX_USER_NAMESPACE_PROPERTY |
User namespace, by default ccnxNamespace()/<DEFAULT_USER_NAMESPACE_MARKER>/userName(); the user namespace will be set to the value given here -- we don't add the user namespace marker or userName(). | |
static final String | CCNX_USER_NAMESPACE_ENVIRONMENT_VARIABLE = "CCNX_USER_NAMESPACE" |
static final String | CCNX_KEYSTORE_FILENAME_PROPERTY |
Property and variable to set the keystore file name to something other than the default .ccnx_keystore (the directory is handled separately, as the CCNX_USER_CONFIG_DIRECTORY. | |
static final String | CCNX_KEYSTORE_FILENAME_ENVIRONMENT_VARIABLE = "CCNX_KEYSTORE_FILENAME" |
static final String | CCNX_KEYSTORE_PASSWORD_PROPERTY |
Property and variable to set the keystore password to something other than the default; can also be overridden in calls to the key manager constructor. | |
static final String | CCNX_KEYSTORE_PASSWORD_ENVIRONMENT_VARIABLE = "CCNX_KEYSTORE_PASSWORD" |
static final String | CCNX_CONFIGURATION_FILENAME_PROPERTY |
Property and variable to set the keystore file name to something other than the default ccnx_user.conf (the directory is handled separately, as the CCNX_USER_CONFIG_DIRECTORY. | |
static final String | CCNX_CONFIGURATION_FILENAME_ENVIRONMENT_VARIABLE = "CCNX_CONFIG_FILENAME" |
static final String | CCNX_DEFAULT_KEY_LOCATOR_PROPERTY |
Property and variable to set the key locator to use for the default key. | |
static final String | CCNX_DEFAULT_KEY_LOCATOR_ENVIRONMENT_VARIABLE = "CCNX_DEFAULT_KEY_LOCATOR" |
static final String | CCNX_PUBLISH_KEYS_PROPERTY |
Property and variable to control whether we publish keys or not. | |
static final String | CCNX_PUBLISH_KEYS_ENVIRONMENT_VARIABLE = "CCNX_PUBLISH_KEYS" |
static final String | CCNX_USE_KEY_CONFIGURATION_PROPERTY = "org.ccnx.config.UseKeyConfiguration" |
Property and variable to control whether we load/can set user's key-related configuration (key locators, key cache, etc). | |
static final String | CCNX_USE_KEY_CONFIGURATION_ENVIRONMENT_VARIABLE = "CCNX_USE_KEY_CONFIGURATION" |
static final String | CCNX_SAVE_KEY_CACHE_PROPERTY = "org.ccnx.config.SaveKeyCache" |
Variable to control whether key cache is saved on request and reloaded on startup. | |
static final String | CCNX_SAVE_KEY_CACHE_ENVIRONMENT_VARIABLE = "CCNX_SAVE_KEY_CACHE" |
static final String | DEFAULT_SAVE_KEY_CACHE_SETTING = SystemConfiguration.STRING_FALSE |
static String | _userConfigurationDir |
Value of CCN directory. | |
static String | _userName |
User name. | |
static ContentName | _defaultNamespace |
CCNx (control) prefix. | |
static ContentName | _userNamespace |
User prefix (e.g. | |
static ContentName | _userNamespacePrefix |
User namespace prefix (e.g. | |
static String | _keystoreFileName |
Keystore file name. | |
static String | _keystorePassword |
Keystore password, if not default. | |
static String | _configurationFileName |
Configuration file name. | |
static Boolean | _publishKeys |
Do we publish keys by default? | |
static Boolean | _useKeyConfiguration |
Do we load stored state about cached secret keys, key locators (credentials) to use, and so on? Setting this to false can prevent interactions between unit tests and the user's internal configuration data. | |
static Boolean | _saveAndLoadKeyCache |
Do we automatically save and load the key cache as part of the configuration data? (Automatic loading of key cache happens only if _useKeyConfiguration is also true. | |
static final String | USER_DIR = System.getProperty("user.home") |
A class encapsulating user-specific configuration information and default variable values.
Eventually this will be handled more sensibly by a user configuration file. This is likely to change extensively as the user model evolves.
static String org.ccnx.ccn.config.UserConfiguration.defaultKeyLocator | ( | ) | [static] |
Don't provide a mechanism to set this here; this is actually configured on the KeyManagers.
Just provide a means for them to pull in property/environment/configuration file parameters.
static boolean org.ccnx.ccn.config.UserConfiguration.saveAndLoadKeyCache | ( | ) | [static] |
Do we save the key cache when asked, and retrieve it on startup?
static ContentName org.ccnx.ccn.config.UserConfiguration.userNamespace | ( | String | userName | ) | [static] |
User the userNamespacePrefix() to generate a namespace for a particular user.
userName |
String org.ccnx.ccn.config.UserConfiguration._configurationFileName [static, protected] |
Configuration file name.
This is the name of the actual file, without the directory.
String org.ccnx.ccn.config.UserConfiguration._keystoreFileName [static, protected] |
Keystore file name.
This is the name of the actual file, without the directory.
String org.ccnx.ccn.config.UserConfiguration._keystorePassword [static, protected] |
Keystore password, if not default.
Yes we know this is bad; it's on our list of things to improve.
Boolean org.ccnx.ccn.config.UserConfiguration._saveAndLoadKeyCache [static, protected] |
Do we automatically save and load the key cache as part of the configuration data? (Automatic loading of key cache happens only if _useKeyConfiguration is also true.
)
Boolean org.ccnx.ccn.config.UserConfiguration._useKeyConfiguration [static, protected] |
Do we load stored state about cached secret keys, key locators (credentials) to use, and so on? Setting this to false can prevent interactions between unit tests and the user's internal configuration data.
If false, we also prevent writing to configuration state.
String org.ccnx.ccn.config.UserConfiguration._userName [static, protected] |
User name.
By default value of user.name property.
ContentName org.ccnx.ccn.config.UserConfiguration._userNamespace [static, protected] |
User prefix (e.g.
for keys). By default, the user namespace prefix together with user information.
ContentName org.ccnx.ccn.config.UserConfiguration._userNamespacePrefix [static, protected] |
User namespace prefix (e.g.
for keys). By default, the CCNX prefix
final String org.ccnx.ccn.config.UserConfiguration.CCNX_CONFIGURATION_FILENAME_PROPERTY [static, protected] |
"org.ccnx.config.ConfigurationFilename"
Property and variable to set the keystore file name to something other than the default ccnx_user.conf (the directory is handled separately, as the CCNX_USER_CONFIG_DIRECTORY.
..)
final String org.ccnx.ccn.config.UserConfiguration.CCNX_DEFAULT_KEY_LOCATOR_PROPERTY [static, protected] |
"org.ccnx.config.DefaultKeyLocator"
Property and variable to set the key locator to use for the default key.
Need something more complicated, probably read from a configuration file. But this will get us started. Parse this as "key locator for the default key", not "the default value for the key locator".
final String org.ccnx.ccn.config.UserConfiguration.CCNX_DEFAULT_NAMESPACE_PROPERTY [static, protected] |
"org.ccnx.config.CCNxNamespace"
Default prefix to use, e.g.
for user information if not overridden by local stuff.
final String org.ccnx.ccn.config.UserConfiguration.CCNX_DEFAULT_USER_CONFIG_DIR_NAME = ".ccnx" [static, protected] |
Default value of user configuration directory name -- this is not the full path, merely the directory name itself; by default we interpret the directory name as <user_home>/.ccnx.
final String org.ccnx.ccn.config.UserConfiguration.CCNX_KEYSTORE_FILENAME_PROPERTY [static, protected] |
"org.ccnx.config.KeystoreFilename"
Property and variable to set the keystore file name to something other than the default .ccnx_keystore (the directory is handled separately, as the CCNX_USER_CONFIG_DIRECTORY.
..)
final String org.ccnx.ccn.config.UserConfiguration.CCNX_KEYSTORE_PASSWORD_PROPERTY [static, protected] |
"org.ccnx.config.KeystorePassword"
Property and variable to set the keystore password to something other than the default; can also be overridden in calls to the key manager constructor.
final String org.ccnx.ccn.config.UserConfiguration.CCNX_PUBLISH_KEYS_PROPERTY [static, protected] |
"org.ccnx.config.PublishKeys"
Property and variable to control whether we publish keys or not.
final String org.ccnx.ccn.config.UserConfiguration.CCNX_SAVE_KEY_CACHE_PROPERTY = "org.ccnx.config.SaveKeyCache" [static, protected] |
Variable to control whether key cache is saved on request and reloaded on startup.
See CCNX_USE_KEY_CONFIGURATION_PROPERTY.
final String org.ccnx.ccn.config.UserConfiguration.CCNX_USE_KEY_CONFIGURATION_PROPERTY = "org.ccnx.config.UseKeyConfiguration" [static, protected] |
Property and variable to control whether we load/can set user's key-related configuration (key locators, key cache, etc).
Key cache saving and loading is additionally handled below -- both this variable and that one need to be set to true to automatically save and load the key cache; if CCNX_SAVE_KEY_CACHE_CONFIGURATION_PROPERTY is true but this CCNX_USE_KEY_CONFIGURATION_PROPERTY is false, then users can manually save and load the key cache, but it will not be handled automatically on startup.
final String org.ccnx.ccn.config.UserConfiguration.CCNX_USER_CONFIG_DIR_PROPERTY [static, protected] |
"org.ccnx.config.CCNxDir"
Directory (subdirectory of User.home) where all user metadata is kept.
Property/environment variable to set the user configuration directory (full path).
final String org.ccnx.ccn.config.UserConfiguration.CCNX_USER_NAME_PROPERTY [static, protected] |
"org.ccnx.config.UserName"
User friendly name, by default user.name Java property.
final String org.ccnx.ccn.config.UserConfiguration.CCNX_USER_NAMESPACE_PREFIX_PROPERTY [static, protected] |
"org.ccnx.config.UserNamespacePrefix"
User namespace, by default ccnxNamespace()/<DEFAULT_USER_NAMESPACE_MARKER>/userName(); the user namespace prefix will be set to the value given here -- so the user namespace will be userNamespacePrefix()/<DEFAULT_USER_NAMESPACE_MARKER>/<user name>=""> for either a user name we are given or our default user name.
final String org.ccnx.ccn.config.UserConfiguration.CCNX_USER_NAMESPACE_PROPERTY [static, protected] |
"org.ccnx.config.UserNamespace"
User namespace, by default ccnxNamespace()/<DEFAULT_USER_NAMESPACE_MARKER>/userName(); the user namespace will be set to the value given here -- we don't add the user namespace marker or userName().
final String org.ccnx.ccn.config.UserConfiguration.DEFAULT_KEY_ALIAS = "ccnxuser" [static, protected] |
Change to all lower case.
Most OSes turn out to be non case-sensitive for this, but not all.
final String org.ccnx.ccn.config.UserConfiguration.DEFAULT_KEYSTORE_PASSWORD = "Th1s1sn0t8g00dp8ssw0rd." [static, protected] |
Currently very cheezy keystore handling.
Will improve when we can actually use java 1.6-only features.