S2I_ASN1_IA5STRING(3ossl)
β¨ S2I_ASN1_IA5STRING β¨
okay bestie, welcome to the OpenSSL corner of the manual, section 3ossl. this page is literally about converting objects back and forth between their ASN.1 selves and their string selves. it's giving translator energy π
πΈ NAME πΈ
no cap, this page covers a whole lil squad of functions:
i2s_ASN1_IA5STRINGs2i_ASN1_IA5STRINGi2s_ASN1_INTEGERs2i_ASN1_INTEGERi2s_ASN1_OCTET_STRINGs2i_ASN1_OCTET_STRINGi2s_ASN1_ENUMERATEDi2s_ASN1_ENUMERATED_TABLEi2s_ASN1_UTF8STRINGs2i_ASN1_UTF8STRING
and what do they all do? they convert objects from/to ASN.1/string representation. periodt.
π SYNOPSIS π
#include <openssl/x509v3.h>
char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5);
ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, const char *str);
char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, const ASN1_INTEGER *a);
ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value);
char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
const ASN1_OCTET_STRING *oct);
ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, const char *str);
char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *a);
char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method,
const ASN1_ENUMERATED *e);
char *i2s_ASN1_UTF8STRING(X509V3_EXT_METHOD *method,
ASN1_UTF8STRING *utf8);
ASN1_UTF8STRING *s2i_ASN1_UTF8STRING(X509V3_EXT_METHOD *method,
X509V3_CTX *ctx, const char *str);
like, that's the whole lineup, go off π
π¦ DESCRIPTION π¦
so here's the tea: these functions convert OpenSSL objects to and from their ASN.1/string representation. and who's using them? X509v3 extensions, that's who. it's their whole moment. π₯
π NOTES π
okay so the letters i and s in i2s and s2i stand for "internal" (aka an internal C structure) and string respectively. so i2s_ASN1_IA5STRING() converts from internal to string. iykyk π
and this part matters, bestie: it is the caller's responsibility to free the returned string. in the i2s_ASN1_IA5STRING() function the string is copied and the ownership of the original string remains with the caller. so don't be out here freeing stuff you don't own, that's not the vibe π
β RETURN VALUES β
one by one, no skipping, we love a thorough queen:
i2s_ASN1_IA5STRING()β returns the pointer to a IA5 string orNULLif an error occurs.s2i_ASN1_IA5STRING()β return a validASN1_IA5STRINGstructure orNULLif an error occurs.i2s_ASN1_INTEGER()β return a valid string orNULLif an error occurs.s2i_ASN1_INTEGER()β returns the pointer to aASN1_INTEGERstructure orNULLif an error occurs.i2s_ASN1_OCTET_STRING()β returns the pointer to aOCTET_STRINGstring orNULLif an error occurs.s2i_ASN1_OCTET_STRING()β return a validASN1_OCTET_STRINGstructure orNULLif an error occurs.i2s_ASN1_ENUMERATED()β return a valid string orNULLif an error occurs.s2i_ASN1_ENUMERATED()β returns the pointer to aASN1_ENUMERATEDstructure orNULLif an error occurs.s2i_ASN1_UTF8STRING()β return a validASN1_UTF8STRINGstructure orNULLif an error occurs.i2s_ASN1_UTF8STRING()β returns the pointer to a UTF-8 string orNULLif an error occurs.
the way it's NULL on error every single time... consistent icon behavior, we stan π«Ά
π HISTORY π
i2s_ASN1_UTF8STRING() and s2i_ASN1_UTF8STRING() were made public in OpenSSL 3.0. glow up fr fr β¨
π COPYRIGHT π
Copyright 2020-2021 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 link right there? that's the only link this page gets, and it's staying, because rules are rules π
and that's a wrap, bestie π this page was served to you from version 3.5.9, dated 2026-09-29, and its whole manual name is S2I_ASN1_IA5STRING(3ossl). go forth and convert responsibly πΈπ¦π
π¦ where this page comes from
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 43: openssl-devel 1:3.5.9-1.fc43 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- fedora 44: openssl-devel 1:3.5.9-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms