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