DataKeyOptions specifies options for creating a new data key.
type DataKeyOptions struct { KeyAltNames []string KeyMaterial []byte MasterKey bsoncore.Document }
func DataKey() *DataKeyOptions
DataKey creates a new DataKeyOptions instance.
func (dko *DataKeyOptions) SetKeyAltNames(names []string) *DataKeyOptions
SetKeyAltNames specifies alternate key names.
func (dko *DataKeyOptions) SetKeyMaterial(keyMaterial []byte) *DataKeyOptions
SetKeyMaterial specifies the key material.
func (dko *DataKeyOptions) SetMasterKey(key bsoncore.Document) *DataKeyOptions
SetMasterKey specifies the master key.
ExplicitEncryptionOptions specifies options for configuring an explicit encryption context.
type ExplicitEncryptionOptions struct { KeyID *primitive.Binary KeyAltName *string Algorithm string QueryType string ContentionFactor *int64 RangeOptions *ExplicitRangeOptions }
func ExplicitEncryption() *ExplicitEncryptionOptions
ExplicitEncryption creates a new ExplicitEncryptionOptions instance.
func (eeo *ExplicitEncryptionOptions) SetAlgorithm(algorithm string) *ExplicitEncryptionOptions
SetAlgorithm specifies an encryption algorithm.
func (eeo *ExplicitEncryptionOptions) SetContentionFactor(contentionFactor int64) *ExplicitEncryptionOptions
SetContentionFactor specifies the contention factor.
func (eeo *ExplicitEncryptionOptions) SetKeyAltName(keyAltName string) *ExplicitEncryptionOptions
SetKeyAltName sets the key alternative name.
func (eeo *ExplicitEncryptionOptions) SetKeyID(keyID primitive.Binary) *ExplicitEncryptionOptions
SetKeyID sets the key identifier.
func (eeo *ExplicitEncryptionOptions) SetQueryType(queryType string) *ExplicitEncryptionOptions
SetQueryType specifies the query type.
func (eeo *ExplicitEncryptionOptions) SetRangeOptions(ro ExplicitRangeOptions) *ExplicitEncryptionOptions
SetRangeOptions specifies the range options.
ExplicitRangeOptions specifies options for the range index.
type ExplicitRangeOptions struct { Min *bsoncore.Value Max *bsoncore.Value Sparsity int64 Precision *int32 }
MongoCryptOptions specifies options to configure a MongoCrypt instance.
type MongoCryptOptions struct { KmsProviders bsoncore.Document LocalSchemaMap map[string]bsoncore.Document BypassQueryAnalysis bool EncryptedFieldsMap map[string]bsoncore.Document CryptSharedLibDisabled bool CryptSharedLibOverridePath string HTTPClient *http.Client }
func MongoCrypt() *MongoCryptOptions
MongoCrypt creates a new MongoCryptOptions instance.
func (mo *MongoCryptOptions) SetBypassQueryAnalysis(bypassQueryAnalysis bool) *MongoCryptOptions
SetBypassQueryAnalysis skips the NeedMongoMarkings state.
func (mo *MongoCryptOptions) SetCryptSharedLibDisabled(disabled bool) *MongoCryptOptions
SetCryptSharedLibDisabled explicitly disables loading the crypt_shared library if set to true.
func (mo *MongoCryptOptions) SetCryptSharedLibOverridePath(path string) *MongoCryptOptions
SetCryptSharedLibOverridePath sets the override path to the crypt_shared library file. Setting an override path disables the default operating system dynamic library search path.
func (mo *MongoCryptOptions) SetEncryptedFieldsMap(efcMap map[string]bsoncore.Document) *MongoCryptOptions
SetEncryptedFieldsMap specifies the encrypted fields map.
func (mo *MongoCryptOptions) SetHTTPClient(httpClient *http.Client) *MongoCryptOptions
SetHTTPClient sets the http client.
func (mo *MongoCryptOptions) SetKmsProviders(kmsProviders bsoncore.Document) *MongoCryptOptions
SetKmsProviders specifies the KMS providers map.
func (mo *MongoCryptOptions) SetLocalSchemaMap(localSchemaMap map[string]bsoncore.Document) *MongoCryptOptions
SetLocalSchemaMap specifies the local schema map.
QueryType describes the type of query the result of Encrypt is used for.
type QueryType int
These constants specify valid values for QueryType
const ( QueryTypeEquality QueryType = 1 )
RewrapManyDataKeyOptions represents all possible options used to decrypt and encrypt all matching data keys with a possibly new masterKey.
type RewrapManyDataKeyOptions struct { // Provider identifies the new KMS provider. If omitted, encrypting uses the current KMS provider. Provider *string // MasterKey identifies the new masterKey. If omitted, rewraps with the current masterKey. MasterKey bsoncore.Document }
func MergeRewrapManyDataKeyOptions(opts ...*RewrapManyDataKeyOptions) *RewrapManyDataKeyOptions
MergeRewrapManyDataKeyOptions combines the given RewrapManyDataKeyOptions instances into a single RewrapManyDataKeyOptions in a last one wins fashion.
Deprecated: Merging options structs will not be supported in Go Driver 2.0. Users should create a single options struct instead.
func RewrapManyDataKey() *RewrapManyDataKeyOptions
RewrapManyDataKey creates a new RewrapManyDataKeyOptions instance.
func (rmdko *RewrapManyDataKeyOptions) SetMasterKey(masterKey bsoncore.Document) *RewrapManyDataKeyOptions
SetMasterKey sets the value for the MasterKey field.
func (rmdko *RewrapManyDataKeyOptions) SetProvider(provider string) *RewrapManyDataKeyOptions
SetProvider sets the value for the Provider field.