Package com.mongodb.crypt.capi
Interface MongoCrypt
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable
public interface MongoCrypt extends java.io.CloseableA context for encryption/decryption operations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()MongoCryptContextcreateDataKeyContext(java.lang.String kmsProvider, MongoDataKeyOptions options)Create a context to use for creating a data keyMongoCryptContextcreateDecryptionContext(org.bson.BsonDocument document)Create a context to use for decryptionMongoCryptContextcreateEncryptionContext(java.lang.String database, org.bson.BsonDocument command)Create a context to use for encryptionMongoCryptContextcreateExplicitDecryptionContext(org.bson.BsonDocument document)Create a context to use for encryptionMongoCryptContextcreateExplicitEncryptionContext(org.bson.BsonDocument document, MongoExplicitEncryptOptions options)Create a context to use for encryptionMongoCryptContextcreateRewrapManyDatakeyContext(org.bson.BsonDocument filter, MongoRewrapManyDataKeyOptions options)Create a context to use for encryptionjava.lang.StringgetCryptSharedLibVersionString()
-
-
-
Method Detail
-
createEncryptionContext
MongoCryptContext createEncryptionContext(java.lang.String database, org.bson.BsonDocument command)
Create a context to use for encryption- Parameters:
database- the namespacecommand- the document representing the command to encrypt- Returns:
- the context
-
createDecryptionContext
MongoCryptContext createDecryptionContext(org.bson.BsonDocument document)
Create a context to use for decryption- Parameters:
document- the document to decrypt- Returns:
- the context
-
createDataKeyContext
MongoCryptContext createDataKeyContext(java.lang.String kmsProvider, MongoDataKeyOptions options)
Create a context to use for creating a data key- Parameters:
kmsProvider- the KMS provideroptions- the data key options- Returns:
- the context
-
createExplicitEncryptionContext
MongoCryptContext createExplicitEncryptionContext(org.bson.BsonDocument document, MongoExplicitEncryptOptions options)
Create a context to use for encryption- Parameters:
document- the document to encrypt, which must be in the form { "v" : BSON value to encrypt }options- the explicit encryption options- Returns:
- the context
-
createExplicitDecryptionContext
MongoCryptContext createExplicitDecryptionContext(org.bson.BsonDocument document)
Create a context to use for encryption- Parameters:
document- the document to decrypt,which must be in the form { "v" : encrypted BSON value }- Returns:
- the context
-
createRewrapManyDatakeyContext
MongoCryptContext createRewrapManyDatakeyContext(org.bson.BsonDocument filter, MongoRewrapManyDataKeyOptions options)
Create a context to use for encryption- Parameters:
filter- The filter to use for the find command on the key vault collection to retrieve datakeys to rewrap.options- the rewrap many data key options- Returns:
- the context
- Since:
- 1.5
-
getCryptSharedLibVersionString
java.lang.String getCryptSharedLibVersionString()
- Returns:
- the version string of the loaded crypt shared dynamic library if available or null
- Since:
- 1.5
-
close
void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
-