1.\" $OpenBSD: ASN1_UNIVERSALSTRING_to_string.3,v 1.1 2021/11/15 13:39:40 schwarze Exp $ 2.\" 3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: November 15 2021 $ 18.Dt ASN1_UNIVERSALSTRING_TO_STRING 3 19.Os 20.Sh NAME 21.Nm ASN1_UNIVERSALSTRING_to_string 22.Nd recode UTF-32 to ISO Latin-1 23.Sh SYNOPSIS 24.In openssl/asn1.h 25.Ft int 26.Fo ASN1_UNIVERSALSTRING_to_string 27.Fa "ASN1_UNIVERSALSTRING *string" 28.Fc 29.Sh DESCRIPTION 30.Fn ASN1_UNIVERSALSTRING_to_string 31assumes that the given 32.Fa string 33is encoded in UTF-32, recodes it in place to ISO Latin-1, 34and changes the type according to 35.Xr ASN1_PRINTABLE_type 3 . 36.Pp 37.Fn ASN1_UNIVERSALSTRING_to_string 38fails and leaves the 39.Fa string 40unchanged if its 41.Xr ASN1_STRING_type 3 42is not 43.Dv V_ASN1_UNIVERSALSTRING , 44if its 45.Xr ASN1_STRING_length 3 46is not a multiple of four bytes, 47or if any of its characters cannot be represented in ISO Latin-1. 48.Pp 49In case of success, the 50.Xr ASN1_STRING_length 3 51of the 52.Fa string 53is reduced by a factor of four. 54.Sh RETURN VALUES 55.Fn ASN1_UNIVERSALSTRING_to_string 56returns 1 on success or 0 on failure. 57.Sh SEE ALSO 58.Xr ASN1_mbstring_copy 3 , 59.Xr ASN1_STRING_new 3 , 60.Xr ASN1_STRING_to_UTF8 3 61.Sh HISTORY 62.Fn ASN1_UNIVERSALSTRING_to_string 63first appeared in SSLeay 0.8.0 and has been available since 64.Ox 2.4 . 65