Initializes
an SSL environment.
Format
#include <gskssl.h>
gsk_status gsk_environment_init (
gsk_handle env_handle)
Parameters
- env_handle
- Specifies the SSL environment handle returned by the gsk_environment_open() routine.
Results
The function return value will be
0 (
GSK_OK) if no error is detected. Otherwise, it will be one
of the return codes listed in the
gskssl.h include file. These
are some possible errors:
- [GSK_CERTIFICATE_NOT_AVAILABLE]
- The key database, key ring or token does not contain
any certificates.
- [GSK_ERR_BAD_KEYFILE_PASSWORD]
- The key database password is not correct.
- [GSK_ERR_ICSF_FIPS_DISABLED]
- ICSF PKCS #11 services are disabled.
- [GSK_ERR_ICSF_NOT_AVAILABLE]
- ICSF services are not available.
- [GSK_ERR_ICSF_NOT_FIPS]
- ICSF PKCS #11 not operating in FIPS mode.
- [GSK_ERR_ICSF_SERVICE_FAILURE]
- ICSF callable service returned an error.
- [GSK_ERR_LDAP]
- Unable to initialize the LDAP client.
- [GSK_ERR_LDAP_NOT_AVAILABLE]
- The LDAP server is not available.
- [GSK_ERR_PERMISSION_DENIED]
- Not authorized to access key database, SAF key ring or z/OS® PKCS #11 token.
- [GSK_INSUFFICIENT_STORAGE]
- Insufficient storage is available.
- [GSK_INVALID_HANDLE]
- The environment handle is not valid.
- [GSK_INVALID_STATE]
- The environment is not in the open state.
- [GSK_KEYFILE_INVALID_FORMAT]
- The database is not a key database.
- [GSK_KEYFILE_IO_ERR]
- An input/output error occurred while reading the key database,
key ring or token.
- [GSK_KEYFILE_PASSWORD_EXPIRED]
- The key database password is expired.
- [GSK_KEYRING_OPEN_ERROR]
- Unable to open the key database, key ring or token.
- [GSK_NO_KEYFILE_PASSWORD]
- The key database password is not available.
Usage
The gsk_environment_init() routine
initializes an SSL environment created by the gsk_environment_open() routine.
After the SSL environment has been initialized, it can be used to
create one or more SSL connections by calling the gsk_secure_socket_open() routine.
The gsk_environment_close() routine should be called to close
the environment when it is no longer needed. The gsk_environment_close() routine
should also be called if an error is returned by the gsk_environment_init() routine.