diff --git a/FinTS_Produktregistrierungen_Lizenzdatei.csv b/FinTS_Produktregistrierungen_Lizenzdatei.csv new file mode 100644 index 0000000..3d484c6 --- /dev/null +++ b/FinTS_Produktregistrierungen_Lizenzdatei.csv @@ -0,0 +1,12 @@ + + + + + + + + + + +;;412748A1836CDD07181CE1910; +;;CB8B7533B69C0D3FE2F04832A; diff --git a/README.md b/README.md index d41c128..e6973d3 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,32 @@ -# FueliFinTS +# Fork of [FueliFinTS](https://github.com/petafuel/FueliFinTS) Fueli FinTS is a server implementing the financial transaction services (FinTS) protocol for online banking. FinTS was formerly known as home banking computer interface (HBCI). + +**This fork of [FueliFinTS](https://github.com/petafuel/FueliFinTS) addresses the following issues:** + +1. Persistence layer was missing and has been added after rough reverse-engineering +2. For missing maven dependencies (to handle SEPA payments and account statements) skeleton classes have been implemented and added. +3. FIXMEs to deactivate PIN/mTAN/strong authentication where necessary for testing purposes. **CAUTION: Do not use this fork in production without fixing these issues!!!** +4. Added example configuration files and db script to set up a rudimentary database. +5. Some minor refactoring and cleanups + +**Please find a complete list of all changes to the original implementation by this fork with this [Github Compare](https://github.com/drmartinberger/FueliFinTS/compare/main...petafuel:main) view.** + +# Setup Steps + +1. Configure `fuelifints.properties` +2. Initialize keystore (to be set in `fuelifints.properties`) +3. Setup `FinTS_Produktregistrierungen_Lizenzdatei.csv` (to be set in `fuelifints.properties`, contains product client ids that are allowed to communicate with server) or set a `productinfo.csv.check=false` +4. Define aeskey.properties with a valid 128-bit key (to be set in `fuelifints.properties`) +5. Setup file .banking2.properties (to set config params for persistence layer, blz is configured in `fuelifints.properties` and your database) +6. Init database: + 1. Install mysql + 2. Initialize database from mysql command line: + 1. Add database user e.g. `fintsuser` with `` (both must be used in `connectionpool.properties` adapted from `connectionpool.properties.example`): + `mysql> GRANT ALL PRIVILEGES ON *.* TO 'fintsuser'@'localhost' IDENTIFIED BY '';` + 2. `mysql> create database fints;` + 3. `mysql> GRANT ALL ON fints.* TO 'fintsuser'@'localhost';` + 4. `mysql> FLUSH PRIVILEGES;` + 5. Execute database setup script from terminal + ```bash + $ mysql -u fintsuser -p fints < dbsetup.sql + ``` diff --git a/aeskey.properties.example b/aeskey.properties.example index 4021b16..e3494c5 100644 --- a/aeskey.properties.example +++ b/aeskey.properties.example @@ -1 +1 @@ -aes_key=youraeskey \ No newline at end of file +aes_key=youraeskey (128-bit) \ No newline at end of file diff --git a/config/blz.banking2.properties.example b/config/blz.banking2.properties.example new file mode 100644 index 0000000..9af36af --- /dev/null +++ b/config/blz.banking2.properties.example @@ -0,0 +1 @@ +smsSystemId=1 \ No newline at end of file diff --git a/connectionpool.properties.example b/connectionpool.properties.example index bd6291a..4a9bdf8 100644 --- a/connectionpool.properties.example +++ b/connectionpool.properties.example @@ -1,8 +1,12 @@ db.jdbcurl.12345678=jdbc:mysql://yourdbserver:3306/yourbankdb?characterEncoding=ISO-8859-1 +db.server.12345678=dbserver +db.name.12345678=fints db.user.12345678=dbuser db.password.12345678=dbpassword db.jdbcurl.23456789=jdbc:mysql://anotherdbserver:3306/anotherbankdb?characterEncoding=ISO-8859-1 +db.server.23456789=otherdbserver +db.name.23456789=otherdbname db.user.23456789=otherdbuser db.password.23456789=otherdbpassword diff --git a/dbsetup.sql b/dbsetup.sql new file mode 100644 index 0000000..ceea025 --- /dev/null +++ b/dbsetup.sql @@ -0,0 +1,36 @@ +-- Rough reverse-engineered database structure for FueliFinTS +-- 1. Set your intended benutzerkennung for +-- 2. Set your intended encrypted PIN for +-- 3. Set your intended kundenid for +-- 4. Set and as in config/fuelifints.properties +-- 5. Set your intended , and +-- 6. Set other values where feasible +CREATE TABLE benutzerkennungen (pin varchar(255), lastnn varchar(255), benutzerkennung varchar(255)); +INSERT INTO benutzerkennungen (pin, lastnn, benutzerkennung) VALUES ('', 'lastnn', ''); +CREATE TABLE kunden_benutzerkennungen (kundenid varchar(255), benutzerkennung varchar(255)); +INSERT INTO kunden_benutzerkennungen (kundenid, benutzerkennung) VALUES ('', ''); +CREATE TABLE bpd (version varchar(255), blz varchar(255), bankname varchar(255), anzgesch varchar(255), lang varchar(255), hbciversion varchar(255), maxsize varchar(255)); +INSERT INTO bpd (version, blz, bankname, anzgesch, lang, hbciversion, maxsize) VALUES ('1', '', '', '1', 'GER', '300', '0'); -- blz and bankname should match fuelifints.properties +CREATE TABLE geschaeftsvorfaelle(bezeichnung varchar(255), segmentversion varchar(255), maxanzahl INT, param1 INT, param5 varchar(255), param3 varchar(255), param4 varchar(255), bpdversion varchar(255), hbciversion varchar(255)); +INSERT INTO geschaeftsvorfaelle (bezeichnung, segmentversion, maxanzahl, param1, param5, param3, param4, bpdversion, hbciversion) VALUES ('Geschaeftsvorfall Bezeichnung', 'Segmentversion 1', 1, 1, '1', '1', '1', '1', '300'); +CREATE TABLE messages_read(messageid varchar(255), loginid varchar(255), benutzerkennung varchar(255)); +CREATE TABLE messages(messageid varchar(255), subject varchar(255), text varchar(255)); +CREATE TABLE tempclientstuff3(benutzerkennung varchar(255), kundenid varchar(255), produkt varchar(255), produktversion varchar(255), kundensystemid varchar(255), dialogid varchar(255), tanid varchar(255), kontrollref varchar(255)); +CREATE TABLE konten(kontoid VARCHAR(255), kontonummer VARCHAR(255), kontoinhaber VARCHAR(35), kontostand VARCHAR(35), tagesumsatz VARCHAR(35), tageslimit VARCHAR(35), kontoart VARCHAR(2), virtkontostand VARCHAR(35), kreditlinie_aktiv BOOLEAN, kreditlinie VARCHAR(35), ueberziehen BOOLEAN, konto_pre VARCHAR(255), blz_pre VARCHAR(255), iban_pre VARCHAR(255), empfaenger_pre VARCHAR(255)); +INSERT INTO konten(kontoid, kontonummer, kontoinhaber, kontostand, tagesumsatz,tageslimit,kontoart,virtkontostand,kreditlinie_aktiv,kreditlinie,ueberziehen,konto_pre,blz_pre,iban_pre,empfaenger_pre) VALUES ('','', '','66.66','66.66','66.66', '90','66.66',true,'66.66',true,'','','',''); +CREATE TABLE konten_bewegungen(kontoid VARCHAR(255), kontostand VARCHAR(35), buchungsdatum DATE, bewegungsid BIGINT(20)); +-- comment out INSERT INTO konten_bewegungen, if you do not want to have account transactions +INSERT INTO konten_bewegungen(kontoid, kontostand, buchungsdatum, bewegungsid) VALUES ('', '66.66', '2022-11-11', 1); +CREATE TABLE kunden_konten(kontoid VARCHAR(255), kundenid VARCHAR(255)); +INSERT INTO kunden_konten(kontoid, kundenid) VALUES ('', ''); +CREATE TABLE login_konten_permission(kontoid VARCHAR(255), benutzerkennung varchar(255), ueberweisung VARCHAR(1), sdd VARCHAR(1), ade VARCHAR(1), azv VARCHAR(1), lastschrift VARCHAR(1), abbuchung VARCHAR(1), dtaus VARCHAR(1)); +INSERT INTO login_konten_permission(kontoid, benutzerkennung, ueberweisung, sdd, ade, azv, lastschrift, abbuchung, dtaus) VALUES ('', '', '1', '1', 'E', '1', '1', '1', '1'); +CREATE TABLE logins(loginid VARCHAR(255), handy VARCHAR(255), ref_benutzerkennung VARCHAR(255)); +INSERT INTO logins(loginid, handy, ref_benutzerkennung) VALUES (0, '0815666', ''); +CREATE TABLE tanliste_mobil(mtanid INT AUTO_INCREMENT PRIMARY KEY, mtan VARCHAR(255), used VARCHAR(255), loginid VARCHAR(255),benutzerkennung VARCHAR(255), request VARCHAR(255)); +INSERT INTO tanliste_mobil(mtanid, mtan, used, loginid, benutzerkennung, request) VALUES (0, '123456', '0', 0, '', 'request'); +CREATE TABLE login_permission(tageslimit VARCHAR(35), tagesumsatz VARCHAR(35), lastschrift VARCHAR(1), ueberweisung VARCHAR(1), benutzerkennung varchar(255)); +CREATE TABLE mt940(mt940id VARCHAR(255), mt940 BLOB, kontoid VARCHAR(255), buchungstag date); +CREATE TABLE vorabumsaetze(kontoid VARCHAR(255), buchungsdatum date, primanota VARCHAR(35), verwendungszweck VARCHAR(140), betrag VARCHAR(35), kontostand VARCHAR(35), wert VARCHAR(35), refimportid VARCHAR(35), gegenkontoname VARCHAR(35), gegenkontonr VARCHAR(35), gegenkontoblz VARCHAR(35), bewegungsid VARCHAR(35)); + + diff --git a/pom.xml b/pom.xml index 92ae803..4a70060 100644 --- a/pom.xml +++ b/pom.xml @@ -21,21 +21,22 @@ - - net.petafuel.prepaid.library - DBUtils - 1.434 - - - net.petafuel.prepaid.library - Mt94x - 1.415 - - - net.petafuel.library - JSEPA - 1.446 - + + + + + + + + + + + + + + + + org.jboss.resteasy resteasy-client @@ -89,7 +90,7 @@ mysql mysql-connector-java - 5.1.25 + 8.0.31 org.mockito diff --git a/src/main/java/net/petafuel/dbutils/DbHelper.java b/src/main/java/net/petafuel/dbutils/DbHelper.java new file mode 100644 index 0000000..e979734 --- /dev/null +++ b/src/main/java/net/petafuel/dbutils/DbHelper.java @@ -0,0 +1,145 @@ +package net.petafuel.dbutils; + +import com.mysql.cj.jdbc.MysqlDataSource; +import net.petafuel.fuelifints.dataaccess.Banking2Access; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + +import javax.naming.NamingException; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.sql.*; +import java.util.Properties; + +public class DbHelper { + private static final Logger LOG = LogManager.getLogger(DbHelper.class); + + private static MysqlDataSource dataSource = null; + + static { + try { + Properties fuelifintsProperties = new Properties(); + fuelifintsProperties.load(new FileInputStream("config/fuelifints.properties")); + + String bankcode = fuelifintsProperties.getProperty("bankcode", "12345678"); + + Properties connProperties = new Properties(); + connProperties.load(new FileInputStream("connectionpool.properties")); + + String driverClass = connProperties.getProperty("db.driverclass", "com.mysql.cj.jdbc.Driver"); + Class.forName(driverClass); + + dataSource = new MysqlDataSource(); + dataSource.setServerName(connProperties.getProperty("db.server." + bankcode, "127.0.0.1")); + dataSource.setDatabaseName(connProperties.getProperty("db.name." + bankcode, "fints")); + dataSource.setUser(connProperties.getProperty("db.user." + bankcode, "fintsuser")); + dataSource.setPassword(connProperties.getProperty("db.password." + bankcode)); + + dataSource.setUseSSL(false); + } catch (SQLException e) { + throw new RuntimeException(e); + } catch (ClassNotFoundException e) { + throw new RuntimeException(e); + } catch (FileNotFoundException e) { + throw new RuntimeException(e); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + public static void main(String[] args) { + try { + Class.forName("com.mysql.cj.jdbc.Driver"); + + System.out.println("Connecting to server..."); + + try(Connection connection = dataSource.getConnection()) { + System.out.println("Server connected!"); + Statement stmt = null; + ResultSet resultset = null; + + try { + stmt = connection.createStatement(); + resultset = stmt.executeQuery("SHOW DATABASES;"); + + if (stmt.execute("SHOW DATABASES;")) { + resultset = stmt.getResultSet(); + } + + while (resultset.next()) { + System.out.println(resultset.getString("Database")); + } + } catch (SQLException ex) { + // handle any errors + ex.printStackTrace(); + } finally { + // release resources + if (resultset != null) { + try { + resultset.close(); + } catch (SQLException sqlEx) { + } + resultset = null; + } + + if (stmt != null) { + try { + stmt.close(); + } catch (SQLException sqlEx) { + } + stmt = null; + } + + if (connection != null) { + connection.close(); + } + } + } catch (SQLException e) { + System.out.println(e.getMessage()); + throw new IllegalStateException("Cannot connect the server!", e); + + } + } catch (Exception e) {} + } + + public Connection getConnection(String dbprofile) throws NamingException { + try { + System.out.println("Connecting to server..."); + return dataSource.getConnection(); + } catch (Exception e) { + e.printStackTrace(); + throw new NamingException(e.getMessage()); + } + } + + public void closeQuietly(Connection connection) { + try { + if (connection != null) { + connection.close(); + } + } catch (Exception e) { + LOG.error("Exception: %s", connection.toString()); + } + } + + public void closeQuietly(ResultSet resultSet) { + try { + if (resultSet != null) { + resultSet.close(); + } + } catch (Exception e) { + LOG.error("Exception: %s", resultSet.toString()); + } + } + + public void closeQuietly(PreparedStatement pSi) { + try { + if (pSi != null) { + pSi.close(); + } + } catch (Exception e) { + LOG.error("Exception: %s", pSi.toString()); + } + } +} diff --git a/src/main/java/net/petafuel/fuelifints/cryptography/CryptographyFactory.java b/src/main/java/net/petafuel/fuelifints/cryptography/CryptographyFactory.java index 9e39bca..5f31533 100644 --- a/src/main/java/net/petafuel/fuelifints/cryptography/CryptographyFactory.java +++ b/src/main/java/net/petafuel/fuelifints/cryptography/CryptographyFactory.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; public class CryptographyFactory { public static Cryptography getCryptography(SecurityMethod securityMethod) { diff --git a/src/main/java/net/petafuel/fuelifints/cryptography/KeyManager.java b/src/main/java/net/petafuel/fuelifints/cryptography/KeyManager.java index b4d954b..87a4f5a 100644 --- a/src/main/java/net/petafuel/fuelifints/cryptography/KeyManager.java +++ b/src/main/java/net/petafuel/fuelifints/cryptography/KeyManager.java @@ -2,7 +2,7 @@ package net.petafuel.fuelifints.cryptography; import net.petafuel.fuelifints.dataaccess.DataAccessFacade; import net.petafuel.fuelifints.dataaccess.DataAccessFacadeManager; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.util.encoders.Base64; diff --git a/src/main/java/net/petafuel/fuelifints/cryptography/RAH10Cryptography.java b/src/main/java/net/petafuel/fuelifints/cryptography/RAH10Cryptography.java index 4a6b8d8..a7c28a8 100644 --- a/src/main/java/net/petafuel/fuelifints/cryptography/RAH10Cryptography.java +++ b/src/main/java/net/petafuel/fuelifints/cryptography/RAH10Cryptography.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.jce.provider.BouncyCastleProvider; diff --git a/src/main/java/net/petafuel/fuelifints/cryptography/RAH9Cryptography.java b/src/main/java/net/petafuel/fuelifints/cryptography/RAH9Cryptography.java index 0a8c5ae..115ebc7 100644 --- a/src/main/java/net/petafuel/fuelifints/cryptography/RAH9Cryptography.java +++ b/src/main/java/net/petafuel/fuelifints/cryptography/RAH9Cryptography.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.jce.provider.BouncyCastleProvider; diff --git a/src/main/java/net/petafuel/fuelifints/cryptography/RDH10Cryptography.java b/src/main/java/net/petafuel/fuelifints/cryptography/RDH10Cryptography.java index c7a0527..80f36b4 100644 --- a/src/main/java/net/petafuel/fuelifints/cryptography/RDH10Cryptography.java +++ b/src/main/java/net/petafuel/fuelifints/cryptography/RDH10Cryptography.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.jce.provider.BouncyCastleProvider; diff --git a/src/main/java/net/petafuel/fuelifints/cryptography/RDH10SignatureHelper.java b/src/main/java/net/petafuel/fuelifints/cryptography/RDH10SignatureHelper.java index 75d0a6e..fa4b47d 100644 --- a/src/main/java/net/petafuel/fuelifints/cryptography/RDH10SignatureHelper.java +++ b/src/main/java/net/petafuel/fuelifints/cryptography/RDH10SignatureHelper.java @@ -4,7 +4,7 @@ import net.petafuel.fuelifints.dataaccess.dataobjects.ReturnDataObject; import net.petafuel.fuelifints.exceptions.ElementParseException; import net.petafuel.fuelifints.exceptions.HBCISyntaxException; import net.petafuel.fuelifints.model.Dialog; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.HKSAK; import net.petafuel.fuelifints.protocol.fints3.segments.HNSHA; import net.petafuel.fuelifints.protocol.fints3.segments.HNSHK; diff --git a/src/main/java/net/petafuel/fuelifints/cryptography/RDH9Cryptography.java b/src/main/java/net/petafuel/fuelifints/cryptography/RDH9Cryptography.java index 0168a60..c37c295 100644 --- a/src/main/java/net/petafuel/fuelifints/cryptography/RDH9Cryptography.java +++ b/src/main/java/net/petafuel/fuelifints/cryptography/RDH9Cryptography.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.jce.provider.BouncyCastleProvider; diff --git a/src/main/java/net/petafuel/fuelifints/cryptography/SignatureHelperFactory.java b/src/main/java/net/petafuel/fuelifints/cryptography/SignatureHelperFactory.java index 546b5d1..03df2b6 100644 --- a/src/main/java/net/petafuel/fuelifints/cryptography/SignatureHelperFactory.java +++ b/src/main/java/net/petafuel/fuelifints/cryptography/SignatureHelperFactory.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; public class SignatureHelperFactory { diff --git a/src/main/java/net/petafuel/fuelifints/dataaccess/Banking2Access.java b/src/main/java/net/petafuel/fuelifints/dataaccess/Banking2Access.java index 4659568..8bb54db 100644 --- a/src/main/java/net/petafuel/fuelifints/dataaccess/Banking2Access.java +++ b/src/main/java/net/petafuel/fuelifints/dataaccess/Banking2Access.java @@ -10,7 +10,7 @@ import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.model.IMessageElement; import net.petafuel.fuelifints.model.client.ClientProductInfo; import net.petafuel.fuelifints.model.client.LegitimationInfo; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Betrag; import net.petafuel.fuelifints.protocol.fints3.segments.deg.KontoverbindungInternational; import net.petafuel.fuelifints.protocol.fints3.segments.deg.KontoverbindungNational; @@ -44,10 +44,10 @@ import static net.petafuel.fuelifints.support.Payments.derfNullSein; @SuppressWarnings("unused") public class Banking2Access implements DataAccessFacade { private static final Logger LOG = LogManager.getLogger(Banking2Access.class); - private String bankCode; + private final String bankCode; private String configColumnSct = "ueberweisung"; private String configColumnSdd = "sdd"; - private banking2 database; + private final banking2 database; /** * @param configFile Pfad zum Konfigurationsfile @@ -236,7 +236,7 @@ public class Banking2Access implements DataAccessFacade { String communikationUrlListString = config(banking2.properties.communikationUrls, ""); if (!communikationUrlListString.equals("")) { KommunikationsParameterData kommunikationsParameterData = new KommunikationsParameterData(); - List communikationUrlList = com.mysql.jdbc.StringUtils.split(communikationUrlListString, ",", true); + List communikationUrlList = com.mysql.cj.util.StringUtils.split(communikationUrlListString, ",", true); communikationUrlList.forEach(kommunikationsParameterData::addKommunikationszugang); kommunikationsParameterData.setBankId(bankId); return kommunikationsParameterData; @@ -302,7 +302,7 @@ public class Banking2Access implements DataAccessFacade { */ if (kontoverbindungAuftraggeber != null) { LOG.debug(addTagUser(format("Kontonummer: %s", kontoverbindungAuftraggeber.getKontonummer()), legitimationsInfo)); - LOG.debug(addTagUser(format("Kreditinstitutkennung: %s", String.valueOf(kontoverbindungAuftraggeber.getKreditinstitutskennung())), legitimationsInfo)); + LOG.debug(addTagUser(format("Kreditinstitutkennung: %s", kontoverbindungAuftraggeber.getKreditinstitutskennung()), legitimationsInfo)); LOG.debug(addTagUser(format("Unterkontomerkmal: %s", kontoverbindungAuftraggeber.getUnterkontomerkmal()), legitimationsInfo)); } LOG.debug(addTagUser(format("Betreff: %s", betreff), legitimationsInfo)); @@ -352,10 +352,13 @@ public class Banking2Access implements DataAccessFacade { */ @Override public int getCurrentUpdVersion(LegitimationInfo legitimationInfo) { - if (legitimationInfo.getCustomerId().equals("9999999999")) { - return 1; - } - return database.getLatestUpd(legitimationInfo); + // FIXME: customerId is not always set + return 1; +// String customerId = legitimationInfo.getCustomerId(); +// if (customerId != null && customerId.equals("9999999999")) { +// return 1; +// } +// return database.getLatestUpd(legitimationInfo); } /** @@ -1121,7 +1124,7 @@ public class Banking2Access implements DataAccessFacade { if (vectorBuchungen == null || (isSammler && vectorBuchungen.size() < 1) || (!isSammler && vectorBuchungen.size() > 1)) { int count = (vectorBuchungen == null) ? 0 : vectorBuchungen.size(); String singleSammel = (isSammler) ? "s" : "m"; - String message = format("Ungültige Menge an CTTInfosegmente gefunden: %s (%s)", String.valueOf(count), singleSammel); + String message = format("Ungültige Menge an CTTInfosegmente gefunden: %s (%s)", count, singleSammel); LOG.warn(addTagUser(message, legitimationInfo)); return new ReturnDataObject(false, message, "9930"); } @@ -1175,10 +1178,10 @@ public class Banking2Access implements DataAccessFacade { executionTime = sdf.parse(regExDate); long dd = daysDiff(new Date(), executionTime); if (dd < 1) { - LOG.warn(addTagUser(format("Datum liegt nicht in der Zukunft, Tage: %s", String.valueOf(dd)), legitimationInfo)); + LOG.warn(addTagUser(format("Datum liegt nicht in der Zukunft, Tage: %s", dd), legitimationInfo)); return new ReturnDataObject(false, "Datum für die Ausführung muss mindestens ein Tag in der Zukunft liegen", "9935"); } - LOG.info(addTagUser(format("Tage-Diff: %s", String.valueOf(dd)), legitimationInfo)); + LOG.info(addTagUser(format("Tage-Diff: %s", dd), legitimationInfo)); } catch (ParseException e) { LOG.error(addTagUser(format("Datum für die Ausführung fehlt oder ist Fehlerhaft: %s", e.getMessage()), legitimationInfo), e); return new ReturnDataObject(false, "Datum für die Ausführung fehlt oder ist Fehlerhaft", "9935"); diff --git a/src/main/java/net/petafuel/fuelifints/dataaccess/DataAccessFacade.java b/src/main/java/net/petafuel/fuelifints/dataaccess/DataAccessFacade.java index f1aa16f..4a268ab 100644 --- a/src/main/java/net/petafuel/fuelifints/dataaccess/DataAccessFacade.java +++ b/src/main/java/net/petafuel/fuelifints/dataaccess/DataAccessFacade.java @@ -6,7 +6,7 @@ import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.model.IMessageElement; import net.petafuel.fuelifints.model.client.ClientProductInfo; import net.petafuel.fuelifints.model.client.LegitimationInfo; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Betrag; import net.petafuel.fuelifints.protocol.fints3.segments.deg.KontoverbindungInternational; import net.petafuel.fuelifints.protocol.fints3.segments.deg.KontoverbindungNational; diff --git a/src/main/java/net/petafuel/fuelifints/dataaccess/dataobjects/database/banking2.java b/src/main/java/net/petafuel/fuelifints/dataaccess/dataobjects/database/banking2.java index fe2d1b9..50408a0 100644 --- a/src/main/java/net/petafuel/fuelifints/dataaccess/dataobjects/database/banking2.java +++ b/src/main/java/net/petafuel/fuelifints/dataaccess/dataobjects/database/banking2.java @@ -24,6 +24,7 @@ import javax.naming.NamingException; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.security.SecureRandom; import java.sql.*; import java.text.ParseException; @@ -71,15 +72,15 @@ public class banking2 { private static final String seed = "412132343421"; private static final Logger LOG = LogManager.getLogger(banking2.class); public static SimpleDateFormat sdf_sql = new SimpleDateFormat("yyyy-MM-dd"); - private static SimpleDateFormat sdf_tan = new SimpleDateFormat("yyyyMMddHHmmss"); + private static final SimpleDateFormat sdf_tan = new SimpleDateFormat("yyyyMMddHHmmss"); private static String dbprofile = "banking2"; private CkontoLocal ckonto; - private Charset charsetISO88591 = Charset.forName("ISO-8859-1"); - private Properties configuration; - private SecureRandom random = new SecureRandom(); + private final Charset charsetISO88591 = StandardCharsets.ISO_8859_1; + private final Properties configuration; + private final SecureRandom random = new SecureRandom(); private boolean configCreateVorabumsaetze = false; - private HashMap> localMessageList = new HashMap<>(); - private HashMap localUserReference = new HashMap<>(); + private final HashMap> localMessageList = new HashMap<>(); + private final HashMap localUserReference = new HashMap<>(); private Boolean mailAvaible = null; /** @@ -409,7 +410,7 @@ public class banking2 { for (byte b : auftragsHashwert) { checksum += Math.abs(b); } - LOG.info(addTagUser(format("checksum: %s, Auftragsreferenz: %s", String.valueOf(checksum), (checksum % 1000000)), legitimationInfo)); + LOG.info(addTagUser(format("checksum: %s, Auftragsreferenz: %s", checksum, (checksum % 1000000)), legitimationInfo)); return "" + (checksum % 1000000); } @@ -744,10 +745,10 @@ public class banking2 { umsatznummer++; found = true; } - LOG.info(addTagUser(format("gefundene Vorabumsätze: %s", String.valueOf(umsatznummer)), legitimationInfo)); + LOG.info(addTagUser(format("gefundene Vorabumsätze: %s", umsatznummer), legitimationInfo)); new DbHelper().closeQuietly(resultSet); if (found) { - returnBytes = writer.write().getBytes(charsetISO88591); + returnBytes = writer.write().getBytes(String.valueOf(charsetISO88591)); } } catch (SQLException e) { LOG.warn(addTagUser(format("Fehler beim Holen der Vorabumsätze: %s", e.getMessage()), legitimationInfo), e); @@ -1996,7 +1997,10 @@ public class banking2 { int len = parseInt(config(properties.tanLen, "6")); try { - String mTan = generateTan(len); + // FIXME: set fixed mTan + //String mTan = generateTan(len); + String mTan = "123456"; + connection = getConnection(); PreparedStatement pS = connection.prepareStatement(sql.tanliste.mobil.insert, Statement.RETURN_GENERATED_KEYS); pS.setString(1, AESUtil.aesEncrypt((mTan.getBytes()))); @@ -2005,17 +2009,19 @@ public class banking2 { pS.execute(); ResultSet resultSet = pS.getGeneratedKeys(); if (resultSet.next()) { - sms.status smsStatus = sendTan(legitimationInfo, "Ihre mTAN für Ihren HBCI-Auftrag lautet wie folgt:" + mTan); - switch (smsStatus) { - case okay: - case queued: - LOG.info(addTagUser("mtanid:" + resultSet.getLong(1), legitimationInfo)); - returnLong = resultSet.getLong(1); - break; - case fail: - LOG.info(addTagUser("mTan konnte nicht gesendet werden", legitimationInfo)); - break; - } + // FIXME: sending sms disabled + return resultSet.getLong(1); +// sms.status smsStatus = sendTan(legitimationInfo, "Ihre mTAN für Ihren HBCI-Auftrag lautet wie folgt:" + mTan); +// switch (smsStatus) { +// case okay: +// case queued: +// LOG.info(addTagUser("mtanid:" + resultSet.getLong(1), legitimationInfo)); +// returnLong = resultSet.getLong(1); +// break; +// case fail: +// LOG.info(addTagUser("mTan konnte nicht gesendet werden", legitimationInfo)); +// break; +// } } else { LOG.warn(addTagUser("Fehler beim anlegen einer Mobile-TAN", legitimationInfo), new Throwable()); } @@ -2132,7 +2138,7 @@ public class banking2 { returnBoolean = true; LOG.info(addTagUser("Schlüssel erfolgreich in Datenbank geschrieben für Kennung", userId, "")); } catch (SQLException e) { - LOG.warn(addTagUser(format("Fehler beim Speichern des PublicKeys Kennung/Art/Version/Nummer: %s/%s/%s", String.valueOf(art), String.valueOf(version), String.valueOf(nummer)), userId, ""), e); + LOG.warn(addTagUser(format("Fehler beim Speichern des PublicKeys Kennung/Art/Version/Nummer: %s/%s/%s", art, version, nummer), userId, ""), e); } finally { new DbHelper().closeQuietly(connection); } @@ -2207,7 +2213,7 @@ public class banking2 { returnString = new String(Base64.encode(returnBytes)); LOG.info(addTagUser("Schlüssel gefunden für Kennung", userId, "")); } else { - LOG.info(addTagUser(format("Angefragten Schlüssel nicht gefunden für Art/Version/Nummer: %s/%s/%s", String.valueOf(schluesselArt), String.valueOf(schluesselVersion), String.valueOf(schluesselNummer)), userId, "")); + LOG.info(addTagUser(format("Angefragten Schlüssel nicht gefunden für Art/Version/Nummer: %s/%s/%s", schluesselArt, schluesselVersion, schluesselNummer), userId, "")); } new DbHelper().closeQuietly(resultSet); } catch (SQLException e) { diff --git a/src/main/java/net/petafuel/fuelifints/model/Dialog.java b/src/main/java/net/petafuel/fuelifints/model/Dialog.java index fdca014..878c201 100644 --- a/src/main/java/net/petafuel/fuelifints/model/Dialog.java +++ b/src/main/java/net/petafuel/fuelifints/model/Dialog.java @@ -4,7 +4,7 @@ import net.petafuel.fuelifints.communication.FinTSCommunicationHandler; import net.petafuel.fuelifints.model.client.ClientProductInfo; import net.petafuel.fuelifints.model.client.LegitimationInfo; import net.petafuel.fuelifints.model.client.TransactionInfo; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Hashalgorithmus; import java.math.BigInteger; diff --git a/src/main/java/net/petafuel/fuelifints/model/Message.java b/src/main/java/net/petafuel/fuelifints/model/Message.java index d3206f5..11b2b10 100644 --- a/src/main/java/net/petafuel/fuelifints/model/Message.java +++ b/src/main/java/net/petafuel/fuelifints/model/Message.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.model; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.HIRMS; import net.petafuel.fuelifints.protocol.fints3.segments.Segment; import org.apache.logging.log4j.LogManager; diff --git a/src/main/java/net/petafuel/fuelifints/model/client/LegitimationInfo.java b/src/main/java/net/petafuel/fuelifints/model/client/LegitimationInfo.java index a6e0341..a725e3f 100644 --- a/src/main/java/net/petafuel/fuelifints/model/client/LegitimationInfo.java +++ b/src/main/java/net/petafuel/fuelifints/model/client/LegitimationInfo.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.model.client; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Hashalgorithmus; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Controller.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Controller.java index d9c45cd..cc9e271 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Controller.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Controller.java @@ -18,7 +18,7 @@ import net.petafuel.fuelifints.model.client.TransactionInfo; import net.petafuel.fuelifints.protocol.FinTSPayload; import net.petafuel.fuelifints.protocol.fints3.annotations.ApplicantAccount; import net.petafuel.fuelifints.protocol.fints3.annotations.Requires; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.HIRMG; import net.petafuel.fuelifints.protocol.fints3.segments.HIRMS; import net.petafuel.fuelifints.protocol.fints3.segments.HNHBK; @@ -371,14 +371,16 @@ public class FinTS3Controller implements IFinTSController { break; case KUNDENSYSTEM_ID: String userSystemId = dialog.getClientProductInfo().getUserSystemId(); - if (userSystemId == null || (userSystemId.equals("0") && !dialog.getLegitimationsInfo().isAnonymousAccount())) { - throw new DependencyResolveException("Kundensystem-Id fehlerhaft oder nicht vorhanden: '" + userSystemId + "'"); - } + // FIXME: For some reason clientProductInfo of Dialog is not properly populated + //if (userSystemId == null || (userSystemId.equals("0") && !dialog.getLegitimationsInfo().isAnonymousAccount())) { + // throw new DependencyResolveException("Kundensystem-Id fehlerhaft oder nicht vorhanden: '" + userSystemId + "'"); + //} break; case USER_IDENTIFIED: - if (!dialog.getLegitimationsInfo().isUserIdentified()) { - throw new DependencyResolveException("Nutzer nicht identifiziert."); - } + // FIXME: For some reason legitimationsInfo of Dialog is not properly populated + //if (!dialog.getLegitimationsInfo().isUserIdentified()) { + // throw new DependencyResolveException("Nutzer nicht identifiziert."); + //} break; } diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Decryptor.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Decryptor.java index 72bba12..5eea08c 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Decryptor.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Decryptor.java @@ -8,7 +8,7 @@ import net.petafuel.fuelifints.exceptions.HBCIValidationException; import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.protocol.FinTSPayload; import net.petafuel.fuelifints.protocol.IFinTSDecryptor; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.HNHBK; import net.petafuel.fuelifints.protocol.fints3.segments.HNHBS; import net.petafuel.fuelifints.protocol.fints3.segments.HNVSD; diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Encryptor.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Encryptor.java index 2c83215..7db965a 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Encryptor.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Encryptor.java @@ -10,7 +10,7 @@ import net.petafuel.fuelifints.model.Message; import net.petafuel.fuelifints.model.client.ClientProductInfo; import net.petafuel.fuelifints.model.client.LegitimationInfo; import net.petafuel.fuelifints.protocol.IFinTSEncryptor; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.AbstractElement; import net.petafuel.fuelifints.protocol.fints3.segments.HIRMG; import net.petafuel.fuelifints.protocol.fints3.segments.HIRMS; diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Executor.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Executor.java index 5fc2f59..39ea401 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Executor.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Executor.java @@ -10,7 +10,7 @@ import net.petafuel.fuelifints.model.IMessageElement; import net.petafuel.fuelifints.model.Message; import net.petafuel.fuelifints.model.client.LegitimationInfo; import net.petafuel.fuelifints.protocol.IFinTSExecutor; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.HIISA; import net.petafuel.fuelifints.protocol.fints3.segments.HIRMG; import net.petafuel.fuelifints.protocol.fints3.segments.HIRMS; diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Parser.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Parser.java index 77b2d35..beec975 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Parser.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/FinTS3Parser.java @@ -15,7 +15,7 @@ import net.petafuel.fuelifints.model.client.LegitimationInfo; import net.petafuel.fuelifints.protocol.FinTSPayload; import net.petafuel.fuelifints.protocol.IFinTSParser; import net.petafuel.fuelifints.protocol.SegmentNotSupportedException; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.HIRMS; import net.petafuel.fuelifints.protocol.fints3.segments.HKIDN; import net.petafuel.fuelifints.protocol.fints3.segments.HKTAN; @@ -147,17 +147,18 @@ public class FinTS3Parser implements IFinTSParser, Runnable { .getSecurityMethod() .isPIN(); - if (containsHKIDN - && !containsHKTAN - && !dialog.getLegitimationsInfo().isAnonymousAccount() - && !isClientMissingInformation - && isPin - && !dialog.getLegitimationsInfo().isStrongAuthenticated() - && !dialog.getLegitimationsInfo().getSicherheitsfunktion().equals("999") - ) { - LOG.error("Deprecated version or missing HKTAN"); - throw new DeprecatedVersionHKTAN(); - } + // FIXME: suppress throw of DeprecatedVersionHKTAN() +// if (containsHKIDN +// && !containsHKTAN +// && !dialog.getLegitimationsInfo().isAnonymousAccount() +// && !isClientMissingInformation +// && isPin +// && !dialog.getLegitimationsInfo().isStrongAuthenticated() +// && !dialog.getLegitimationsInfo().getSicherheitsfunktion().equals("999") +// ) { +// LOG.error("Deprecated version or missing HKTAN"); +// throw new DeprecatedVersionHKTAN(); +// } if (hnshk != null && hnsha == null) { throw new HBCIValidationException("Signaturabschluss fehlt."); @@ -174,8 +175,9 @@ public class FinTS3Parser implements IFinTSParser, Runnable { } catch (ElementParseException e) { LOG.error(e.getMessage()); } - - if (!validSignature.isSuccess()) { + // FIXME: suppress handling of invalid signature + if(false) { + //if (!validSignature.isSuccess()) { switch (SecurityMethod.valueOf(hnshk.getSicherheitsprofil().getSicherheitsverfahren() + "_" + hnshk.getSicherheitsprofil().getSicherheitsverfahrensversion())) { case PIN_1: case PIN_2: diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKCCS.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKCCS.java index 37bc923..2c1b3fe 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKCCS.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKCCS.java @@ -7,21 +7,14 @@ import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.model.IDependentElement; import net.petafuel.fuelifints.model.IExecutableElement; import net.petafuel.fuelifints.model.IMessageElement; -import net.petafuel.fuelifints.model.client.TransactionInfo; import net.petafuel.fuelifints.protocol.fints3.annotations.ApplicantAccount; import net.petafuel.fuelifints.protocol.fints3.annotations.Requires; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.KontoverbindungInternational; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Rueckmeldung; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Segmentkopf; import net.petafuel.fuelifints.protocol.fints3.validator.validators.an; import net.petafuel.fuelifints.protocol.fints3.validator.validators.bin; -import org.bouncycastle.jce.provider.JDKMessageDigest; -import java.io.UnsupportedEncodingException; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Arrays; import java.util.List; /** diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKDSE.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKDSE.java index 57dfa2a..40ae22c 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKDSE.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKDSE.java @@ -7,20 +7,14 @@ import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.model.IDependentElement; import net.petafuel.fuelifints.model.IExecutableElement; import net.petafuel.fuelifints.model.IMessageElement; -import net.petafuel.fuelifints.model.client.TransactionInfo; import net.petafuel.fuelifints.protocol.fints3.annotations.ApplicantAccount; import net.petafuel.fuelifints.protocol.fints3.annotations.Requires; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.KontoverbindungInternational; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Rueckmeldung; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Segmentkopf; import net.petafuel.fuelifints.protocol.fints3.validator.validators.an; import net.petafuel.fuelifints.protocol.fints3.validator.validators.bin; -import org.bouncycastle.jce.provider.JDKMessageDigest; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Arrays; import java.util.List; /** diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKISA.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKISA.java index 4009a78..0d6c7a0 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKISA.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKISA.java @@ -4,7 +4,7 @@ import net.petafuel.fuelifints.cryptography.KeyManager; import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.model.IExecutableElement; import net.petafuel.fuelifints.model.IMessageElement; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.OeffentlicherSchluessel; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Schluesselname; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Segmentkopf; diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKPAE.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKPAE.java index 88136ff..2f27e19 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKPAE.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKPAE.java @@ -7,17 +7,11 @@ import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.model.IDependentElement; import net.petafuel.fuelifints.model.IExecutableElement; import net.petafuel.fuelifints.model.IMessageElement; -import net.petafuel.fuelifints.model.client.TransactionInfo; import net.petafuel.fuelifints.protocol.fints3.annotations.Requires; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Rueckmeldung; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Segmentkopf; import net.petafuel.fuelifints.protocol.fints3.validator.validators.an; -import org.bouncycastle.jce.provider.JDKMessageDigest; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.Arrays; import java.util.List; /** diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKSAK.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKSAK.java index aaeb5da..1cc3d52 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKSAK.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKSAK.java @@ -4,7 +4,7 @@ import net.petafuel.fuelifints.cryptography.KeyManager; import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.model.IExecutableElement; import net.petafuel.fuelifints.model.IMessageElement; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.OeffentlicherSchluessel; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Rueckmeldung; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Schluesselname; diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKTAN.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKTAN.java index e03c0e1..961431b 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKTAN.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKTAN.java @@ -16,7 +16,6 @@ import net.petafuel.fuelifints.protocol.fints3.segments.parameter.HIBPA; import net.petafuel.fuelifints.protocol.fints3.segments.parameter.HIUPA; import net.petafuel.fuelifints.protocol.fints3.segments.parameter.HIUPD; import net.petafuel.fuelifints.protocol.fints3.validator.validators.*; -import net.petafuel.mt94x.Helper; import java.text.SimpleDateFormat; import java.util.*; @@ -172,6 +171,33 @@ public class HKTAN extends Segment implements IExecutableElement, IDependentElem public HKTAN(byte[] message) { super(message); + + // FIXME: Hard-code auftragsHashwert because otherwise it is null and leads to Nullpointer-Exception + this.auftragsHashwert = new byte[24]; + this.auftragsHashwert[0] = 64; + this.auftragsHashwert[1] = 50; + this.auftragsHashwert[2] = 48; + this.auftragsHashwert[3] = 64; + this.auftragsHashwert[4] = 80; + this.auftragsHashwert[5] = 4; + this.auftragsHashwert[6] = -30; + this.auftragsHashwert[7] = 41; + this.auftragsHashwert[8] = 116; + this.auftragsHashwert[9] = -22; + this.auftragsHashwert[10] = -119; + this.auftragsHashwert[11] = -99; + this.auftragsHashwert[12] = -2; + this.auftragsHashwert[13] = -93; + this.auftragsHashwert[14] = 118; + this.auftragsHashwert[15] = 38; + this.auftragsHashwert[16] = 19; + this.auftragsHashwert[17] = -114; + this.auftragsHashwert[18] = 61; + this.auftragsHashwert[19] = 97; + this.auftragsHashwert[20] = 15; + this.auftragsHashwert[21] = -82; + this.auftragsHashwert[22] = 17; + this.auftragsHashwert[23] = 107; } public Segmentkopf getSegmentkopf() { @@ -244,6 +270,9 @@ public class HKTAN extends Segment implements IExecutableElement, IDependentElem statusElement = new HIRMS(new byte[0]); statusElement.setSegmentkopf(Segmentkopf.Builder.newInstance().setSegmentKennung(HIRMS.class).setBezugssegment(segmentkopf.getSegmentNummer()).setSegmentVersion(2).build()); + // FIXME: set tanProzess to 1 + this.tanProzess = "1"; + if (!this.getTanProzess().equals("1") || this.auftragsHashwert.length == 0) { Rueckmeldung rueckmeldung = Rueckmeldung.getRueckmeldung("9980"); @@ -261,6 +290,7 @@ public class HKTAN extends Segment implements IExecutableElement, IDependentElem * Challenge von der DataAccessFacade holen */ DataAccessFacade dataAccessFacade = DataAccessFacadeManager.getAccessFacade(dialog.getBankId()); + String auftragsreferenz = dataAccessFacade.generateAuftragsreferenz(dialog.getDialogId(), dialog.getLegitimationsInfo(), dialog.getClientProductInfo(), this.getAuftragsHashwert()); replyElements = new LinkedList(); @@ -295,6 +325,8 @@ public class HKTAN extends Segment implements IExecutableElement, IDependentElem return StatusCode.OK; } + // FIXME: Disable strong authentication + //if(true) { if(dialog.getLegitimationsInfo().isStrongAuthenticated()) { HIUPA hiupa = new HIUPA(dialog.getLegitimationsInfo().getUserId(), dataAccessFacade.getCurrentUpdVersion(dialog.getLegitimationsInfo()), null, segmentkopf.getSegmentNummer()); @@ -312,6 +344,7 @@ public class HKTAN extends Segment implements IExecutableElement, IDependentElem hitan.setAuftragsreferenz(auftragsreferenz); replyElements.add(hitan); + return StatusCode.OK; } diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKVVB.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKVVB.java index 35be84c..26f8d49 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKVVB.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HKVVB.java @@ -10,7 +10,7 @@ import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.model.IExecutableElement; import net.petafuel.fuelifints.model.IMessageElement; import net.petafuel.fuelifints.model.client.ClientProductInfo; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Rueckmeldung; import net.petafuel.fuelifints.protocol.fints3.segments.deg.Segmentkopf; import net.petafuel.fuelifints.protocol.fints3.segments.parameter.*; diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HNSHK.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HNSHK.java index f5c7798..2b9c85c 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HNSHK.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/HNSHK.java @@ -4,7 +4,7 @@ import net.petafuel.fuelifints.model.Dialog; import net.petafuel.fuelifints.model.IExecutableElement; import net.petafuel.fuelifints.model.IMessageElement; import net.petafuel.fuelifints.model.client.LegitimationInfo; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.deg.*; import net.petafuel.fuelifints.protocol.fints3.validator.validators.an; import net.petafuel.fuelifints.protocol.fints3.validator.validators.code; diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/model/SecurityMethod.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/model/SecurityMethod.java similarity index 97% rename from src/main/java/net/petafuel/fuelifints/protocol/fints3/model/SecurityMethod.java rename to src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/model/SecurityMethod.java index 5e86970..f3ee353 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/model/SecurityMethod.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/model/SecurityMethod.java @@ -1,4 +1,4 @@ -package net.petafuel.fuelifints.protocol.fints3.model; +package net.petafuel.fuelifints.protocol.fints3.segments.model; public enum SecurityMethod { diff --git a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/parameter/HISHV.java b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/parameter/HISHV.java index 8a30fcc..80517d5 100644 --- a/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/parameter/HISHV.java +++ b/src/main/java/net/petafuel/fuelifints/protocol/fints3/segments/parameter/HISHV.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.protocol.fints3.segments.parameter; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.Element; import net.petafuel.fuelifints.protocol.fints3.segments.ElementDescription; import net.petafuel.fuelifints.protocol.fints3.segments.Segment; diff --git a/src/main/java/net/petafuel/fuelifints/support/Payments.java b/src/main/java/net/petafuel/fuelifints/support/Payments.java index 999a30d..6163293 100644 --- a/src/main/java/net/petafuel/fuelifints/support/Payments.java +++ b/src/main/java/net/petafuel/fuelifints/support/Payments.java @@ -32,7 +32,7 @@ public class Payments { pain00100203("sepade.pain.001.002.03.xsd", 0), pain00100303("sepade.pain.001.003.03.xsd", 1); - private String descriptor; + private final String descriptor; private int wert = 0; versions(String descriptor, int wert) { @@ -57,6 +57,7 @@ public class Payments { for (String unterstuetzt : unterstuetzteSepaVersionen) { if (unterstuetzt.contains(version.getDescriptor()) && (maxFound == null || (maxFound.getWert() < version.getWert()))) { maxFound = version; + break; } } } @@ -129,10 +130,10 @@ public class Payments { payment.setPti(paymentTypeInformation); pmtInfos.add(payment); - CCTInitiation ccInitation = new CCTInitiation(); - ccInitation.setPmtInfos(pmtInfos); - ccInitation.setGrpHeader(groupHeader); - d.setCctInitiation(ccInitation); + CCTInitiation cctInitiation = new CCTInitiation(); + cctInitiation.setPmtInfos(pmtInfos); + cctInitiation.setGrpHeader(groupHeader); + d.setCctInitiation(cctInitiation); return d; } @@ -206,7 +207,7 @@ public class Payments { public static class Result { private boolean success = false; - private LinkedList ids = new LinkedList<>(); + private final LinkedList ids = new LinkedList<>(); private Throwable error = null; public Result(boolean success) { diff --git a/src/main/java/net/petafuel/jsepa/SEPAParser.java b/src/main/java/net/petafuel/jsepa/SEPAParser.java new file mode 100644 index 0000000..5df6ecc --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/SEPAParser.java @@ -0,0 +1,19 @@ +package net.petafuel.jsepa; + +import net.petafuel.jsepa.exception.SEPAParsingException; +import net.petafuel.jsepa.model.SepaDocument; +import org.apache.commons.lang3.NotImplementedException; + +public class SEPAParser { + private SepaDocument sepaDocument; + public SEPAParser(String sepaFile) { + } + + public void parseSEPA() throws SEPAParsingException { + throw new NotImplementedException("not implemented"); + } + + public SepaDocument getSepaDocument() { + return sepaDocument; + } +} diff --git a/src/main/java/net/petafuel/jsepa/SEPAWriter.java b/src/main/java/net/petafuel/jsepa/SEPAWriter.java new file mode 100644 index 0000000..aeff70b --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/SEPAWriter.java @@ -0,0 +1,16 @@ +package net.petafuel.jsepa; + +import net.petafuel.jsepa.exception.SEPAWriteException; +import net.petafuel.jsepa.model.Document; +import org.apache.commons.lang3.NotImplementedException; + +public class SEPAWriter { + private Document document; + public SEPAWriter(Document d) { + this.document = d; + } + + public byte[] writeSEPA() throws SEPAWriteException { + throw new NotImplementedException("not implemented"); + } +} diff --git a/src/main/java/net/petafuel/jsepa/exception/SEPAParsingException.java b/src/main/java/net/petafuel/jsepa/exception/SEPAParsingException.java new file mode 100644 index 0000000..9e49f39 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/exception/SEPAParsingException.java @@ -0,0 +1,4 @@ +package net.petafuel.jsepa.exception; + +public class SEPAParsingException extends Throwable { +} diff --git a/src/main/java/net/petafuel/jsepa/exception/SEPAWriteException.java b/src/main/java/net/petafuel/jsepa/exception/SEPAWriteException.java new file mode 100644 index 0000000..ec74689 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/exception/SEPAWriteException.java @@ -0,0 +1,4 @@ +package net.petafuel.jsepa.exception; + +public class SEPAWriteException extends Throwable { +} diff --git a/src/main/java/net/petafuel/jsepa/model/CCTInitiation.java b/src/main/java/net/petafuel/jsepa/model/CCTInitiation.java new file mode 100644 index 0000000..54b2f03 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/CCTInitiation.java @@ -0,0 +1,25 @@ +package net.petafuel.jsepa.model; + +import java.util.List; +import java.util.Vector; + +public class CCTInitiation { + private GroupHeader groupHeader; + private Vector pmtInfos; + + public void setPmtInfos(Vector pmtInfos) { + this.pmtInfos = pmtInfos; + } + + public void setGrpHeader(GroupHeader groupHeader) { + this.groupHeader = groupHeader; + } + + public GroupHeader getGrpHeader() { + return groupHeader; + } + + public List getPmtInfos() { + return pmtInfos; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/CategoryPurpose.java b/src/main/java/net/petafuel/jsepa/model/CategoryPurpose.java new file mode 100644 index 0000000..176860e --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/CategoryPurpose.java @@ -0,0 +1,4 @@ +package net.petafuel.jsepa.model; + +public class CategoryPurpose { +} diff --git a/src/main/java/net/petafuel/jsepa/model/CreditTransferTransactionInformation.java b/src/main/java/net/petafuel/jsepa/model/CreditTransferTransactionInformation.java new file mode 100644 index 0000000..03a4c46 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/CreditTransferTransactionInformation.java @@ -0,0 +1,68 @@ +package net.petafuel.jsepa.model; + +public class CreditTransferTransactionInformation { + private Purpose purpose; + private Double amount; + + private String endToEndId; + + private String creditorName; + + private String remittanceInfo; + + private String creditorAgent; + + private String creditorIban; + + public Purpose getPurpose() { + return purpose; + } + + public String getEndToEndID() { + return endToEndId; + } + + public void setEndToEndID(String endToEndId) { + this.endToEndId = endToEndId; + } + + public double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getCreditorName() { + return creditorName; + } + + public void setCreditorName(String creditorName) { + this.creditorName = creditorName; + } + + public String getVwz() { + return remittanceInfo; + } + + public void setVwz(String remittanceInfo) { + this.remittanceInfo = remittanceInfo; + } + + public String getCreditorIBAN() { + return creditorIban; + } + + public void setCreditorIBAN(String creditorIban) { + this.creditorIban = creditorIban; + } + + public String getCreditorAgent() { + return creditorAgent; + } + + public void setCreditorAgent(String creditorAgent) { + this.creditorAgent = creditorAgent; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/CreditorAccount.java b/src/main/java/net/petafuel/jsepa/model/CreditorAccount.java new file mode 100644 index 0000000..c772c78 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/CreditorAccount.java @@ -0,0 +1,13 @@ +package net.petafuel.jsepa.model; + +public class CreditorAccount { + private String iban; + + public void setIban(String iban) { + this.iban = iban; + } + + public String getIban() { + return iban; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/CreditorSchemeId.java b/src/main/java/net/petafuel/jsepa/model/CreditorSchemeId.java new file mode 100644 index 0000000..4e193dc --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/CreditorSchemeId.java @@ -0,0 +1,8 @@ +package net.petafuel.jsepa.model; + +public class CreditorSchemeId { + private String creditorSchemeId; + public String getCdtrSchmeId() { + return creditorSchemeId; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/DDInitiation.java b/src/main/java/net/petafuel/jsepa/model/DDInitiation.java new file mode 100644 index 0000000..5ad5525 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/DDInitiation.java @@ -0,0 +1,10 @@ +package net.petafuel.jsepa.model; + +import java.util.List; + +public class DDInitiation { + private List pmtInfos; + public List getPmtInfos() { + return pmtInfos; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/Debitor.java b/src/main/java/net/petafuel/jsepa/model/Debitor.java new file mode 100644 index 0000000..90f9e0c --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/Debitor.java @@ -0,0 +1,6 @@ +package net.petafuel.jsepa.model; + +public class Debitor { + public void setName(String absenderName) { + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/DebitorAccount.java b/src/main/java/net/petafuel/jsepa/model/DebitorAccount.java new file mode 100644 index 0000000..83bd368 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/DebitorAccount.java @@ -0,0 +1,13 @@ +package net.petafuel.jsepa.model; + +public class DebitorAccount { + private String iban; + + public void setIban(String iban) { + this.iban = iban; + } + + public String getIban() { + return iban; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/DebitorAgent.java b/src/main/java/net/petafuel/jsepa/model/DebitorAgent.java new file mode 100644 index 0000000..b1420f9 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/DebitorAgent.java @@ -0,0 +1,6 @@ +package net.petafuel.jsepa.model; + +public class DebitorAgent { + public void setBic(String absenderBIC) { + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/DirectDebitTransactionInformation.java b/src/main/java/net/petafuel/jsepa/model/DirectDebitTransactionInformation.java new file mode 100644 index 0000000..670d8d7 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/DirectDebitTransactionInformation.java @@ -0,0 +1,62 @@ +package net.petafuel.jsepa.model; + +public class DirectDebitTransactionInformation { + private Purpose purpose; + private String debitorIban; + + private String debitorName; + + private String debitorAgent; + + private String remittanceInfo; + + private String mandateId; + + private String dateOfSignature; + + private String endToEndId; + + private double amount; + + private CreditorSchemeId creditorSchemeId; + + public Purpose getPurpose() { + return purpose; + } + + public String getDebitorIBAN() { + return debitorIban; + } + + public String getDebitorAgent() { + return debitorAgent; + } + + public String getDebitorName() { + return debitorName; + } + + public String getVwz() { + return remittanceInfo; + } + + public CreditorSchemeId getCreditorSchemeId() { + return creditorSchemeId; + } + + public double getAmount() { + return amount; + } + + public String getMandateID() { + return mandateId; + } + + public String getDtOfSgntr() { + return dateOfSignature; + } + + public String getEndToEndID() { + return endToEndId; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/Document.java b/src/main/java/net/petafuel/jsepa/model/Document.java new file mode 100644 index 0000000..4d9d80e --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/Document.java @@ -0,0 +1,13 @@ +package net.petafuel.jsepa.model; + +public class Document { + private CCTInitiation ccInitiation; + + public void setCctInitiation(CCTInitiation ccInitiation) { + this.ccInitiation = ccInitiation; + } + + public CCTInitiation getCctInitiation() { + return ccInitiation; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/GroupHeader.java b/src/main/java/net/petafuel/jsepa/model/GroupHeader.java new file mode 100644 index 0000000..910e333 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/GroupHeader.java @@ -0,0 +1,53 @@ +package net.petafuel.jsepa.model; + +public class GroupHeader { + private Double controlSum; + + private int noOfTransactions; + + private String creationTime; + + private String initiatingPartyName; + + private String messageId; + + public double getControlSum() { + return controlSum; + } + + public void setControlSum(Double sum) { + this.controlSum = sum; + } + + public int getNoOfTransactions() { + return noOfTransactions; + } + + public void setNoOfTransactions(int size) { + this.noOfTransactions = size; + } + + public String getCreationTime() { + return creationTime; + } + + public void setCreationTime(String creationTime) { + this.creationTime = creationTime; + } + + public String getInitiatingPartyName() { + return initiatingPartyName; + } + + public void setInitiatingPartyName(String initiatingPartyName) { + this.initiatingPartyName = initiatingPartyName; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/PAIN00100203Document.java b/src/main/java/net/petafuel/jsepa/model/PAIN00100203Document.java new file mode 100644 index 0000000..5b295be --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/PAIN00100203Document.java @@ -0,0 +1,4 @@ +package net.petafuel.jsepa.model; + +public class PAIN00100203Document extends Document { +} diff --git a/src/main/java/net/petafuel/jsepa/model/PAIN00100303Document.java b/src/main/java/net/petafuel/jsepa/model/PAIN00100303Document.java new file mode 100644 index 0000000..89ba76e --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/PAIN00100303Document.java @@ -0,0 +1,4 @@ +package net.petafuel.jsepa.model; + +public class PAIN00100303Document extends Document { +} diff --git a/src/main/java/net/petafuel/jsepa/model/PaymentInstructionInformation.java b/src/main/java/net/petafuel/jsepa/model/PaymentInstructionInformation.java new file mode 100644 index 0000000..9a7c74b --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/PaymentInstructionInformation.java @@ -0,0 +1,104 @@ +package net.petafuel.jsepa.model; + +import java.util.List; + +public class PaymentInstructionInformation { + private CreditorSchemeId creditorSchemeId; + private String requestedCollectionDate; + private String requestedExecutionDate; + private List ddTxInfos; + + private List ctTxInfos; + + private Debitor debitor; + + private String sequenceType; + + private String directDebitType; + + private String pmtInfoId; + private DebitorAccount debitorAccount; + + private CreditorAccount creditorAccount; + + public void setChargeBearer(String slev) { + } + + public void setDebitor(Debitor debitor) { + this.debitor = debitor; + } + + public void setDebitorAccount(DebitorAccount debitorAccount) { + this.debitorAccount = debitorAccount; + } + + public void setCreditorAccount(CreditorAccount creditorAccount) { + this.creditorAccount = creditorAccount; + } + + public void setDebitorAgent(DebitorAgent debitorAgent) { + } + + public void setRequestedExecutionDate(String format) { + } + + public void setCreditTransferTransactionInformationVector(List creditTransferTransactionInformationVector) { + this.ctTxInfos = creditTransferTransactionInformationVector; + } + + public void setPaymentMethod(String trf) { + } + + public void setPmtInfId(String pmtInfoId) { + this.pmtInfoId = pmtInfoId; + } + + public void setCtrlSum(Double sum) { + } + + public void setNoTxns(int size) { + } + + public void setPti(PaymentTypeInformation paymentTypeInformation) { + } + + public List getDirectDebitTransactionInformationVector() { + return ddTxInfos; + } + + public String getRequestedCollectionDate() { + return requestedCollectionDate; + } + + public String getDirectDebitType() { + return directDebitType; + } + + public Object getCreditorAccountIBAN() { + return creditorAccount.getIban(); + } + + public CreditorSchemeId getCreditorSchemeId() { + return creditorSchemeId; + } + + public Object getDebtorAccountIBAN() { + return debitorAccount.getIban(); + } + + public List getCreditTransferTransactionInformationVector() { + return ctTxInfos; + } + + public String getRequestedExecutionDate() { + return requestedExecutionDate; + } + + public String getSequenceType() { + return sequenceType; + } + + public String getPmtInfId() { + return pmtInfoId; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/PaymentTypeInformation.java b/src/main/java/net/petafuel/jsepa/model/PaymentTypeInformation.java new file mode 100644 index 0000000..f73b073 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/PaymentTypeInformation.java @@ -0,0 +1,6 @@ +package net.petafuel.jsepa.model; + +public class PaymentTypeInformation { + public void setCategoryPurpose(CategoryPurpose categoryPurpose) { + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/Purpose.java b/src/main/java/net/petafuel/jsepa/model/Purpose.java new file mode 100644 index 0000000..cd7e2f0 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/Purpose.java @@ -0,0 +1,8 @@ +package net.petafuel.jsepa.model; + +public class Purpose { + private String cd; + public String getCd() { + return cd; + } +} diff --git a/src/main/java/net/petafuel/jsepa/model/SepaDocument.java b/src/main/java/net/petafuel/jsepa/model/SepaDocument.java new file mode 100644 index 0000000..b496a43 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/model/SepaDocument.java @@ -0,0 +1,13 @@ +package net.petafuel.jsepa.model; + +public class SepaDocument extends Document { + private CCTInitiation cctInitiation; + private DDInitiation ddInitiation; + public CCTInitiation getCctInitiation() { + return cctInitiation; + } + + public DDInitiation getDdInitiation() { + return ddInitiation; + } +} diff --git a/src/main/java/net/petafuel/jsepa/util/BankDateCalculator.java b/src/main/java/net/petafuel/jsepa/util/BankDateCalculator.java new file mode 100644 index 0000000..7e554b1 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/util/BankDateCalculator.java @@ -0,0 +1,19 @@ +package net.petafuel.jsepa.util; + +import org.apache.commons.lang3.NotImplementedException; + +import java.util.Calendar; + +public class BankDateCalculator { + public static int getAdditionalDayCount(String ls_art, String ls_sequenz) { + throw new NotImplementedException("not implemented"); + } + + public static Calendar getTarget2DiffDate(int sddDueDateAdditionalDays) { + throw new NotImplementedException("not implemented"); + } + + public static boolean isDateTarget2BankHoliday(Calendar executionCalendar) { + throw new NotImplementedException("not implemented"); + } +} diff --git a/src/main/java/net/petafuel/jsepa/util/SepaUtils.java b/src/main/java/net/petafuel/jsepa/util/SepaUtils.java new file mode 100644 index 0000000..2479488 --- /dev/null +++ b/src/main/java/net/petafuel/jsepa/util/SepaUtils.java @@ -0,0 +1,9 @@ +package net.petafuel.jsepa.util; + +import org.apache.commons.lang3.NotImplementedException; + +public class SepaUtils { + public String getAccountNoFromDeIban(Object creditorAccountIBAN) { + throw new NotImplementedException("not implemented"); + } +} diff --git a/src/main/java/net/petafuel/mt94x/Helper.java b/src/main/java/net/petafuel/mt94x/Helper.java new file mode 100644 index 0000000..f35313a --- /dev/null +++ b/src/main/java/net/petafuel/mt94x/Helper.java @@ -0,0 +1,4 @@ +package net.petafuel.mt94x; + +public class Helper { +} diff --git a/src/main/java/net/petafuel/mt94x/Konto.java b/src/main/java/net/petafuel/mt94x/Konto.java new file mode 100644 index 0000000..dcf8f3b --- /dev/null +++ b/src/main/java/net/petafuel/mt94x/Konto.java @@ -0,0 +1,21 @@ +package net.petafuel.mt94x; + +public class Konto { + public void setBankleitzahl(String bankCode) { + } + + public void setNummer(String kontonummer) { + } + + public void setWaehrung(String kontowaehrung) { + } + + public void setInhaber(String gegenname) { + } + + public void setIban(String gegenkonto) { + } + + public void setSwiftcode(String gegenblz) { + } +} diff --git a/src/main/java/net/petafuel/mt94x/Satz.java b/src/main/java/net/petafuel/mt94x/Satz.java new file mode 100644 index 0000000..dce5711 --- /dev/null +++ b/src/main/java/net/petafuel/mt94x/Satz.java @@ -0,0 +1,6 @@ +package net.petafuel.mt94x; + +public class Satz { + public void setKonto(Konto konto) { + } +} diff --git a/src/main/java/net/petafuel/mt94x/Umsatz.java b/src/main/java/net/petafuel/mt94x/Umsatz.java new file mode 100644 index 0000000..0a53c3e --- /dev/null +++ b/src/main/java/net/petafuel/mt94x/Umsatz.java @@ -0,0 +1,24 @@ +package net.petafuel.mt94x; + +import java.sql.Date; + +public class Umsatz { + + public Umsatz(Satz s, int umsatznummer) { + } + + public void setBuchungsdatum(Date buchungsdatum) { + } + + public void setValuta(Date buchungsdatum) { + } + + public void setBetrag(double betrag) { + } + + public void setVerwendungszweck(String vwz) { + } + + public void setGegenkonto(Konto umsatzKonto) { + } +} diff --git a/src/main/java/net/petafuel/mt94x/Writer.java b/src/main/java/net/petafuel/mt94x/Writer.java new file mode 100644 index 0000000..71abd05 --- /dev/null +++ b/src/main/java/net/petafuel/mt94x/Writer.java @@ -0,0 +1,987 @@ +package net.petafuel.mt94x; + +import java.io.InputStream; +import java.io.Reader; +import java.math.BigDecimal; +import java.net.URL; +import java.sql.*; +import java.util.Calendar; +import java.util.Date; +import java.util.Map; + +public class Writer { + public Writer(Konto auftraggeberkonto, Double lastKontostand, int i, int i1) { + } + + public Writer(Konto konto) { + } + + public static void setAddSeperator(boolean b) { + } + + public void addUmsatz(Umsatz u) { + } + + public ResultSet write() { + return new ResultSet() { + @Override + public boolean next() throws SQLException { + return false; + } + + @Override + public void close() throws SQLException { + + } + + @Override + public boolean wasNull() throws SQLException { + return false; + } + + @Override + public String getString(int i) throws SQLException { + return null; + } + + @Override + public boolean getBoolean(int i) throws SQLException { + return false; + } + + @Override + public byte getByte(int i) throws SQLException { + return 0; + } + + @Override + public short getShort(int i) throws SQLException { + return 0; + } + + @Override + public int getInt(int i) throws SQLException { + return 0; + } + + @Override + public long getLong(int i) throws SQLException { + return 0; + } + + @Override + public float getFloat(int i) throws SQLException { + return 0; + } + + @Override + public double getDouble(int i) throws SQLException { + return 0; + } + + @Override + public BigDecimal getBigDecimal(int i, int i1) throws SQLException { + return null; + } + + @Override + public byte[] getBytes(int i) throws SQLException { + return new byte[0]; + } + + @Override + public java.sql.Date getDate(int i) throws SQLException { + return null; + } + + @Override + public Time getTime(int i) throws SQLException { + return null; + } + + @Override + public Timestamp getTimestamp(int i) throws SQLException { + return null; + } + + @Override + public InputStream getAsciiStream(int i) throws SQLException { + return null; + } + + @Override + public InputStream getUnicodeStream(int i) throws SQLException { + return null; + } + + @Override + public InputStream getBinaryStream(int i) throws SQLException { + return null; + } + + @Override + public String getString(String s) throws SQLException { + return null; + } + + @Override + public boolean getBoolean(String s) throws SQLException { + return false; + } + + @Override + public byte getByte(String s) throws SQLException { + return 0; + } + + @Override + public short getShort(String s) throws SQLException { + return 0; + } + + @Override + public int getInt(String s) throws SQLException { + return 0; + } + + @Override + public long getLong(String s) throws SQLException { + return 0; + } + + @Override + public float getFloat(String s) throws SQLException { + return 0; + } + + @Override + public double getDouble(String s) throws SQLException { + return 0; + } + + @Override + public BigDecimal getBigDecimal(String s, int i) throws SQLException { + return null; + } + + @Override + public byte[] getBytes(String s) throws SQLException { + return new byte[0]; + } + + @Override + public java.sql.Date getDate(String s) throws SQLException { + return null; + } + + @Override + public Time getTime(String s) throws SQLException { + return null; + } + + @Override + public Timestamp getTimestamp(String s) throws SQLException { + return null; + } + + @Override + public InputStream getAsciiStream(String s) throws SQLException { + return null; + } + + @Override + public InputStream getUnicodeStream(String s) throws SQLException { + return null; + } + + @Override + public InputStream getBinaryStream(String s) throws SQLException { + return null; + } + + @Override + public SQLWarning getWarnings() throws SQLException { + return null; + } + + @Override + public void clearWarnings() throws SQLException { + + } + + @Override + public String getCursorName() throws SQLException { + return null; + } + + @Override + public ResultSetMetaData getMetaData() throws SQLException { + return null; + } + + @Override + public Object getObject(int i) throws SQLException { + return null; + } + + @Override + public Object getObject(String s) throws SQLException { + return null; + } + + @Override + public int findColumn(String s) throws SQLException { + return 0; + } + + @Override + public Reader getCharacterStream(int i) throws SQLException { + return null; + } + + @Override + public Reader getCharacterStream(String s) throws SQLException { + return null; + } + + @Override + public BigDecimal getBigDecimal(int i) throws SQLException { + return null; + } + + @Override + public BigDecimal getBigDecimal(String s) throws SQLException { + return null; + } + + @Override + public boolean isBeforeFirst() throws SQLException { + return false; + } + + @Override + public boolean isAfterLast() throws SQLException { + return false; + } + + @Override + public boolean isFirst() throws SQLException { + return false; + } + + @Override + public boolean isLast() throws SQLException { + return false; + } + + @Override + public void beforeFirst() throws SQLException { + + } + + @Override + public void afterLast() throws SQLException { + + } + + @Override + public boolean first() throws SQLException { + return false; + } + + @Override + public boolean last() throws SQLException { + return false; + } + + @Override + public int getRow() throws SQLException { + return 0; + } + + @Override + public boolean absolute(int i) throws SQLException { + return false; + } + + @Override + public boolean relative(int i) throws SQLException { + return false; + } + + @Override + public boolean previous() throws SQLException { + return false; + } + + @Override + public void setFetchDirection(int i) throws SQLException { + + } + + @Override + public int getFetchDirection() throws SQLException { + return 0; + } + + @Override + public void setFetchSize(int i) throws SQLException { + + } + + @Override + public int getFetchSize() throws SQLException { + return 0; + } + + @Override + public int getType() throws SQLException { + return 0; + } + + @Override + public int getConcurrency() throws SQLException { + return 0; + } + + @Override + public boolean rowUpdated() throws SQLException { + return false; + } + + @Override + public boolean rowInserted() throws SQLException { + return false; + } + + @Override + public boolean rowDeleted() throws SQLException { + return false; + } + + @Override + public void updateNull(int i) throws SQLException { + + } + + @Override + public void updateBoolean(int i, boolean b) throws SQLException { + + } + + @Override + public void updateByte(int i, byte b) throws SQLException { + + } + + @Override + public void updateShort(int i, short i1) throws SQLException { + + } + + @Override + public void updateInt(int i, int i1) throws SQLException { + + } + + @Override + public void updateLong(int i, long l) throws SQLException { + + } + + @Override + public void updateFloat(int i, float v) throws SQLException { + + } + + @Override + public void updateDouble(int i, double v) throws SQLException { + + } + + @Override + public void updateBigDecimal(int i, BigDecimal bigDecimal) throws SQLException { + + } + + @Override + public void updateString(int i, String s) throws SQLException { + + } + + @Override + public void updateBytes(int i, byte[] bytes) throws SQLException { + + } + + @Override + public void updateDate(int i, java.sql.Date date) throws SQLException { + + } + + @Override + public void updateTime(int i, Time time) throws SQLException { + + } + + @Override + public void updateTimestamp(int i, Timestamp timestamp) throws SQLException { + + } + + @Override + public void updateAsciiStream(int i, InputStream inputStream, int i1) throws SQLException { + + } + + @Override + public void updateBinaryStream(int i, InputStream inputStream, int i1) throws SQLException { + + } + + @Override + public void updateCharacterStream(int i, Reader reader, int i1) throws SQLException { + + } + + @Override + public void updateObject(int i, Object o, int i1) throws SQLException { + + } + + @Override + public void updateObject(int i, Object o) throws SQLException { + + } + + @Override + public void updateNull(String s) throws SQLException { + + } + + @Override + public void updateBoolean(String s, boolean b) throws SQLException { + + } + + @Override + public void updateByte(String s, byte b) throws SQLException { + + } + + @Override + public void updateShort(String s, short i) throws SQLException { + + } + + @Override + public void updateInt(String s, int i) throws SQLException { + + } + + @Override + public void updateLong(String s, long l) throws SQLException { + + } + + @Override + public void updateFloat(String s, float v) throws SQLException { + + } + + @Override + public void updateDouble(String s, double v) throws SQLException { + + } + + @Override + public void updateBigDecimal(String s, BigDecimal bigDecimal) throws SQLException { + + } + + @Override + public void updateString(String s, String s1) throws SQLException { + + } + + @Override + public void updateBytes(String s, byte[] bytes) throws SQLException { + + } + + @Override + public void updateDate(String s, java.sql.Date date) throws SQLException { + + } + + @Override + public void updateTime(String s, Time time) throws SQLException { + + } + + @Override + public void updateTimestamp(String s, Timestamp timestamp) throws SQLException { + + } + + @Override + public void updateAsciiStream(String s, InputStream inputStream, int i) throws SQLException { + + } + + @Override + public void updateBinaryStream(String s, InputStream inputStream, int i) throws SQLException { + + } + + @Override + public void updateCharacterStream(String s, Reader reader, int i) throws SQLException { + + } + + @Override + public void updateObject(String s, Object o, int i) throws SQLException { + + } + + @Override + public void updateObject(String s, Object o) throws SQLException { + + } + + @Override + public void insertRow() throws SQLException { + + } + + @Override + public void updateRow() throws SQLException { + + } + + @Override + public void deleteRow() throws SQLException { + + } + + @Override + public void refreshRow() throws SQLException { + + } + + @Override + public void cancelRowUpdates() throws SQLException { + + } + + @Override + public void moveToInsertRow() throws SQLException { + + } + + @Override + public void moveToCurrentRow() throws SQLException { + + } + + @Override + public Statement getStatement() throws SQLException { + return null; + } + + @Override + public Object getObject(int i, Map> map) throws SQLException { + return null; + } + + @Override + public Ref getRef(int i) throws SQLException { + return null; + } + + @Override + public Blob getBlob(int i) throws SQLException { + return null; + } + + @Override + public Clob getClob(int i) throws SQLException { + return null; + } + + @Override + public Array getArray(int i) throws SQLException { + return null; + } + + @Override + public Object getObject(String s, Map> map) throws SQLException { + return null; + } + + @Override + public Ref getRef(String s) throws SQLException { + return null; + } + + @Override + public Blob getBlob(String s) throws SQLException { + return null; + } + + @Override + public Clob getClob(String s) throws SQLException { + return null; + } + + @Override + public Array getArray(String s) throws SQLException { + return null; + } + + @Override + public java.sql.Date getDate(int i, Calendar calendar) throws SQLException { + return null; + } + + @Override + public java.sql.Date getDate(String s, Calendar calendar) throws SQLException { + return null; + } + + @Override + public Time getTime(int i, Calendar calendar) throws SQLException { + return null; + } + + @Override + public Time getTime(String s, Calendar calendar) throws SQLException { + return null; + } + + @Override + public Timestamp getTimestamp(int i, Calendar calendar) throws SQLException { + return null; + } + + @Override + public Timestamp getTimestamp(String s, Calendar calendar) throws SQLException { + return null; + } + + @Override + public URL getURL(int i) throws SQLException { + return null; + } + + @Override + public URL getURL(String s) throws SQLException { + return null; + } + + @Override + public void updateRef(int i, Ref ref) throws SQLException { + + } + + @Override + public void updateRef(String s, Ref ref) throws SQLException { + + } + + @Override + public void updateBlob(int i, Blob blob) throws SQLException { + + } + + @Override + public void updateBlob(String s, Blob blob) throws SQLException { + + } + + @Override + public void updateClob(int i, Clob clob) throws SQLException { + + } + + @Override + public void updateClob(String s, Clob clob) throws SQLException { + + } + + @Override + public void updateArray(int i, Array array) throws SQLException { + + } + + @Override + public void updateArray(String s, Array array) throws SQLException { + + } + + @Override + public RowId getRowId(int i) throws SQLException { + return null; + } + + @Override + public RowId getRowId(String s) throws SQLException { + return null; + } + + @Override + public void updateRowId(int i, RowId rowId) throws SQLException { + + } + + @Override + public void updateRowId(String s, RowId rowId) throws SQLException { + + } + + @Override + public int getHoldability() throws SQLException { + return 0; + } + + @Override + public boolean isClosed() throws SQLException { + return false; + } + + @Override + public void updateNString(int i, String s) throws SQLException { + + } + + @Override + public void updateNString(String s, String s1) throws SQLException { + + } + + @Override + public void updateNClob(int i, NClob nClob) throws SQLException { + + } + + @Override + public void updateNClob(String s, NClob nClob) throws SQLException { + + } + + @Override + public NClob getNClob(int i) throws SQLException { + return null; + } + + @Override + public NClob getNClob(String s) throws SQLException { + return null; + } + + @Override + public SQLXML getSQLXML(int i) throws SQLException { + return null; + } + + @Override + public SQLXML getSQLXML(String s) throws SQLException { + return null; + } + + @Override + public void updateSQLXML(int i, SQLXML sqlxml) throws SQLException { + + } + + @Override + public void updateSQLXML(String s, SQLXML sqlxml) throws SQLException { + + } + + @Override + public String getNString(int i) throws SQLException { + return null; + } + + @Override + public String getNString(String s) throws SQLException { + return null; + } + + @Override + public Reader getNCharacterStream(int i) throws SQLException { + return null; + } + + @Override + public Reader getNCharacterStream(String s) throws SQLException { + return null; + } + + @Override + public void updateNCharacterStream(int i, Reader reader, long l) throws SQLException { + + } + + @Override + public void updateNCharacterStream(String s, Reader reader, long l) throws SQLException { + + } + + @Override + public void updateAsciiStream(int i, InputStream inputStream, long l) throws SQLException { + + } + + @Override + public void updateBinaryStream(int i, InputStream inputStream, long l) throws SQLException { + + } + + @Override + public void updateCharacterStream(int i, Reader reader, long l) throws SQLException { + + } + + @Override + public void updateAsciiStream(String s, InputStream inputStream, long l) throws SQLException { + + } + + @Override + public void updateBinaryStream(String s, InputStream inputStream, long l) throws SQLException { + + } + + @Override + public void updateCharacterStream(String s, Reader reader, long l) throws SQLException { + + } + + @Override + public void updateBlob(int i, InputStream inputStream, long l) throws SQLException { + + } + + @Override + public void updateBlob(String s, InputStream inputStream, long l) throws SQLException { + + } + + @Override + public void updateClob(int i, Reader reader, long l) throws SQLException { + + } + + @Override + public void updateClob(String s, Reader reader, long l) throws SQLException { + + } + + @Override + public void updateNClob(int i, Reader reader, long l) throws SQLException { + + } + + @Override + public void updateNClob(String s, Reader reader, long l) throws SQLException { + + } + + @Override + public void updateNCharacterStream(int i, Reader reader) throws SQLException { + + } + + @Override + public void updateNCharacterStream(String s, Reader reader) throws SQLException { + + } + + @Override + public void updateAsciiStream(int i, InputStream inputStream) throws SQLException { + + } + + @Override + public void updateBinaryStream(int i, InputStream inputStream) throws SQLException { + + } + + @Override + public void updateCharacterStream(int i, Reader reader) throws SQLException { + + } + + @Override + public void updateAsciiStream(String s, InputStream inputStream) throws SQLException { + + } + + @Override + public void updateBinaryStream(String s, InputStream inputStream) throws SQLException { + + } + + @Override + public void updateCharacterStream(String s, Reader reader) throws SQLException { + + } + + @Override + public void updateBlob(int i, InputStream inputStream) throws SQLException { + + } + + @Override + public void updateBlob(String s, InputStream inputStream) throws SQLException { + + } + + @Override + public void updateClob(int i, Reader reader) throws SQLException { + + } + + @Override + public void updateClob(String s, Reader reader) throws SQLException { + + } + + @Override + public void updateNClob(int i, Reader reader) throws SQLException { + + } + + @Override + public void updateNClob(String s, Reader reader) throws SQLException { + + } + + @Override + public T getObject(int i, Class aClass) throws SQLException { + return null; + } + + @Override + public T getObject(String s, Class aClass) throws SQLException { + return null; + } + + @Override + public T unwrap(Class aClass) throws SQLException { + return null; + } + + @Override + public boolean isWrapperFor(Class aClass) throws SQLException { + return false; + } + }; + } + + public String writeEmpty(Date startDatum) { + return new String("Not implemented Writer.writeEmpty"); + } +} diff --git a/src/test/java/net/petafuel/fuelifints/cryptography/CryptographyFactoryTest.java b/src/test/java/net/petafuel/fuelifints/cryptography/CryptographyFactoryTest.java index 17de1ff..7773ce7 100644 --- a/src/test/java/net/petafuel/fuelifints/cryptography/CryptographyFactoryTest.java +++ b/src/test/java/net/petafuel/fuelifints/cryptography/CryptographyFactoryTest.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.junit.Test; import static junit.framework.Assert.assertNotNull; diff --git a/src/test/java/net/petafuel/fuelifints/cryptography/KeyManagerTest.java b/src/test/java/net/petafuel/fuelifints/cryptography/KeyManagerTest.java index 78d9565..0fab988 100644 --- a/src/test/java/net/petafuel/fuelifints/cryptography/KeyManagerTest.java +++ b/src/test/java/net/petafuel/fuelifints/cryptography/KeyManagerTest.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.junit.Test; import java.security.KeyPair; diff --git a/src/test/java/net/petafuel/fuelifints/cryptography/RDH10DecryptorTest.java b/src/test/java/net/petafuel/fuelifints/cryptography/RDH10DecryptorTest.java index feeed7a..5f72c23 100644 --- a/src/test/java/net/petafuel/fuelifints/cryptography/RDH10DecryptorTest.java +++ b/src/test/java/net/petafuel/fuelifints/cryptography/RDH10DecryptorTest.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.jce.provider.BouncyCastleProvider; diff --git a/src/test/java/net/petafuel/fuelifints/cryptography/RDH10SignatureHelperTest.java b/src/test/java/net/petafuel/fuelifints/cryptography/RDH10SignatureHelperTest.java index dbfe970..cb91213 100644 --- a/src/test/java/net/petafuel/fuelifints/cryptography/RDH10SignatureHelperTest.java +++ b/src/test/java/net/petafuel/fuelifints/cryptography/RDH10SignatureHelperTest.java @@ -2,7 +2,7 @@ package net.petafuel.fuelifints.cryptography; import net.petafuel.fuelifints.dataaccess.DummyAccessFacade; import net.petafuel.fuelifints.model.Dialog; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import net.petafuel.fuelifints.protocol.fints3.segments.HNSHA; import net.petafuel.fuelifints.protocol.fints3.segments.HNSHK; import org.bouncycastle.crypto.digests.SHA256Digest; diff --git a/src/test/java/net/petafuel/fuelifints/cryptography/RDH9CryptographyTest.java b/src/test/java/net/petafuel/fuelifints/cryptography/RDH9CryptographyTest.java index 7a2f3e9..ae5002a 100644 --- a/src/test/java/net/petafuel/fuelifints/cryptography/RDH9CryptographyTest.java +++ b/src/test/java/net/petafuel/fuelifints/cryptography/RDH9CryptographyTest.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.bouncycastle.jce.provider.BouncyCastleProvider; diff --git a/src/test/java/net/petafuel/fuelifints/cryptography/SignatureHelperFactoryTest.java b/src/test/java/net/petafuel/fuelifints/cryptography/SignatureHelperFactoryTest.java index 010af13..2088735 100644 --- a/src/test/java/net/petafuel/fuelifints/cryptography/SignatureHelperFactoryTest.java +++ b/src/test/java/net/petafuel/fuelifints/cryptography/SignatureHelperFactoryTest.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.cryptography; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.junit.Test; import static junit.framework.Assert.assertNotNull; diff --git a/src/test/java/net/petafuel/fuelifints/dataaccess/DummyAccessFacade.java b/src/test/java/net/petafuel/fuelifints/dataaccess/DummyAccessFacade.java new file mode 100644 index 0000000..3767a01 --- /dev/null +++ b/src/test/java/net/petafuel/fuelifints/dataaccess/DummyAccessFacade.java @@ -0,0 +1,59 @@ +package net.petafuel.fuelifints.dataaccess; + +import net.petafuel.fuelifints.FinTSVersionSwitch; +import net.petafuel.fuelifints.dataaccess.dataobjects.CommonBankParameterDataObject; +import net.petafuel.fuelifints.dataaccess.dataobjects.ParameterDataObject; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; +import org.apache.commons.lang3.NotImplementedException; + +import java.util.ArrayList; + +public class DummyAccessFacade { + public DummyAccessFacade(Object o) { + throw new NotImplementedException("not implemented"); + } + + public ArrayList getParameterData(FinTSVersionSwitch.FinTSVersion fintsVersion30) { + throw new NotImplementedException("not implemented"); + } + + public void clearUserKeys() { + throw new NotImplementedException("not implemented"); + } + + public void clearDB() { + throw new NotImplementedException("not implemented"); + } + + public void close() { + throw new NotImplementedException("not implemented"); + } + + public boolean hasKeyPair(SecurityMethod rdh10, String v) { + throw new NotImplementedException("not implemented"); + } + + public void updateKeyPair(SecurityMethod rdh10, String privatekey, String publickey, String v, Object o, Object o1) { + throw new NotImplementedException("not implemented"); + } + + public String getPrivateKey(SecurityMethod rdh10, String v) { + throw new NotImplementedException("not implemented"); + } + + public String getPublicKey(SecurityMethod rdh10, String v) { + throw new NotImplementedException("not implemented"); + } + + public void addUserPublicKey(String aUserId, Object o, SecurityMethod rdh10, String uPubKey, String v, int i, int i1, Object o1, Object o2) { + throw new NotImplementedException("not implemented"); + } + + public String getUserPublicKey(String aUserId, Object o, SecurityMethod rdh10, String v, int i, int i1) { + throw new NotImplementedException("not implemented"); + } + + public CommonBankParameterDataObject getCommonBankParameters(FinTSVersionSwitch.FinTSVersion fintsVersion30) { + throw new NotImplementedException("not implemented"); + } +} diff --git a/src/test/java/net/petafuel/fuelifints/dataaccess/DummyAccessFacadeTest.java b/src/test/java/net/petafuel/fuelifints/dataaccess/DummyAccessFacadeTest.java index 3e8f6e7..f7f5c66 100644 --- a/src/test/java/net/petafuel/fuelifints/dataaccess/DummyAccessFacadeTest.java +++ b/src/test/java/net/petafuel/fuelifints/dataaccess/DummyAccessFacadeTest.java @@ -1,6 +1,6 @@ package net.petafuel.fuelifints.dataaccess; -import net.petafuel.fuelifints.protocol.fints3.model.SecurityMethod; +import net.petafuel.fuelifints.protocol.fints3.segments.model.SecurityMethod; import org.junit.After; import org.junit.AfterClass; import org.junit.Before;