From 3dc8e64127ecd32360dee9e752e039b1861c66b5 Mon Sep 17 00:00:00 2001 From: dankito Date: Sun, 5 Jul 2020 11:42:16 +0200 Subject: [PATCH] Moved EncryptionDataSegmentHeaderRegex from ResponseParser to MessageUtils --- .../net/dankito/banking/fints/response/ResponseParser.kt | 2 -- .../kotlin/net/dankito/banking/fints/util/MessageUtils.kt | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt index 984533a9..1cf9dcc3 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/response/ResponseParser.kt @@ -28,8 +28,6 @@ open class ResponseParser( ) { companion object { - val EncryptionDataSegmentHeaderRegex = Regex("${MessageSegmentId.EncryptionData.id}:\\d{1,3}:\\d{1,3}\\+") - val JobParametersSegmentRegex = Regex("HI[A-Z]{3}S") const val FeedbackParametersSeparator = "; " diff --git a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/util/MessageUtils.kt b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/util/MessageUtils.kt index 14cece93..285ccb3f 100644 --- a/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/util/MessageUtils.kt +++ b/fints4k/src/commonMain/kotlin/net/dankito/banking/fints/util/MessageUtils.kt @@ -8,6 +8,8 @@ open class MessageUtils { companion object { val BinaryDataHeaderPattern = Regex("@\\d+@") + + val EncryptionDataSegmentHeaderRegex = Regex("${MessageSegmentId.EncryptionData.id}:\\d{1,3}:\\d{1,3}\\+") } @@ -40,7 +42,7 @@ open class MessageUtils { if (binaryDataHeaderStartIndex > 15) { - ResponseParser.EncryptionDataSegmentHeaderRegex.find(dataString, binaryDataHeaderStartIndex - 15)?.let { matchResult -> + EncryptionDataSegmentHeaderRegex.find(dataString, binaryDataHeaderStartIndex - 15)?.let { matchResult -> return matchResult.range.start < binaryDataHeaderStartIndex } }