X509_LOOKUP_HASH_DIR - Online Linux Manual PageSection : 3
Updated : 2021-03-26
Source : 1.1.1k
Note : OpenSSL

NAMEX509_LOOKUP_hash_dir, X509_LOOKUP_file, X509_load_cert_file, X509_load_crl_file, X509_load_cert_crl_file − Default OpenSSL certificate lookup methods

SYNOPSIS​ #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);

DESCRIPTIONX509_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 FILETYPE_PEM, FILETYPE_ASN1 and ​FILETYPE_DEFAULT. They load certificates and/or CRLs from specified file into memory cache of X509_STORE objects which given ctx parameter is associated with. Functions X509_load_cert_file and ​X509_load_crl_file can load both PEM and DER formats depending of type value. Because DER format cannot contain more than one certificate or CRL object (while PEM can contain several concatenated PEM objects)X509_load_cert_crl_file with FILETYPE_ASN1 is equivalent to ​X509_load_cert_file. Constant FILETYPE_DEFAULT with NULL filename causes these functions to load default certificate store file (see ​X509_STORE_set_default_paths(3). 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 MethodThe 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 ASCII text which contains concatenated PEM certificates and CRLs. This method should be used by applications which work with a small set of CAs.

Hashed Directory MethodX509_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 CRL per file in PEM format, with a filename of the form hash.N for a certificate, or ​hash.rN for a CRL. The hash is the value returned by the X509_NAME_hash(3) function applied to the subject name for certificates or issuer name for CRLs. The hash can also be obtained via the −hash option of the x509(1) or ​crl(1) commands. The .N or .rN suffix is a sequence number that starts at zero, and is incremented consecutively for each certificate or CRL with the same hash value. Gaps in the sequence numbers are not supported, it is assumed that there are no more objects with the same hash beyond the first missing number in the sequence. 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 CRL for given hash value is loaded, hash_dir lookup method checks only for certificates with sequence number greater than that of the already cached CRL. 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.

RETURN VALUESX509_LOOKUP_hash_dir() and X509_LOOKUP_file() always return a valid ​X509_LOOKUP_METHOD structure. X509_load_cert_file(), X509_load_crl_file() and X509_load_cert_crl_file() return the number of loaded objects or 0 on error.

SEE ALSOPEM_read_PrivateKey(3), ​X509_STORE_load_locations(3), ​X509_store_add_lookup(3), ​SSL_CTX_load_verify_locations(3), ​X509_LOOKUP_meth_new(3),

COPYRIGHTCopyright 2015−2020 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 LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.
0
Johanes Gumabo
Data Size   :   15,958 byte
man-X509_load_cert_file.3sslBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   4 / 171,722
Visitor ID   :     :  
Visitor IP   :   3.23.101.75   :  
Visitor Provider   :   AMAZON-02   :  
Provider Position ( lat x lon )   :   39.962500 x -83.006100   :   x
Provider Accuracy Radius ( km )   :   1000   :  
Provider City   :   Columbus   :  
Provider Province   :   Ohio ,   :   ,
Provider Country   :   United States   :  
Provider Continent   :   North America   :  
Visitor Recorder   :   Version   :  
Visitor Recorder   :   Library   :  
Online Linux Manual Page   :   Version   :   Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page   :   Library   :   lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page   :   Library   :   lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base   :   Version   :   Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base   :   Library   :   lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36

Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.

ERROR : Need New Coding :         (parse_manual_page_|249|X___509_load_cert_crl_file.3ssl|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|X___509_load_cert_crl_file.3ssl|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|X___509_load_cert_crl_file.3ssl|43|br══─}─══|'br══─}─══ )         (htmlprn|149|X___509_load_cert_crl_file.3ssl|43|'br══─}─══ |'br══─}─══ )