gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-wallet-kotlin] branch master updated (4a712e1 -> f019070)


From: gnunet
Subject: [taler-wallet-kotlin] branch master updated (4a712e1 -> f019070)
Date: Fri, 03 Jul 2020 16:44:11 +0200

This is an automated email from the git hooks/post-receive script.

torsten-grote pushed a change to branch master
in repository wallet-kotlin.

    from 4a712e1  Add refresh crypto with tests
     new 42190dd  Add Taler withdraw URI parsing with test
     new f019070  Add copyright headers to all files and add IDE copyright setup

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .idea/copyright/Taler.xml                          |  7 +++
 .idea/copyright/profiles_settings.xml              |  7 +++
 build.gradle                                       | 16 ++++++
 .../taler/wallet/kotlin/crypto/CryptoFactory.kt    | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/RsaBlinding.kt  | 16 ++++++
 .../taler/wallet/kotlin/crypto/RsaBlindingTest.kt  | 16 ++++++
 .../net/taler/wallet/kotlin/Base32Crockford.kt     | 16 ++++++
 .../kotlin/net/taler/wallet/kotlin/TalerUri.kt     | 41 ++++++++++++++++
 .../kotlin/net/taler/wallet/kotlin/Timestamp.kt    | 16 ++++++
 .../kotlin/net/taler/wallet/kotlin/Types.kt        | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/Crypto.kt       | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/CryptoImpl.kt   | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/Deposit.kt      | 16 ++++++
 .../kotlin/net/taler/wallet/kotlin/crypto/Kdf.kt   | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/Planchet.kt     | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/Recoup.kt       | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/Refresh.kt      | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/Signature.kt    | 16 ++++++
 .../net/taler/wallet/kotlin/Base32CrockfordTest.kt | 16 ++++++
 .../kotlin/net/taler/wallet/kotlin/TalerUriTest.kt | 57 ++++++++++++++++++++++
 .../net/taler/wallet/kotlin/crypto/DepositTest.kt  | 16 ++++++
 .../wallet/kotlin/crypto/EllipticCurveTest.kt      | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/KdfTest.kt      | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/RecoupTest.kt   | 16 ++++++
 .../wallet/kotlin/crypto/RefreshPlanchetTest.kt    | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/Sha256Test.kt   | 16 ++++++
 .../net/taler/wallet/kotlin/crypto/Sha512Test.kt   | 16 ++++++
 .../taler/wallet/kotlin/crypto/CryptoFactory.kt    | 16 ++++++
 .../taler/wallet/kotlin/crypto/CryptoFactory.kt    | 16 ++++++
 29 files changed, 512 insertions(+)
 create mode 100644 .idea/copyright/Taler.xml
 create mode 100644 .idea/copyright/profiles_settings.xml
 create mode 100644 src/commonMain/kotlin/net/taler/wallet/kotlin/TalerUri.kt
 create mode 100644 
src/commonTest/kotlin/net/taler/wallet/kotlin/TalerUriTest.kt

diff --git a/.idea/copyright/Taler.xml b/.idea/copyright/Taler.xml
new file mode 100644
index 0000000..96abfa5
--- /dev/null
+++ b/.idea/copyright/Taler.xml
@@ -0,0 +1,7 @@
+<component name="CopyrightManager">
+  <copyright>
+    <option name="keyword" value="(Copyright|Public License)" />
+    <option name="notice" value="This file is part of GNU Taler&#10;(C) 
&amp;#36;today.year Taler Systems S.A.&#10;&#10;GNU Taler is free software; you 
can redistribute it and/or modify it under the&#10;terms of the GNU General 
Public License as published by the Free Software&#10;Foundation; either version 
3, or (at your option) any later version.&#10;&#10;GNU Taler is distributed in 
the hope that it will be useful, but WITHOUT ANY&#10;WARRANTY; without even the 
implied warranty of MERCH [...]
+    <option name="myName" value="Taler" />
+  </copyright>
+</component>
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml 
b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..be40708
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,7 @@
+<component name="CopyrightManager">
+  <settings default="Taler">
+    <module2copyright>
+      <element module="All" copyright="Taler" />
+    </module2copyright>
+  </settings>
+</component>
\ No newline at end of file
diff --git a/build.gradle b/build.gradle
index 2dce365..0caa564 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 plugins {
     id 'org.jetbrains.kotlin.multiplatform' version '1.3.72'
 }
