java.lang.Object
org.firebirdsql.gds.ng.dbcrypt.DbCryptData
Data of a database encryption key callback (or reply).
- Since:
- 3.0.4
- Author:
- Mark Rotteveel
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDbCryptData(byte[] pluginData, int replySize) InitializesDbCryptDatainstance. -
Method Summary
Modifier and TypeMethodDescriptionstatic DbCryptDatacreateReply(byte[] pluginData) Creates a reply with plugin data and expected reply size of0.byte[]intReturns the expected reply size.
-
Field Details
-
EMPTY_DATA
-
-
Constructor Details
-
DbCryptData
public DbCryptData(byte[] pluginData, int replySize) InitializesDbCryptDatainstance.- Parameters:
pluginData- Data for/from plugin (can benull)replySize- Expected reply size (normally use0for a reply)- Throws:
IllegalArgumentException- when plugin data exceeds maximum length of 32767 bytes
-
-
Method Details
-
getPluginData
public byte[] getPluginData()- Returns:
- Plugin data (can be
null)
-
getReplySize
public int getReplySize()Returns the expected reply size.For a protocol version 13 callback, the value will be
Integer.MIN_VALUEas the protocol does not include this information.In the case of a callback, this value is as received from Firebird. Judging by the code in Firebird for protocol v14 and higher, this value may be negative, and should then be considered equivalent to
1.Plugins can use the value as a hint to the expected size of their reply. However smaller (or larger) replies will work.
- Returns:
- Expected reply size
-
createReply
Creates a reply with plugin data and expected reply size of0.- Parameters:
pluginData- Plugin response data- Returns:
- Crypt data
-