Package com.mongodb.crypt.capi
Interface MongoKeyDecryptor
-
public interface MongoKeyDecryptorAn interface representing a key decryption operation using a key management service.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intbytesNeeded()Gets the number of bytes that should be received from the KMS server.voidfeed(java.nio.ByteBuffer bytes)Feed the received bytes to the decryptor.java.lang.StringgetHostName()Gets the host name of the key management service.java.lang.StringgetKmsProvider()Gets the name of the KMS provider, e.g.java.nio.ByteBuffergetMessage()Gets the message to send to the key management service.
-
-
-
Method Detail
-
getKmsProvider
java.lang.String getKmsProvider()
Gets the name of the KMS provider, e.g. "aws" or "kmip"- Returns:
- the KMS provider name
-
getHostName
java.lang.String getHostName()
Gets the host name of the key management service.- Returns:
- the host name
-
getMessage
java.nio.ByteBuffer getMessage()
Gets the message to send to the key management service.Clients should call this method first, and send the message on a TLS connection to a configured KMS server.
- Returns:
- the message to send
-
bytesNeeded
int bytesNeeded()
Gets the number of bytes that should be received from the KMS server.After sending the message to the KMS server, clients should call this method in a loop, receiving
bytesNeededfrom the KMS server and feeding those bytes to this decryptor, untilbytesNeededis 0.- Returns:
- the actual number of bytes that clients should be prepared receive
-
feed
void feed(java.nio.ByteBuffer bytes)
Feed the received bytes to the decryptor.After sending the message to the KMS server, clients should call this method in a loop, receiving the number of bytes indicated by a call to
bytesNeeded()from the KMS server and feeding those bytes to this decryptor, untilbytesNeeded()returns 0.- Parameters:
bytes- the received bytes
-
-