diff --git 
a/src/androidMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt 
b/src/androidMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt
index b54d93e..502b8a0 100644
--- a/src/androidMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt
+++ b/src/androidMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import com.goterl.lazycode.lazysodium.LazySodiumJava
diff --git 
a/src/androidMain/kotlin/net/taler/wallet/kotlin/crypto/RsaBlinding.kt 
b/src/androidMain/kotlin/net/taler/wallet/kotlin/crypto/RsaBlinding.kt
index 715bf83..458a089 100644
--- a/src/androidMain/kotlin/net/taler/wallet/kotlin/crypto/RsaBlinding.kt
+++ b/src/androidMain/kotlin/net/taler/wallet/kotlin/crypto/RsaBlinding.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import java.math.BigInteger
diff --git 
a/src/androidTest/kotlin/net/taler/wallet/kotlin/crypto/RsaBlindingTest.kt 
b/src/androidTest/kotlin/net/taler/wallet/kotlin/crypto/RsaBlindingTest.kt
index 7f5cb4e..0ced114 100644
--- a/src/androidTest/kotlin/net/taler/wallet/kotlin/crypto/RsaBlindingTest.kt
+++ b/src/androidTest/kotlin/net/taler/wallet/kotlin/crypto/RsaBlindingTest.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Base32Crockford
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/Base32Crockford.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/Base32Crockford.kt
index 3bcf15a..9043731 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/Base32Crockford.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/Base32Crockford.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin
 
 
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/TalerUri.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/TalerUri.kt
new file mode 100644
index 0000000..f64f738
--- /dev/null
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/TalerUri.kt
@@ -0,0 +1,41 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
+package net.taler.wallet.kotlin
+
+internal object TalerUri {
+
+    private const val SCHEME = "taler://"
+    private const val AUTHORITY_PAY = "pay"
+    private const val AUTHORITY_WITHDRAW = "withdraw"
+    private const val AUTHORITY_REFUND = "refund"
+    private const val AUTHORITY_TIP = "tip"
+
+    /**
+     * Parses a withdraw URI and returns a bank status URL or null if the URI 
was invalid.
+     */
+    fun parseWithdrawUri(uri: String): String? {
+        val prefix = "${SCHEME}${AUTHORITY_WITHDRAW}"
+        if (!uri.startsWith(prefix, ignoreCase = true)) return null
+        val parts = uri.substring(prefix.length + 1).split('/')
+        if (parts.size != 3) return null
+        val (host, query, withdrawId) = parts
+        // TODO clarify what query is and if it can include '/' (docs seem out 
of date)
+        val urlQuery = if (query == "-") "api/withdraw-operation" else query
+        return "https://${host.toLowerCase()}/$urlQuery/$withdrawId"
+    }
+
+}
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/Timestamp.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/Timestamp.kt
index c0efbac..d0260cf 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/Timestamp.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/Timestamp.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin
 
 import com.soywiz.klock.DateTime
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/Types.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/Types.kt
index 2aa44da..4702a19 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/Types.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/Types.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin
 
 data class WireFee(
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Crypto.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Crypto.kt
index 7c5fa29..226aa64 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Crypto.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Crypto.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 internal interface Crypto {
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoImpl.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoImpl.kt
index e6995b1..0780e45 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoImpl.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoImpl.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.crypto.CryptoImpl.Companion.toByteArray
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Deposit.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Deposit.kt
index 6b4fa94..3156d3f 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Deposit.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Deposit.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Amount
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Kdf.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Kdf.kt
index d6a7658..44f55cc 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Kdf.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Kdf.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import kotlin.experimental.xor
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Planchet.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Planchet.kt
index 8f4fb98..b29007e 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Planchet.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Planchet.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Amount
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Recoup.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Recoup.kt
index 79612a8..0f2b6df 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Recoup.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Recoup.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Base32Crockford
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Refresh.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Refresh.kt
index 4ffb3b9..4d6377a 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Refresh.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Refresh.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Amount
diff --git a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Signature.kt 
b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Signature.kt
index c86942e..5e4a65e 100644
--- a/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Signature.kt
+++ b/src/commonMain/kotlin/net/taler/wallet/kotlin/crypto/Signature.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Base32Crockford
diff --git 
a/src/commonTest/kotlin/net/taler/wallet/kotlin/Base32CrockfordTest.kt 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/Base32CrockfordTest.kt
index 4a52a47..565a395 100644
--- a/src/commonTest/kotlin/net/taler/wallet/kotlin/Base32CrockfordTest.kt
+++ b/src/commonTest/kotlin/net/taler/wallet/kotlin/Base32CrockfordTest.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin
 
 import kotlin.test.Ignore
diff --git a/src/commonTest/kotlin/net/taler/wallet/kotlin/TalerUriTest.kt 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/TalerUriTest.kt
new file mode 100644
index 0000000..c35d155
--- /dev/null
+++ b/src/commonTest/kotlin/net/taler/wallet/kotlin/TalerUriTest.kt
@@ -0,0 +1,57 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
+package net.taler.wallet.kotlin
+
+import net.taler.wallet.kotlin.TalerUri.parseWithdrawUri
+import kotlin.test.Test
+import kotlin.test.assertEquals
+import kotlin.test.assertNull
+
+class TalerUriTest {
+
+    @Test
+    fun testParseWithdrawUri() {
+        // correct parsing
+        var uri = "taler://withdraw/bank.example.com/-/12345"
+        assertEquals("https://bank.example.com/api/withdraw-operation/12345";, 
parseWithdrawUri(uri))
+
+        // correct parsing with custom query
+        uri = "taler://withdraw/bank.example.com/foo/12345"
+        assertEquals("https://bank.example.com/foo/12345";, 
parseWithdrawUri(uri))
+
+        // rejects incorrect scheme
+        uri = "talerx://withdraw/bank.example.com/-/12345"
+        assertNull(parseWithdrawUri(uri))
+
+        // rejects incorrect authority
+        uri = "taler://withdrawx/bank.example.com/-/12345"
+        assertNull(parseWithdrawUri(uri))
+
+        // rejects incorrect authority
+        uri = "taler://withdrawx/bank.example.com/-/12345"
+        assertNull(parseWithdrawUri(uri))
+
+        // rejects too few parts
+        uri = "taler://withdraw/bank.example.com/foo"
+        assertNull(parseWithdrawUri(uri))
+
+        // rejects too many parts
+        uri = "taler://withdraw/bank.example.com/-/12345/foo"
+        assertNull(parseWithdrawUri(uri))
+    }
+
+}
diff --git 
a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/DepositTest.kt 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/DepositTest.kt
index 6e74fb2..399b754 100644
--- a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/DepositTest.kt
+++ b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/DepositTest.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Amount
diff --git 
a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/EllipticCurveTest.kt 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/EllipticCurveTest.kt
index e8fd301..4e83b47 100644
--- a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/EllipticCurveTest.kt
+++ b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/EllipticCurveTest.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Base32Crockford
diff --git a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/KdfTest.kt 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/KdfTest.kt
index 702d6e3..974f9aa 100644
--- a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/KdfTest.kt
+++ b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/KdfTest.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Base32Crockford
diff --git a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/RecoupTest.kt 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/RecoupTest.kt
index 865eaa9..ea74e3c 100644
--- a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/RecoupTest.kt
+++ b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/RecoupTest.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Amount
diff --git 
a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/RefreshPlanchetTest.kt 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/RefreshPlanchetTest.kt
index 69d3169..51eb5c6 100644
--- 
a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/RefreshPlanchetTest.kt
+++ 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/RefreshPlanchetTest.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Base32Crockford
diff --git a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/Sha256Test.kt 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/Sha256Test.kt
index 87b6f75..3209e05 100644
--- a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/Sha256Test.kt
+++ b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/Sha256Test.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Base32Crockford
diff --git a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/Sha512Test.kt 
b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/Sha512Test.kt
index 309e053..24be282 100644
--- a/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/Sha512Test.kt
+++ b/src/commonTest/kotlin/net/taler/wallet/kotlin/crypto/Sha512Test.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import net.taler.wallet.kotlin.Base32Crockford
diff --git a/src/jsMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt 
b/src/jsMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt
index dab9ecc..e428f6a 100644
--- a/src/jsMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt
+++ b/src/jsMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import org.khronos.webgl.Uint8Array
diff --git 
a/src/linuxMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt 
b/src/linuxMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt
index b0bb5b2..7860607 100644
--- a/src/linuxMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt
+++ b/src/linuxMain/kotlin/net/taler/wallet/kotlin/crypto/CryptoFactory.kt
@@ -1,3 +1,19 @@
+/*
+ * This file is part of GNU Taler
+ * (C) 2020 Taler Systems S.A.
+ *
+ * GNU Taler is free software; you can redistribute it and/or modify it under 
the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 3, or (at your option) any later version.
+ *
+ * GNU Taler is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
FOR
+ * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * GNU Taler; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
+ */
+
 package net.taler.wallet.kotlin.crypto
 
 import kotlinx.cinterop.CValuesRef

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]