OCSP_CERT_TO_ID(3ossl)
π 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 newOCSP_CERTIDstructure using message digestdgstfor certificatesubjectwith issuerissuer. IfdgstisNULL, thenSHA1is used. Yep, thatβs the fallback πOCSP_cert_id_new()β creates and returns a newOCSP_CERTIDusingdgstand issuer nameissuerName, issuer key hashissuerKey, and serial numberserialNumber.OCSP_CERTID_free()β frees upid. If the argument isNULL, nothing is done. Very βno thoughts, head emptyβ of it πOCSP_id_cmp()β comparesOCSP_CERTIDaandb.OCSP_id_issuer_cmp()β compares only the issuer name ofOCSP_CERTIDaandb.OCSP_id_get0_info()β returns the issuer name hash, hash OID, issuer key hash, and serial number contained incid. If any of the values are not required, the corresponding parameter can be set toNULL.
π₯ RETURN VALUES π₯
OCSP_cert_to_id()andOCSP_cert_id_new()β return either a pointer to a validOCSP_CERTIDstructure orNULLif an error occurred.OCSP_id_cmp()andOCSP_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()β returns1for success and0for 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 byOCSP_id_get0_info()are internal pointers and MUST NOT be freed up by an application: they will be freed when the correspondingOCSP_CERTIDstructure is freed. Do NOT free them yourself. That is not your moment π ββοΈ
π SEE ALSO π
crypto(7)OCSP_request_add1_nonce(3)OCSP_REQUEST_new(3)OCSP_resp_find_status(3)OCSP_response_status(3)OCSP_sendreq_new(3)
π COPYRIGHT π
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
- opensuse-leap 16.0: openssl-3-doc 3.5.0-160000.11.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms