summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-01-30 14:40:17 +0100
committerFlorian Dold <florian.dold@gmail.com>2020-01-30 14:40:17 +0100
commit3c7ff7037a26de936f19754e8427e9d9fb95e6f3 (patch)
treebd6b90a922b97d47559b7b4c3a00c2632e2ec4ab /util
parent687f0719da1fbbecf7454b66231db02483447fc8 (diff)
downloadlibeufin-3c7ff7037a26de936f19754e8427e9d9fb95e6f3.tar.gz
libeufin-3c7ff7037a26de936f19754e8427e9d9fb95e6f3.tar.bz2
libeufin-3c7ff7037a26de936f19754e8427e9d9fb95e6f3.zip
implement public key dumping for nexus ebics subscribers
Diffstat (limited to 'util')
-rw-r--r--util/src/main/kotlin/CryptoUtil.kt2
1 files changed, 2 insertions, 0 deletions
diff --git a/util/src/main/kotlin/CryptoUtil.kt b/util/src/main/kotlin/CryptoUtil.kt
index 9867f022..bb3e427f 100644
--- a/util/src/main/kotlin/CryptoUtil.kt
+++ b/util/src/main/kotlin/CryptoUtil.kt
@@ -115,6 +115,7 @@ object CryptoUtil {
val tmp = RSAPublicKeySpec(modulusBigInt, exponentBigInt)
return keyFactory.generatePublic(tmp) as RSAPublicKey
}
+
/**
* Hash an RSA public key according to the EBICS standard (EBICS 2.5: 4.4.1.2.3).
*/
@@ -126,6 +127,7 @@ object CryptoUtil {
val digest = MessageDigest.getInstance("SHA-256")
return digest.digest(keyBytes.toByteArray())
}
+
fun encryptEbicsE002(data: ByteArray, encryptionPublicKey: RSAPublicKey): EncryptionResult {
val keygen = KeyGenerator.getInstance("AES", bouncyCastleProvider)
keygen.init(128)