Hide OPENSSL_INIT_SETTINGS.
[openssl.git] / doc / crypto / OPENSSL_init_crypto.pod
index 943f44c2539d4148f1caefcee380db34f9059642..4da655167c391063c9cbd7fa724e248e42211c10 100644 (file)
@@ -15,6 +15,10 @@ initialisation and deinitialisation functions
  int OPENSSL_atexit(void (*handler)(void));
  void OPENSSL_thread_stop(void);
 
  int OPENSSL_atexit(void (*handler)(void));
  void OPENSSL_thread_stop(void);
 
+ OPENSSL_INIT_SETTINGS *OPENSSL_init_new(void);
+ OPENSSL_INIT_set_config_filename(OPENSSL_INIT_SETTINGS *init, const char* name);
+ OPENSSL_INIT_free(OPENSSL_INIT_SETTINGS *init);
+
 =head1 DESCRIPTION
 
 During normal operation OpenSSL (libcrypto) will allocate various resources at
 =head1 DESCRIPTION
 
 During normal operation OpenSSL (libcrypto) will allocate various resources at
@@ -90,6 +94,7 @@ B<OPENSSL_INIT_ADD_ALL_DIGESTS> will be ignored.
 
 With this option an OpenSSL configuration file will be automatically loaded and
 used by calling OPENSSL_config(). This is not a default option.
 
 With this option an OpenSSL configuration file will be automatically loaded and
 used by calling OPENSSL_config(). This is not a default option.
+See the description of OPENSSL_init_new(), below.
 
 =item OPENSSL_INIT_NO_LOAD_CONFIG
 
 
 =item OPENSSL_INIT_NO_LOAD_CONFIG
 
@@ -151,23 +156,6 @@ OPENSSL_init_crypto(). For example:
  OPENSSL_init_crypto(OPENSSL_INIT_NO_ADD_ALL_CIPHERS
                      | OPENSSL_INIT_NO_ADD_ALL_DIGESTS, NULL);
 
  OPENSSL_init_crypto(OPENSSL_INIT_NO_ADD_ALL_CIPHERS
                      | OPENSSL_INIT_NO_ADD_ALL_DIGESTS, NULL);
 
-
-The B<settings> parameter to OPENSSL_init_crypto() may be used to provide
-optional settings values to an option. Currently the only option this
-applies to is OPENSSL_INIT_LOAD_CONFIG. This provides the optional
-OPENSSL_INIT_SET_CONF_FILENAME parameter to provide a filename to load
-configuration from. If no filename is provided then the system default
-configuration file is assumed. For example
-
- const OPENSSL_INIT_SETTINGS settings[2] = {
-     { OPENSSL_INIT_SET_CONF_FILENAME, .value.type_string = "myconf.cnf" },
-     { OPENSSL_INIT_SET_END, .value.type_int = 0 }
- };
- OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, settings);
-
-The B<settings> parameter must be an array of OPENSSL_INIT_SETTINGS values
-terminated with an OPENSSL_INIT_SET_END entry.
-
 The OPENSSL_cleanup() function deinitialises OpenSSL (both libcrypto
 and libssl). All resources allocated by OpenSSL are freed. Typically there
 should be no need to call this function directly as it is initiated
 The OPENSSL_cleanup() function deinitialises OpenSSL (both libcrypto
 and libssl). All resources allocated by OpenSSL are freed. Typically there
 should be no need to call this function directly as it is initiated
@@ -199,6 +187,13 @@ the library when the thread exits. This should only be called directly if
 resources should be freed at an earlier time, or under the circumstances
 described in the NOTES section below.
 
 resources should be freed at an earlier time, or under the circumstances
 described in the NOTES section below.
 
+The B<OPENSSL_INIT_LOAD_CONFIG> flag will load a default configuration
+file.  To specify a different file, an B<OPENSSL_INIT_SETTINGS> must
+be created and used. The routines
+OPENSSL_init_new() and OPENSSL_INIT_set_config_filename() can be used to
+allocate the object and set the configuration filename, and then the
+object can be released with OPENSSL_INIT_free() when done.
+
 =head1 NOTES
 
 Resources local to a thread are deallocated automatically when the thread exits
 =head1 NOTES
 
 Resources local to a thread are deallocated automatically when the thread exits