def get_value(self): """Get the value of this entry. :return: entry value as a python string """ val = self._lib.X509_NAME_ENTRY_get_data(self._entry) return utils.asn1_string_to_utf8(val)
def test_utf8_string(self): orig = u"test \u2603 snowman" encoded = orig.encode('utf-8') asn1string = backend._lib.ASN1_STRING_type_new(self.V_ASN1_UTF8STRING) backend._lib.ASN1_STRING_set(asn1string, encoded, len(encoded)) res = utils.asn1_string_to_utf8(asn1string) self.assertEqual(res, orig)