use of org.firebirdsql.gds.ng.dbcrypt.DbCryptCallback in project jaybird by FirebirdSQL.
the class StaticValueDbCryptCallbackSpiTest method fixedResponseWithBase64Config.
@Test
public void fixedResponseWithBase64Config() {
final DbCryptCallback dbCryptCallback = new StaticValueDbCryptCallbackSpi().createDbCryptCallback("base64:ZWFzdXJlLg==");
DbCryptData dbCryptData = dbCryptCallback.handleCallback(DbCryptData.EMPTY_DATA);
assertArrayEquals("easure.".getBytes(StandardCharsets.US_ASCII), dbCryptData.getPluginData());
}
use of org.firebirdsql.gds.ng.dbcrypt.DbCryptCallback in project jaybird by FirebirdSQL.
the class StaticValueDbCryptCallbackSpiTest method fixedResponseWithStringConfig.
@Test
public void fixedResponseWithStringConfig() {
final String dbCryptConfig = "abc\u02a5\u0b2c\u1d38\u213b";
final DbCryptCallback dbCryptCallback = new StaticValueDbCryptCallbackSpi().createDbCryptCallback(dbCryptConfig);
DbCryptData dbCryptData = dbCryptCallback.handleCallback(DbCryptData.EMPTY_DATA);
assertArrayEquals(dbCryptConfig.getBytes(StandardCharsets.UTF_8), dbCryptData.getPluginData());
}
use of org.firebirdsql.gds.ng.dbcrypt.DbCryptCallback in project jaybird by FirebirdSQL.
the class StaticValueDbCryptCallbackTest method returnsReplyWithFixedResponseValue_nonNull.
@Test
public void returnsReplyWithFixedResponseValue_nonNull() {
final byte[] responseData = { 2, 3, 4, 5, 6 };
DbCryptCallback callback = new StaticValueDbCryptCallback(responseData);
DbCryptData dbCryptData = callback.handleCallback(DbCryptData.EMPTY_DATA);
assertSame("pluginData", responseData, dbCryptData.getPluginData());
assertEquals("replySize", 0, dbCryptData.getReplySize());
}
use of org.firebirdsql.gds.ng.dbcrypt.DbCryptCallback in project jaybird by FirebirdSQL.
the class V10Database method authReceiveResponse.
@Override
public final void authReceiveResponse(AcceptPacket acceptPacket) throws IOException, SQLException {
final DbCryptCallback dbCryptCallback = connection.createDbCryptCallback();
wireOperations.authReceiveResponse(acceptPacket, dbCryptCallback, new FbWireOperations.ProcessAttachCallback() {
@Override
public void processAttachResponse(GenericResponse response) {
processAttachOrCreateResponse(response);
}
});
}
use of org.firebirdsql.gds.ng.dbcrypt.DbCryptCallback in project jaybird by FirebirdSQL.
the class V10Service method authReceiveResponse.
@Override
public final void authReceiveResponse(AcceptPacket acceptPacket) throws IOException, SQLException {
final DbCryptCallback dbCryptCallback = connection.createDbCryptCallback();
wireOperations.authReceiveResponse(acceptPacket, dbCryptCallback, new FbWireOperations.ProcessAttachCallback() {
@Override
public void processAttachResponse(GenericResponse response) {
V10Service.this.processAttachResponse(response);
}
});
}
Aggregations