Ejemplo n.º 1
0
 def endpoint(self):
     """The kms hostname to connect over TLS."""
     p = ffi.new("char *[]", 1)
     try:
         if not lib.mongocrypt_kms_ctx_endpoint(self.__ctx, p):
             self.__raise_from_status()
         return _to_string(p[0])
     finally:
         ffi.release(p)
Ejemplo n.º 2
0
    def from_status(cls, status):
        """Constructs an error from a mongocrypt_status_t.

        :Parameters:
          - `status`: A CFFI mongocrypt_status_t.
        """
        if lib.mongocrypt_status_ok(status):
            raise ValueError("status must not be ok")
        msg = _to_string(lib.mongocrypt_status_message(status, ffi.NULL))
        return cls(msg, lib.mongocrypt_status_code(status))
Ejemplo n.º 3
0
    def kms_provider(self):
        """The KMS provider identifier associated with this KMS request.

        :Returns:
          The KMS provider as a string, eg "aws", "azure", "gcp", or "kmip".

        .. versionadded:: 1.2
        """
        return _to_string(
            lib.mongocrypt_kms_ctx_get_kms_provider(self.__ctx, ffi.NULL))