diff src/main/kotlin/name/blackcap/passman/Database.kt @ 6:711cc42e96d7

Got the list subcommand working, but needs efficiency improvements.
author David Barts <n5jrn@me.com>
date Tue, 20 Sep 2022 20:52:21 -0700
parents ad997df1f560
children f245b9a53495
line wrap: on
line diff
--- a/src/main/kotlin/name/blackcap/passman/Database.kt	Sun Sep 11 21:29:20 2022 -0700
+++ b/src/main/kotlin/name/blackcap/passman/Database.kt	Tue Sep 20 20:52:21 2022 -0700
@@ -120,6 +120,12 @@
 public fun ResultSet.getDecrypted(columnIndex: Int, encryption: Encryption) =
     encryption.decrypt(getBytes(columnIndex))
 
+public fun ResultSet.getDecryptedString(columnLabel: String, encryption: Encryption) =
+    encryption.decryptToString(getBytes(columnLabel))
+
+public fun ResultSet.getDecrypted(columnLabel: String, encryption: Encryption) =
+    encryption.decrypt(getBytes(columnLabel))
+
 public fun PreparedStatement.setEncryptedString(columnIndex: Int, value: String, encryption: Encryption) =
     setBytes(columnIndex, encryption.encryptFromString(value))