code: def x509_from_ecdsap256_key_pair(pub_key, priv_key, common_name):
      
      cert_len = _lib.xtt_x509_certificate_length()
      cert = _ffi.new('unsigned char[]', cert_len)
      rc = _lib.xtt_x509_from_ecdsap256_keypair(pub_key.native,
                                             priv_key.native,
                                             common_name.native,
                                             cert, len(cert))
      if rc == RC.SUCCESS:
          return _ffi.buffer(cert)[:]
      else:
          raise error_from_code(rc)
docs: Creates a self-signed x509 certificate for a common name and
      ECDSAP256 key pair.
  
      :pub_key: an ECDSAP256PublicKey instance
      :priv_key: an ECDSAP256PrivateKey instance
      :common_name: an XTTIdentity instance
      :returns: the certificate as a byte string