/// <summary>
        /// Create a new IdentityManager to use the given IdentityStorage and
        /// the default PrivateKeyStorage for your system, which is
        /// OSXPrivateKeyStorage for OS X, otherwise FilePrivateKeyStorage.
        /// </summary>
        ///
        /// <param name="identityStorage">An object of a subclass of IdentityStorage.</param>
        public IdentityManager(IdentityStorage identityStorage)
        {
            ConfigFile config;
            try {
                config = new ConfigFile();
            } catch (IOException ex) {
                throw new SecurityException("IOException " + ex.Message);
            }

            String[] canonicalTpmLocator = new String[] { null };
            identityStorage_ = identityStorage;
            privateKeyStorage_ = getDefaultPrivateKeyStorage(config,
                    canonicalTpmLocator);

            checkTpm(canonicalTpmLocator[0]);
        }
        /// <summary>
        /// Get the PrivateKeyStorage from the tpm value in the configuration file if
        /// supplied. Otherwise, get the default for this platform.
        /// </summary>
        ///
        /// <param name="config">The configuration file to check.</param>
        /// <param name="canonicalTpmLocator"></param>
        /// <returns>A new PrivateKeyStorage.</returns>
        private static PrivateKeyStorage getDefaultPrivateKeyStorage(
				ConfigFile config, String[] canonicalTpmLocator)
        {
            String tpmLocator = config.get("tpm", "");

            if (tpmLocator.equals("")) {
                // Use the system default.
                if (System.Environment.GetEnvironmentVariable("os.name").equals("Mac OS X")) {
                    canonicalTpmLocator[0] = "tpm-osxkeychain:";
                    throw new SecurityException(
                            "OSXPrivateKeyStorage is not implemented yet. You must create an IdentityManager with a different PrivateKeyStorage.");
                } else {
                    canonicalTpmLocator[0] = "tpm-file:";
                    return new FilePrivateKeyStorage();
                }
            } else if (tpmLocator.equals("tpm-osxkeychain")) {
                canonicalTpmLocator[0] = "tpm-osxkeychain:";
                throw new SecurityException(
                        "OSXPrivateKeyStorage is not implemented yet. You must create an IdentityManager with a different PrivateKeyStorage.");
            } else if (tpmLocator.equals("tpm-file")) {
                // Don't support non-default locations for now.
                canonicalTpmLocator[0] = "tpm-file:";
                return new FilePrivateKeyStorage();
            } else
                throw new SecurityException("Invalid config file tpm value: "
                        + tpmLocator);
        }
        /// <summary>
        /// Get the IdentityStorage from the pib value in the configuration file if
        /// supplied. Otherwise, get the default for this platform.
        /// </summary>
        ///
        /// <param name="config">The configuration file to check.</param>
        /// <returns>A new IdentityStorage.</returns>
        private static IdentityStorage getDefaultIdentityStorage(ConfigFile config)
        {
            String pibLocator = config.get("pib", "");

            if (!pibLocator.equals("")) {
                // Don't support non-default locations for now.
                if (!pibLocator.equals("pib-sqlite3"))
                    throw new SecurityException("Invalid config file pib value: "
                            + pibLocator);
            }

            return new BasicIdentityStorage();
        }