X509_ACERT_G...ER_BASECERTID(3ossl)

πŸ’– 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 β€” get and set Attribute Certificate holder fields ✨

okay so bestie, you're reading X509_ACERT_G...ER_BASECERTID(3ossl) and honestly? iconic topic. we're talking about the holder identity of an attribute certificate β€” who even is this cert for, yk? let's get into it 🫢


🌸 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 πŸ’…

these routines set and get the holder identity of an X509 attribute certificate. no cap.

  • 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 πŸ“œ
  • X509_ACERT_set0_holder_digest() β€” sets the holder entity based on digest information dinfo 🧚

and like… RFC 5755 section 4.2.2 recommends that you only use ONE of the above methods to set the holder identity for a given attribute certificate x. but bestie, setting multiple methods at the same time is literally possible. so it's on the application to handle cases where conflicting identity information gets specified using different methods. no one's gonna stop you, but the chaos is yours to manage πŸ’€

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(). get you a function that just hands you the pointer 🫢


✨ the OSSL_ISSUER_SERIAL moment ✨

a OSSL_ISSUER_SERIAL object holds the subject name and UID of a certificate issuer and a certificate's serial number.

  • OSSL_ISSUER_SERIAL_set1_issuer() β€” copies the issuer into the structure
  • OSSL_ISSUER_SERIAL_set1_issuerUID() β€” copies the UID into the structure
  • OSSL_ISSUER_SERIAL_set1_serial() β€” copies the serial into the structure
heads up: the application is responsible for freeing its own copy of these values after use. you brought it, you clean it up πŸ’–

and the getters:

  • OSSL_ISSUER_SERIAL_get0_issuer() β€” returns a pointer to the issuer in the object
  • OSSL_ISSUER_SERIAL_get0_issuerUID() β€” returns a pointer to the issuer UID in the object
  • OSSL_ISSUER_SERIAL_get0_serial() β€” returns a pointer to the serial in the object

πŸ¦‹ the OSSL_OBJECT_DIGEST_INFO moment πŸ¦‹

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 πŸ‘€

digestAlgorithm indicates the algorithm used to compute digest. slay. that's it, that's the field. ⭐


πŸŽ€ RETURN VALUES πŸŽ€

  • all the set0/set1 routines return 1 for success and 0 for failure βœ…
  • all the get0 functions return a pointer to the object's inner structure 🫴
do NOT free these pointers after use. they're not yours, they're the object's. respect the boundaries bestie πŸ’€

⭐ NOTES ⭐

although the value of OSSL_OBJECT_DIGEST_INFO_OTHER is defined in RFC 5755, its use is prohibited for conformant attribute certificates. it's giving "technically in the spec, absolutely not allowed". periodt. πŸ™ˆ


🌈 HISTORY 🌈

these functions were added in OpenSSL 3.4. glow up era πŸ‘‘


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>.


okay that's the whole page, bestie!! πŸ’– this was the 3.5.9 edition, dated 2026-09-2X, and yeah the manual name is lowkey a mouthful β€” X509_ACERT_G...ER_BASECERTID(3ossl) β€” but you ate that. go forth and set your holder fields responsibly, one method at a time, mwah 🫢✨🌸

πŸ“¦ where this page comes from