comparison src/main/kotlin/name/blackcap/passman/Database.kt @ 7:f245b9a53495

Efficiency improvements.
author David Barts <n5jrn@me.com>
date Tue, 20 Sep 2022 21:54:32 -0700
parents 711cc42e96d7
children 698c4a3d758d
comparison
equal deleted inserted replaced
6:711cc42e96d7 7:f245b9a53495
118 encryption.decryptToString(getBytes(columnIndex)) 118 encryption.decryptToString(getBytes(columnIndex))
119 119
120 public fun ResultSet.getDecrypted(columnIndex: Int, encryption: Encryption) = 120 public fun ResultSet.getDecrypted(columnIndex: Int, encryption: Encryption) =
121 encryption.decrypt(getBytes(columnIndex)) 121 encryption.decrypt(getBytes(columnIndex))
122 122
123 public fun ResultSet.getDecryptedString(columnLabel: String, encryption: Encryption) =
124 encryption.decryptToString(getBytes(columnLabel))
125
126 public fun ResultSet.getDecrypted(columnLabel: String, encryption: Encryption) =
127 encryption.decrypt(getBytes(columnLabel))
128
129 public fun PreparedStatement.setEncryptedString(columnIndex: Int, value: String, encryption: Encryption) = 123 public fun PreparedStatement.setEncryptedString(columnIndex: Int, value: String, encryption: Encryption) =
130 setBytes(columnIndex, encryption.encryptFromString(value)) 124 setBytes(columnIndex, encryption.encryptFromString(value))
131 125
132 public fun PreparedStatement.setEncrypted(columnIndex: Int, value: CharArray, encryption: Encryption) = 126 public fun PreparedStatement.setEncrypted(columnIndex: Int, value: CharArray, encryption: Encryption) =
133 setBytes(columnIndex, encryption.encrypt(value)) 127 setBytes(columnIndex, encryption.encrypt(value))