X509_LOOKUP_hash_dir (3)
Leading comments
Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) Standard preamble: ========================================================================
NAME
X509_LOOKUP_hash_dir, X509_LOOKUP_file, X509_load_cert_file, X509_load_crl_file, X509_load_cert_crl_file - Default OpenSSL certificate lookup methodsSYNOPSIS
#include <openssl/x509_vfy.h> X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); X509_LOOKUP_METHOD *X509_LOOKUP_file(void); int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
DESCRIPTION
X509_LOOKUP_hash_dir and X509_LOOKUP_file are two certificate lookup methods to use with X509_STORE, provided by OpenSSL library.Users of the library typically do not need to create instances of these methods manually, they would be created automatically by X509_STORE_load_locations(3) or SSL_CTX_load_verify_locations(3) functions.
Internally loading of certificates and CRLs is implemented via functions X509_load_cert_crl_file, X509_load_cert_file and X509_load_crl_file. These functions support parameter type, which can be one of constants
Functions X509_load_cert_file and X509_load_crl_file can load both
Constant
Functions return number of objects loaded from file or 0 in case of error.
Both methods support adding several certificate locations into one X509_STORE.
This page documents certificate store formats used by these methods and caching policy.
File Method
The X509_LOOKUP_file method loads all the certificates or CRLs present in a file into memory at the time the file is added as a lookup source.File format is
This method should be used by applications which work with a small set of CAs.
Hashed Directory Method
X509_LOOKUP_hash_dir is a more advanced method, which loads certificates and CRLs on demand, and caches them in memory once they are loaded. As of OpenSSL 1.0.0, it also checks for newer CRLs upon each lookup, so that newer CRLs are as soon as they appear in the directory.The directory should contain one certificate or
The .N or .rN suffix is a sequence number that starts at zero, and is incremented consecutively for each certificate or
Sequence numbers make it possible for the directory to contain multiple certificates with same subject name hash value. For example, it is possible to have in the store several certificates with same subject or several CRLs with same issuer (and, for example, different validity period).
When checking for new CRLs once one
Note that the hash algorithm used for subject name hashing changed in OpenSSL 1.0.0, and all certificate stores have to be rehashed when moving from OpenSSL 0.9.8 to 1.0.0.
OpenSSL includes a rehash(1) utility which creates symlinks with correct hashed names for all files with .pem suffix in a given directory.
SEE ALSO
PEM_read_PrivateKey(3), X509_STORE_load_locations(3), X509_store_add_lookup(3), SSL_CTX_load_verify_locations(3),COPYRIGHT
Copyright 2015-2017 The OpenSSL Project Authors. All Rights Reserved.Licensed under the OpenSSL license (the ``License''). You may not use this file except in compliance with the License. You can obtain a copy in the file