aboutsummaryrefslogtreecommitdiffstats
path: root/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt')
-rw-r--r--crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt35
1 files changed, 0 insertions, 35 deletions
diff --git a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt b/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt
deleted file mode 100644
index a0f84402..00000000
--- a/crypto-pgpainless/src/test/kotlin/app/passwordstore/crypto/KeyUtilsTest.kt
+++ /dev/null
@@ -1,35 +0,0 @@
-package app.passwordstore.crypto
-
-import app.passwordstore.crypto.KeyUtils.isKeyUsable
-import app.passwordstore.crypto.KeyUtils.tryGetId
-import app.passwordstore.crypto.KeyUtils.tryParseKeyring
-import app.passwordstore.crypto.TestUtils.AllKeys
-import app.passwordstore.crypto.TestUtils.getArmoredSecretKeyWithMultipleIdentities
-import kotlin.test.Test
-import kotlin.test.assertEquals
-import kotlin.test.assertIs
-import kotlin.test.assertNotNull
-import org.bouncycastle.openpgp.PGPSecretKeyRing
-
-class KeyUtilsTest {
- @Test
- fun parseKeyWithMultipleIdentities() {
- val key = PGPKey(getArmoredSecretKeyWithMultipleIdentities())
- val keyring = tryParseKeyring(key)
- assertNotNull(keyring)
- assertIs<PGPSecretKeyRing>(keyring)
- val keyId = tryGetId(key)
- assertNotNull(keyId)
- assertIs<PGPIdentifier.KeyId>(keyId)
- assertEquals("b950ae2813841585", keyId.toString())
- }
-
- @Test
- fun isKeyUsable() {
- val params = AllKeys.entries.map { it to (it != AllKeys.AEAD_PUB && it != AllKeys.AEAD_SEC) }
- params.forEach { (allKeys, isUsable) ->
- val key = PGPKey(allKeys.keyMaterial)
- assertEquals(isUsable, isKeyUsable(key), "${allKeys.name} failed expectation:")
- }
- }
-}