X509_GET0_DISTINGUISHING_ID(3SSL)
π X509_GET0_DISTINGUISHING_ID π
okay bestie, welcome to the 3SSL girlies club β¨ this is the OpenSSL manual page for the Distinguishing ID getters and setters, and yes we are gonna get into it.
πΈ NAME πΈ
X509_get0_distinguishing_id, X509_set0_distinguishing_id, X509_REQ_get0_distinguishing_id, X509_REQ_set0_distinguishing_id β get or set the Distinguishing ID for certificate operations π
β¨ SYNOPSIS β¨
#include <openssl/x509.h>
const ASN1_OCTET_STRING *X509_get0_distinguishing_id(const X509 *x);
void X509_set0_distinguishing_id(X509 *x, ASN1_OCTET_STRING *distid);
ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x);
void X509_REQ_set0_distinguishing_id(X509_REQ *x, ASN1_OCTET_STRING *distid);
π¦ DESCRIPTION π¦
So. The Distinguishing ID is defined in FIPS 196, and here's the vibe, quoted for accuracy:
Distinguishing identifier Information which unambiguously distinguishes an entity in the authentication process.
The SM2 signature algorithm requires a Distinguishing ID value when it's generating and verifying a signature, but the Distinguishing ID may also find other uses. In the context of SM2, the Distinguishing ID is often referred to as the "SM2 ID". iykyk π
For the purpose of verifying a certificate or a certification request, a Distinguishing ID may be attached to it, so functions like X509_verify(3) or X509_REQ_verify(3) have easy access to that identity for signature verification. it's giving convenience, honestly π«Ά
Okay now the actual functions:
X509_get0_distinguishing_id()β gets the Distinguishing ID value of a certificatexby returning anASN1_OCTET_STRINGobject which should not be freed by the caller. not yours, don't touch it, hands off bestie πX509_set0_distinguishing_id()β assignsdistidto the certificatex. Calling this function transfers the memory management of the value to theX509object, and therefore the value that has been passed in should not be freed by the caller after this function has been called. so likeβ¦ theX509owns it now. it's their child. you cannot free it. periodt πX509_REQ_get0_distinguishing_id()andX509_REQ_set0_distinguishing_id()β same functionality asX509_get0_distinguishing_id()andX509_set0_distinguishing_id()except that they deal withX509_REQobjects instead ofX509. same energy, different struct π
π RETURN VALUES π
X509_set0_distinguishing_id() and X509_REQ_set0_distinguishing_id() do not return a value. that's it. that's the whole section. void. nothing. silence. the void staring back π
π SEE ALSO π
π COPYRIGHT π
Copyright 2019-2026 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>.
okay that's the whole page, no cap π this was version 4.0.3, dated 2026-09-29, straight from the X509_GET0_DISTINGUISHING_ID(3SSL) files π slay, go verify some signatures, mwah π¦β¨
π¦ where this page comes from
- ubuntu stonking: libssl-doc 4.0.3-1ubuntu1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms