Interface MongoCryptContext

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

    public interface MongoCryptContext
    extends java.io.Closeable
    An interface representing the lifecycle of an encryption or decryption request. It's modelled as a state machine.
    • Method Detail

      • getMongoOperation

        org.bson.RawBsonDocument getMongoOperation()
        Returns:
        the operation to execute
      • addMongoOperationResult

        void addMongoOperationResult​(org.bson.BsonDocument document)
        Parameters:
        document - a result of the operation
      • completeMongoOperation

        void completeMongoOperation()
        Signal completion of the operation
      • provideKmsProviderCredentials

        void provideKmsProviderCredentials​(org.bson.BsonDocument credentialsDocument)
        Provide KMS credentials on demand, in response to NEED_KMS_CREDENTIALS state
        Parameters:
        credentialsDocument - document containing all credentials
        Since:
        1.4
      • nextKeyDecryptor

        MongoKeyDecryptor nextKeyDecryptor()
        Returns:
        the next key decryptor, or null if there are no more
      • completeKeyDecryptors

        void completeKeyDecryptors()
        Indicate that all key decryptors have been completed
      • finish

        org.bson.RawBsonDocument finish()
        Returns:
        the encrypted or decrypted document
      • close

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