X509_ACERT_G...ER_BASECERTID(3SSL)
π NAME π
X509_ACERT_get0_holder_baseCertId, X509_ACERT_get0_holder_digest, X509_ACERT_get0_holder_entityName, X509_ACERT_set0_holder_baseCertId, X509_ACERT_set0_holder_digest, X509_ACERT_set0_holder_entityName, OSSL_ISSUER_SERIAL_get0_issuer, OSSL_ISSUER_SERIAL_get0_issuerUID, OSSL_ISSUER_SERIAL_get0_serial, OSSL_ISSUER_SERIAL_set1_issuer, OSSL_ISSUER_SERIAL_set1_issuerUID, OSSL_ISSUER_SERIAL_set1_serial, OSSL_OBJECT_DIGEST_INFO_get0_digest, OSSL_OBJECT_DIGEST_INFO_set1_digest β bestie, this is the manual page for getting and setting Attribute Certificate holder fields. It lives in the OpenSSL 3SSL manual section, and we're gonna walk through it together. π
β¨ SYNOPSIS β¨
#include <openssl/x509_acert.h>
const GENERAL_NAMES *X509_ACERT_get0_holder_entityName(const X509_ACERT *x);
OSSL_ISSUER_SERIAL *X509_ACERT_get0_holder_baseCertId(const X509_ACERT *x);
OSSL_OBJECT_DIGEST_INFO * X509_ACERT_get0_holder_digest(const X509_ACERT *x);
void X509_ACERT_set0_holder_entityName(X509_ACERT *x, GENERAL_NAMES *name);
void X509_ACERT_set0_holder_baseCertId(X509_ACERT *x, OSSL_ISSUER_SERIAL *isss);
void X509_ACERT_set0_holder_digest(X509_ACERT *x,
OSSL_OBJECT_DIGEST_INFO *dinfo);
X509_NAME *OSSL_ISSUER_SERIAL_get0_issuer(OSSL_ISSUER_SERIAL *isss);
ASN1_INTEGER *OSSL_ISSUER_SERIAL_get0_serial(OSSL_ISSUER_SERIAL *isss);
ASN1_BIT_STRING *OSSL_ISSUER_SERIAL_get0_issuerUID(OSSL_ISSUER_SERIAL *isss);
int OSSL_ISSUER_SERIAL_set1_issuer(OSSL_ISSUER_SERIAL *isss, X509_NAME *issuer);
int OSSL_ISSUER_SERIAL_set1_serial(OSSL_ISSUER_SERIAL *isss, ASN1_INTEGER *serial);
int OSSL_ISSUER_SERIAL_set1_issuerUID(OSSL_ISSUER_SERIAL *isss, ASN1_BIT_STRING *uid);
void OSSL_OBJECT_DIGEST_INFO_get0_digest(OSSL_OBJECT_DIGEST_INFO *o,
ASN1_ENUMERATED **digestedObjectType,
X509_ALGOR **digestAlgorithm,
ASN1_BIT_STRING **digest);
void OSSL_OBJECT_DIGEST_INFO_set1_digest(OSSL_OBJECT_DIGEST_INFO *o,
ASN1_ENUMERATED *digestedObjectType,
X509_ALGOR *digestAlgorithm,
ASN1_BIT_STRING *digest);
πΈ DESCRIPTION πΈ
So these routines are the whole "who even IS the holder" situation for an X509 attribute certificate. Get and set, that's the vibe. π
X509_ACERT_set0_holder_entityName() sets the identity as a GENERAL_NAME name. X509_ACERT_set0_holder_baseCertId() sets the identity based on the issuer and serial number of a certificate detailed in isss. And X509_ACERT_set0_holder_digest() sets the holder entity based on digest information dinfo.
Now, real talk: RFC 5755 section 4.2.2 recommends that only one of the above methods be used to set the holder identity for a given attribute certificate x β but the way this actually works, setting multiple methods at the same time is possible. π And if you go and specify conflicting identity information using different methods, it is up to the application to handle those cases. That's on you, bestie. Not the library's problem.
Wanna peek at what's already inside? Pointers to the internal structures describing the holder identity of attribute certificate x can be retrieved with X509_ACERT_get0_holder_entityName(), X509_ACERT_get0_holder_baseCertId(), and X509_ACERT_get0_holder_digest().
An OSSL_ISSUER_SERIAL object holds the subject name and UID of a certificate issuer, plus a certificate's serial number. Iconic little bundle, honestly. π«Ά
OSSL_ISSUER_SERIAL_set1_issuer(), OSSL_ISSUER_SERIAL_set1_issuerUID(), and OSSL_ISSUER_SERIAL_set1_serial() respectively copy these values into the OSSL_ISSUER_SERIAL structure β the application is responsible for freeing its own copy of these values after use. Don't forget that part, fr fr. π§
OSSL_ISSUER_SERIAL_get0_issuer(), OSSL_ISSUER_SERIAL_get0_issuerUID(), and OSSL_ISSUER_SERIAL_get0_serial() return pointers to these values in the object.
An OSSL_OBJECT_DIGEST_INFO object holds a digest of data to identify the attribute certificate holder. OSSL_OBJECT_DIGEST_INFO_set1_digest() sets the digest information of the object.
The type of digest information is given by digestedObjectType and can be one of:
OSSL_OBJECT_DIGEST_INFO_PUBLIC_KEYβ hash of a public key πOSSL_OBJECT_DIGEST_INFO_PUBLIC_KEY_CERTβ hash of a public key certificate πOSSL_OBJECT_DIGEST_INFO_OTHERβ hash of another object. See NOTES below. π
And digestAlgorithm indicates the algorithm used to compute digest. That's the whole tea. β¨
π RETURN VALUES π
- All
set0/set1routines return1for success and0for failure. Periodt. - All
get0functions return a pointer to the object's inner structure. π«°
β οΈ These pointers must not be freed after use. Do not free them. Not even a little. Put the free() down. π
π¦ NOTES π¦
Although the value of OSSL_OBJECT_DIGEST_INFO_OTHER is defined in RFC 5755, its use is prohibited for conformant attribute certificates. So like... it exists, but it's giving "do not do this". π
β HISTORY β
These functions were added in OpenSSL 3.4. A relatively recent glow-up, we love to see it. π
π COPYRIGHT π
Copyright 2023-2024 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>.
and that's the whole page bestie, ily, go set some holder fields responsibly π
mwah π
β this was the OpenSSL 3SSL manual, version 4.0.3, dated 2026-09-29. no cap, that's really it. πβ¨
π¦ 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