1 1.1 christos =pod 2 1.1 christos 3 1.1 christos =head1 NAME 4 1.1 christos 5 1.1 christos i2s_ASN1_IA5STRING, 6 1.1 christos s2i_ASN1_IA5STRING, 7 1.1 christos i2s_ASN1_INTEGER, 8 1.1 christos s2i_ASN1_INTEGER, 9 1.1 christos i2s_ASN1_OCTET_STRING, 10 1.1 christos s2i_ASN1_OCTET_STRING, 11 1.1 christos i2s_ASN1_ENUMERATED, 12 1.1 christos i2s_ASN1_ENUMERATED_TABLE, 13 1.1 christos i2s_ASN1_UTF8STRING, 14 1.1 christos s2i_ASN1_UTF8STRING 15 1.1 christos - convert objects from/to ASN.1/string representation 16 1.1 christos 17 1.1 christos =head1 SYNOPSIS 18 1.1 christos 19 1.1 christos #include <openssl/x509v3.h> 20 1.1 christos 21 1.1 christos char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method, ASN1_IA5STRING *ia5); 22 1.1 christos ASN1_IA5STRING *s2i_ASN1_IA5STRING(X509V3_EXT_METHOD *method, 23 1.1 christos X509V3_CTX *ctx, const char *str); 24 1.1 christos char *i2s_ASN1_INTEGER(X509V3_EXT_METHOD *method, const ASN1_INTEGER *a); 25 1.1 christos ASN1_INTEGER *s2i_ASN1_INTEGER(X509V3_EXT_METHOD *method, const char *value); 26 1.1 christos char *i2s_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, 27 1.1 christos const ASN1_OCTET_STRING *oct); 28 1.1 christos ASN1_OCTET_STRING *s2i_ASN1_OCTET_STRING(X509V3_EXT_METHOD *method, 29 1.1 christos X509V3_CTX *ctx, const char *str); 30 1.1 christos char *i2s_ASN1_ENUMERATED(X509V3_EXT_METHOD *method, const ASN1_ENUMERATED *a); 31 1.1 christos char *i2s_ASN1_ENUMERATED_TABLE(X509V3_EXT_METHOD *method, 32 1.1 christos const ASN1_ENUMERATED *e); 33 1.1 christos 34 1.1 christos char *i2s_ASN1_UTF8STRING(X509V3_EXT_METHOD *method, 35 1.1 christos ASN1_UTF8STRING *utf8); 36 1.1 christos ASN1_UTF8STRING *s2i_ASN1_UTF8STRING(X509V3_EXT_METHOD *method, 37 1.1 christos X509V3_CTX *ctx, const char *str); 38 1.1 christos 39 1.1 christos =head1 DESCRIPTION 40 1.1 christos 41 1.1 christos These functions convert OpenSSL objects to and from their ASN.1/string 42 1.1 christos representation. This function is used for B<X509v3> extensions. 43 1.1 christos 44 1.1 christos =head1 NOTES 45 1.1 christos 46 1.1 christos The letters B<i> and B<s> in B<i2s> and B<s2i> stand for 47 1.1 christos "internal" (that is, an internal C structure) and string respectively. 48 1.1 christos So B<i2s_ASN1_IA5STRING>() converts from internal to string. 49 1.1 christos 50 1.1 christos It is the caller's responsibility to free the returned string. 51 1.1 christos In the B<i2s_ASN1_IA5STRING>() function the string is copied and 52 1.1 christos the ownership of the original string remains with the caller. 53 1.1 christos 54 1.1 christos =head1 RETURN VALUES 55 1.1 christos 56 1.1 christos B<i2s_ASN1_IA5STRING>() returns the pointer to a IA5 string 57 1.1 christos or NULL if an error occurs. 58 1.1 christos 59 1.1 christos B<s2i_ASN1_IA5STRING>() return a valid 60 1.1 christos B<ASN1_IA5STRING> structure or NULL if an error occurs. 61 1.1 christos 62 1.1 christos B<i2s_ASN1_INTEGER>() return a valid 63 1.1 christos string or NULL if an error occurs. 64 1.1 christos 65 1.1 christos B<s2i_ASN1_INTEGER>() returns the pointer to a B<ASN1_INTEGER> 66 1.1 christos structure or NULL if an error occurs. 67 1.1 christos 68 1.1 christos B<i2s_ASN1_OCTET_STRING>() returns the pointer to a OCTET_STRING string 69 1.1 christos or NULL if an error occurs. 70 1.1 christos 71 1.1 christos B<s2i_ASN1_OCTET_STRING>() return a valid 72 1.1 christos B<ASN1_OCTET_STRING> structure or NULL if an error occurs. 73 1.1 christos 74 1.1 christos B<i2s_ASN1_ENUMERATED>() return a valid 75 1.1 christos string or NULL if an error occurs. 76 1.1 christos 77 1.1 christos B<s2i_ASN1_ENUMERATED>() returns the pointer to a B<ASN1_ENUMERATED> 78 1.1 christos structure or NULL if an error occurs. 79 1.1 christos 80 1.1 christos B<s2i_ASN1_UTF8STRING>() return a valid 81 1.1 christos B<ASN1_UTF8STRING> structure or NULL if an error occurs. 82 1.1 christos 83 1.1 christos B<i2s_ASN1_UTF8STRING>() returns the pointer to a UTF-8 string 84 1.1 christos or NULL if an error occurs. 85 1.1 christos 86 1.1 christos =head1 HISTORY 87 1.1 christos 88 1.1 christos i2s_ASN1_UTF8STRING() and s2i_ASN1_UTF8STRING() were made public in OpenSSL 3.0. 89 1.1 christos 90 1.1 christos =head1 COPYRIGHT 91 1.1 christos 92 1.1 christos Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved. 93 1.1 christos 94 1.1 christos Licensed under the Apache License 2.0 (the "License"). You may not use 95 1.1 christos this file except in compliance with the License. You can obtain a copy 96 1.1 christos in the file LICENSE in the source distribution or at 97 1.1 christos L<https://www.openssl.org/source/license.html>. 98 1.1 christos 99 1.1 christos =cut 100