Interface MongoCrypt

  • All Superinterfaces:
    java.lang.AutoCloseable, java.io.Closeable


    public interface MongoCrypt
    extends java.io.Closeable
    A context for encryption/decryption operations.
    • Method Detail

      • createEncryptionContext

        MongoCryptContext createEncryptionContext​(java.lang.String database,
                                                  org.bson.BsonDocument command)
        Create a context to use for encryption
        Parameters:
        database - the namespace
        command - 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 provider
        options - 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
      • close

        void close​()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable