oid.h(3)

📦
version 2.2.0 · 2 versions
, in fedora 44

🎀 oid.h(3) — NAME 🎀

Okay so this is the manual page for oid.h from the Library Functions Manual (yes bestie, that's the manual name, very C-library-coded of it), and it's all about Идентификаторы объектов — object identifiers, a.k.a. OIDs, the little dotted-number strings. We're obsessed. 💖


🌈 SYNOPSIS 🌈

#include 'bee2/defs.h'

✨ Функции ✨

  • bool_t oidIsValid (const char *oid) — is this OID even valid?? a vibe check, basically.
  • size_t oidToDER (octet der[], const char *oid) — DER-encoding, slay.
  • size_t oidFromDER (char *oid, const octet buf[], size_t count) — DER-decoding, the reverse queen.

🦋 Подробное описание 🦋

An object identifier (идентификатор объекта) is literally just a sequence of non-negative integers d1, d2, .., dn. That's it. That's the whole thing.

An OID gets represented as a string built out of the consecutive numbers d1, d2, ..., dn, separated by dots. Each number di is written with decimal digits and no leading zeros — none, zero, zip. Which means the string representation ends up being unambiguous. One string, one OID, no confusion, no drama. 💅

A valid identifier "d1.d2....dn" has to satisfy these ASN.1 constraints:

  • n >= 2;
  • d1 <= 2;
  • if d1 < 2, then d2 < 40.

And then there's the extra implementation-level constraints, because of course there are:

  • the number 40 * d1 + d2 has to fit in u32;
  • the numbers di have to fit in u32.

Examples of identifiers (see СТБ 34.101.50), because examples are the moment:

  • "1.2.112" — the root identifier of РБ;
  • "1.2.112.0.2" — the standards of РБ;
  • "1.2.112.0.2.0" — СТБ.

🌸 Регулярность 🌸

The functions of this module are нерегулярны (irregular) — meaning the identifiers being processed are not considered secret. Nothing to hide here, it's all public, no cap.

🌸 Предусловие 🌸

The input buffers must not overlap. Not even a little. Keep them separate, bestie. 🙈


👑 Функции 👑

💜 size_t oidFromDER (char * oid, const octet buf[], size_t count)

This one figures out the number of characters (not counting the terminating null, obviously) needed to hold the identifier that's represented by the DER code [count]der. And if oid != 0, then the identifier actually gets placed at that address. Cute.

Предусловие If oid != 0, then oidFromDER(0, buf, count) octets have been reserved at the address oid.

Возвращает The number of characters — or SIZE_MAX if the format is busted. 😭

Аргументы

  • oid — идентификатор объекта (the object identifier)
  • buf — the DER code
  • count — the length of the DER code

💜 bool_t oidIsValid (const char * oid)

Checks whether the identifier oid is valid. That's the whole job. Simple. Iconic.

Возвращает The validity flag — признак корректности.

Аргументы

  • oid — идентификатор объекта (the object identifier)

💜 size_t oidToDER (octet der[], const char * oid)

This one determines the number of octets in the DER code of the identifier oid. And if der != 0, the DER code gets placed at that address. Mirror image energy. 🪞

Предусловие If der != 0, then oidToDER(0, oid) octets have been reserved at the address der.

Возвращает The number of octets in the DER code — or SIZE_MAX if the format of oid is wrong.

Прим. An octet of the tag is formed. (Формируется октет тега.)

Аргументы

  • der — the DER code
  • oid — идентификатор объекта (the object identifier)

🌟 Автор 🌟

Automatically generated by Doxygen for the Библиотека Bee2, straight from the source text. The robots did this one, and honestly? They ate. 🤖✨


And that's a wrap, bestie — this page came to you courtesy of Библиотека Bee2, dated Вс 25 Янв 2026 00:00:00, filed under oid.h(3). Go forth and validate those dotted numbers. Periodt. 💖🎀🦋

📦 where this page comes from