OCSP_CERT_TO_ID(3ossl)

πŸ“¦ version 3.5.0, in opensuse-leap 16.0

πŸŽ€ OCSP_CERT_TO_ID(3ossl) πŸŽ€

okay bestie, welcome to the 3ossl manual page for the OCSP certificate ID utility functions. It’s giving deeply specific crypto plumbing, but we’re gonna make it make sense ✨


✨ NAME ✨

OCSP_cert_to_id, OCSP_cert_id_new, OCSP_CERTID_free, OCSP_id_issuer_cmp, OCSP_id_cmp, OCSP_id_get0_info β€” the OCSP certificate ID utility functions. Periodt.


🌸 SYNOPSIS 🌸

#include <openssl/ocsp.h>

OCSP_CERTID *OCSP_cert_to_id(const EVP_MD *dgst,
                             X509 *subject, X509 *issuer);

OCSP_CERTID *OCSP_cert_id_new(const EVP_MD *dgst,
                              X509_NAME *issuerName,
                              ASN1_BIT_STRING *issuerKey,
                              ASN1_INTEGER *serialNumber);

void OCSP_CERTID_free(OCSP_CERTID *id);

int OCSP_id_issuer_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);
int OCSP_id_cmp(const OCSP_CERTID *a, const OCSP_CERTID *b);

int OCSP_id_get0_info(ASN1_OCTET_STRING **piNameHash, ASN1_OBJECT **pmd,
                      ASN1_OCTET_STRING **pikeyHash,
                      ASN1_INTEGER **pserial, OCSP_CERTID *cid);

πŸ¦‹ DESCRIPTION πŸ¦‹

  • OCSP_cert_to_id() β€” creates and returns a new OCSP_CERTID structure using message digest dgst for certificate subject with issuer issuer. If dgst is NULL, then SHA1 is used. Yep, that’s the fallback πŸ’…
  • OCSP_cert_id_new() β€” creates and returns a new OCSP_CERTID using dgst and issuer name issuerName, issuer key hash issuerKey, and serial number serialNumber.
  • OCSP_CERTID_free() β€” frees up id. If the argument is NULL, nothing is done. Very β€œno thoughts, head empty” of it πŸ™ˆ
  • OCSP_id_cmp() β€” compares OCSP_CERTID a and b.
  • OCSP_id_issuer_cmp() β€” compares only the issuer name of OCSP_CERTID a and b.
  • OCSP_id_get0_info() β€” returns the issuer name hash, hash OID, issuer key hash, and serial number contained in cid. If any of the values are not required, the corresponding parameter can be set to NULL.

πŸ”₯ RETURN VALUES πŸ”₯

  • OCSP_cert_to_id() and OCSP_cert_id_new() β€” return either a pointer to a valid OCSP_CERTID structure or NULL if an error occurred.
  • OCSP_id_cmp() and OCSP_id_issuer_cmp() β€” return zero for a match and nonzero otherwise. Zero means match, iconic behavior honestly ✨
  • OCSP_CERTID_free() β€” does not return a value.
  • OCSP_id_get0_info() β€” returns 1 for success and 0 for failure.

πŸ’€ NOTES πŸ’€

OCSP clients will typically only use OCSP_cert_to_id() or OCSP_cert_id_new(): the other functions are used by responder applications. So if you’re on the client side, those two are your main characters πŸ’–

⚠️ big warning bestie: the values returned by OCSP_id_get0_info() are internal pointers and MUST NOT be freed up by an application: they will be freed when the corresponding OCSP_CERTID structure is freed. Do NOT free them yourself. That is not your moment πŸ™…β€β™€οΈ

🌈 SEE ALSO 🌈


Copyright 2015-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 page, bestie β€” OpenSSL 3.5.0, dated 2026-09-25, OCSP_CERT_TO_ID(3ossl) signing off. slay πŸ’…βœ¨

πŸ“¦ where this page comes from