parameters: (backend, data)
return_statement: return s
docstring: Create an ASN1_OCTET_STRING from a Python byte string.
docstring_summary: Create an ASN1_OCTET_STRING from a Python byte string.
docstring_tokens: Create an ASN1_OCTET_STRING from a Python byte string .
function: def _encode_asn1_str(backend, data):
      """
      Create an ASN1_OCTET_STRING from a Python byte string.
      """
      s = backend._lib.ASN1_OCTET_STRING_new()
      res = backend._lib.ASN1_OCTET_STRING_set(s, data, len(data))
      backend.openssl_assert(res == 1)
      return s
function_tokens: def _encode_asn1_str ( backend , data ) : s = backend . _lib . ASN1_OCTET_STRING_new ( ) res = backend . _lib . ASN1_OCTET_STRING_set ( s , data , len ( data ) ) backend . openssl_assert ( res == 1 ) return s