.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "MONGOC_CLIENT_ENCRYPTION_ENCRYPT" "3" "May 07, 2024" "1.27.1" "libmongoc" .SH SYNOPSIS .INDENT 0.0 .INDENT 3.5 .sp .EX bool mongoc_client_encryption_encrypt ( mongoc_client_encryption_t *client_encryption, const bson_value_t *value, mongoc_client_encryption_encrypt_opts_t *opts, bson_value_t *ciphertext, bson_error_t *error); .EE .UNINDENT .UNINDENT .sp Performs explicit encryption. .sp \fBciphertext\fP is always initialized (even on failure). Caller must call \fI\%bson_value_destroy()\fP to free. .sp To insert or query with an \(dqIndexed\(dq or \(dqRangePreview\(dq encrypted payload, use a \fI\%mongoc_client_t\fP configured with \fI\%mongoc_auto_encryption_opts_t\fP\&. The \fI\%mongoc_auto_encryption_opts_t\fP may be configured to bypass query analysis with \fI\%mongoc_auto_encryption_opts_set_bypass_query_analysis()\fP\&. The \fI\%mongoc_auto_encryption_opts_t\fP must not be configured to bypass automatic encryption with \fI\%mongoc_auto_encryption_opts_set_bypass_auto_encryption()\fP\&. \fBNote\fP that the \fB\(dqRangePreview\(dq\fP payload type is part of the experimental \fI\%Queryable Encryption\fP API and may be subject to breaking changes in future releases.\&. The Range algorithm is experimental only and not intended for public use. It is subject to breaking changes. .sp To insert with a \fBRangePreview\fP payload \fI\%mongoc_client_encryption_encrypt_range_opts_t\fP must be set in \fBopts\fP\&. .sp To query with a \fBRangePreview\fP payload, use \fI\%mongoc_client_encryption_encrypt_expression()\fP .sp \fBNOTE\fP that the Range algorithm is experimental only and not intended for public use. It is subject to breaking changes. .SH PARAMETERS .INDENT 0.0 .IP \(bu 2 \fBclient_encryption\fP: A \fI\%mongoc_client_encryption_t\fP .IP \(bu 2 \fBvalue\fP: The value to encrypt. .IP \(bu 2 \fBopts\fP: A \fI\%mongoc_client_encryption_encrypt_opts_t\fP\&. .IP \(bu 2 \fBciphertext\fP: A \fI\%bson_value_t\fP for the resulting ciphertext (a BSON binary with subtype 6). .IP \(bu 2 \fBerror\fP: A \fI\%bson_error_t\fP set on failure. .UNINDENT .SH RETURNS .sp Returns \fBtrue\fP if successful. Returns \fBfalse\fP and sets \fBerror\fP otherwise. .sp \fBSEE ALSO:\fP .INDENT 0.0 .INDENT 3.5 .nf \fI\%mongoc_client_encryption_encrypt_opts_t\fP .fi .sp .nf \fI\%mongoc_client_enable_auto_encryption()\fP .fi .sp .nf \fI\%mongoc_client_decryption_decrypt()\fP .fi .sp .nf \fI\%mongoc_client_encryption_encrypt_expression()\fP .fi .sp .UNINDENT .UNINDENT .SH AUTHOR MongoDB, Inc .SH COPYRIGHT 2017-present, MongoDB, Inc .\" Generated by docutils manpage writer. .