X509_GET0_DISTINGUISHING_ID(3ossl)
π X509_GET0_DISTINGUISHING_ID β ngl bestie, this is the OpenSSL 3ossl glow-up you didn't know you needed π
okay so picture this: it's giving X509_GET0_DISTINGUISHING_ID(3ossl), straight out of the OpenSSL fam, and today we're learning how to get and set the Distinguishing ID for certificate operations. yes queen, it's a whole thing and it's lowkey iconic β¨
π 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. that's the whole vibe. no notes. π
πΈ SYNOPSIS
#include <openssl/x509.h>
ASN1_OCTET_STRING *X509_get0_distinguishing_id(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);
like, copy-paste it, bestie, it's literally right there π«Ά
π¦ DESCRIPTION
so the Distinguishing ID is defined in FIPS 196 as:
Distinguishing identifier β Information which unambiguously distinguishes an entity in the authentication process.
basically it's the "who dis" of the authentication world. main character energy fr fr. π₯
the SM2 signature algorithm requires a Distinguishing ID value when generating and verifying a signature β but the Distinguishing ID may also find other uses. in the context of SM2, people often just call it the "SM2 ID". iykyk π
now here's the cute part: 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 personal assistant energy. πββοΈ
β¨ the actual functions β¨
X509_get0_distinguishing_id()β gets the Distinguishing ID value of a certificate x by returning anASN1_OCTET_STRINGobject which should not be freed by the caller. hands off, bestie, that's not yours πX509_set0_distinguishing_id()β assigns distid to the certificate x. 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. like, once you hand it over, it's not your baby anymore, it's theX509's baby πβ¨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 type. periodt. π
π RETURN VALUES
X509_set0_distinguishing_id() and X509_REQ_set0_distinguishing_id() do not return a value. nothing. void. they just do the thing and dip. π
π SEE ALSO
go read those too, bestie, they're literally in the same friend group π§
π COPYRIGHT
Copyright 2019-2020 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>.
β οΈ friendly reminder: memory management here is load-bearing. if you free a value after set0, the vibe check fails and things get spicy in the bad way. π
okay that's the whole page, hope you slayed π this was OpenSSL 3.5.6, dated 2026-04-07, and yes the header was already spoiling it β X509_GET0_DISTINGUISHING_ID(3ossl). mwah. ππΈπ¦
π¦ where this page comes from
- freebsd 15.1: base 15.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms