X509_CMP - Online Linux Manual PageSection : 3ossl
Updated : 2022-03-15
Source : 3.0.2
Note : OpenSSL

NAMEX509_cmp, X509_NAME_cmp, X509_issuer_and_serial_cmp, X509_issuer_name_cmp, X509_subject_name_cmp, X509_CRL_cmp, X509_CRL_match ​− compare X509 certificates and related values

SYNOPSIS​ #include <openssl/x509.h> ​ ​ int X509_cmp(const X509 *a, const X509 *b); ​ int X509_NAME_cmp(const X509_NAME *a, const X509_NAME *b); ​ int X509_issuer_and_serial_cmp(const X509 *a, const X509 *b); ​ int X509_issuer_name_cmp(const X509 *a, const X509 *b); ​ int X509_subject_name_cmp(const X509 *a, const X509 *b); ​ int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b); ​ int X509_CRL_match(const X509_CRL *a, const X509_CRL *b);

DESCRIPTIONThis set of functions are used to compare X509 objects, including X509 certificates, X509 CRL objects and various values in an X509 certificate. The X509_cmp() function compares two X509 objects indicated by parameters ​a and b. The comparison is based on the memcmp result of the hash values of two X509 objects and the canonical (DER) encoding values. The X509_NAME_cmp() function compares two X509_NAME objects indicated by parameters a and b. The comparison is based on the memcmp result of the canonical (DER) encoding values of the two objects using i2d_X509_NAME(3). This procedure adheres to the matching rules for Distinguished Names (DN) given in RFC 4517 section 4.2.15 and RFC 5280 section 7.1. In particular, the order of Relative Distinguished Names (RDNs) is relevant. On the other hand, if an RDN is multi-valued, i.e., it contains a set of AttributeValueAssertions (AVAs), its members are effectively not ordered. The X509_issuer_and_serial_cmp() function compares the serial number and issuer values in the given X509 objects a and b. The X509_issuer_name_cmp(), X509_subject_name_cmp() and X509_CRL_cmp() functions are effectively wrappers of the X509_NAME_cmp() function. These functions compare issuer names and subject names of the objects, or issuers of X509_CRL objects, respectively. The X509_CRL_match() function compares two X509_CRL objects. Unlike the ​X509_CRL_cmp() function, this function compares the whole CRL content instead of just the issuer name.

RETURN VALUESThe X509 comparison functions return −1, 0, or 1 if object a is found to be less than, to match, or be greater than object b, respectively. X509_NAME_cmp(), X509_issuer_and_serial_cmp(), X509_issuer_name_cmp(), ​X509_subject_name_cmp(), X509_CRL_cmp(), and X509_CRL_match() may return −2 to indicate an error.

NOTESThese functions in fact utilize the underlying memcmp of the C library to do the comparison job. Data to be compared varies from DER encoding data, hash value or ASN1_STRING. The sign of the comparison can be used to order the objects but it does not have a special meaning in some cases. X509_NAME_cmp() and wrappers utilize the value −2 to indicate errors in some circumstances, which could cause confusion for the applications.

SEE ALSOi2d_X509_NAME(3), i2d_X509(3)

COPYRIGHTCopyright 2019−2021 The OpenSSL Project Authors. All Rights Reserved. Licensed under the Apache License 2.0 (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   :   12,353 byte
man-X___509_cmp.3osslBuild   :   2024-12-05, 20:55   :  
Visitor Screen   :   x
Visitor Counter ( page / site )   :   2 / 236,644
Visitor ID   :     :  
Visitor IP   :   3.147.205.114   :  
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_cmp.3ossl|36/37|el══─{─══.|.el══─{─══. ds -- \|\(em\| )         (htmlprn|149|X___509_cmp.3ossl|36/37|.el══─{─══. ds --  —  |.el══─{─══. ds -- \|\(em\| )         (parse_manual_page_|249|X___509_cmp.3ossl|43|br══─}─══|'br══─}─══ )         (htmlprn|149|X___509_cmp.3ossl|43|'br══─}─══ |'br══─}─══ )