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