diff options
author | Tad Fisher <tadfisher@gmail.com> | 2022-10-09 15:10:10 -0700 |
---|---|---|
committer | Tad Fisher <tadfisher@gmail.com> | 2022-10-09 16:13:36 -0700 |
commit | 4b7457c7f712b92f21604d8612ec8ff19df75c81 (patch) | |
tree | bf1256e72d1ead8079daa514c5f9c0a96469ab73 /crypto-pgpainless | |
parent | a244a0f3b84d64cceaf0eefd662c78aadab2514e (diff) |
Add crypto-hwsecurity library
Diffstat (limited to 'crypto-pgpainless')
-rw-r--r-- | crypto-pgpainless/build.gradle.kts | 2 | ||||
-rw-r--r-- | crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPSessionKey.kt | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/crypto-pgpainless/build.gradle.kts b/crypto-pgpainless/build.gradle.kts index 93d56eff..bff2bcf2 100644 --- a/crypto-pgpainless/build.gradle.kts +++ b/crypto-pgpainless/build.gradle.kts @@ -15,7 +15,7 @@ dependencies { implementation(libs.dagger.hilt.core) implementation(libs.kotlin.coroutines.core) implementation(libs.thirdparty.kotlinResult) - implementation(libs.thirdparty.pgpainless) + api(libs.thirdparty.pgpainless) testImplementation(libs.bundles.testDependencies) testImplementation(libs.kotlin.coroutines.test) testImplementation(libs.testing.testparameterinjector) diff --git a/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPSessionKey.kt b/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPSessionKey.kt new file mode 100644 index 00000000..42055cb4 --- /dev/null +++ b/crypto-pgpainless/src/main/kotlin/app/passwordstore/crypto/PGPSessionKey.kt @@ -0,0 +1,16 @@ +package app.passwordstore.crypto + +import org.bouncycastle.openpgp.PGPPublicKey +import org.bouncycastle.openpgp.PGPSessionKey +import org.pgpainless.algorithm.PublicKeyAlgorithm + +public class PGPEncryptedSessionKey( + public val publicKey: PGPPublicKey, + public val algorithm: PublicKeyAlgorithm, + public val contents: ByteArray +) + +public fun PGPSessionKey( + algorithm: PublicKeyAlgorithm, + sessionKey: ByteArray +): PGPSessionKey = PGPSessionKey(algorithm.algorithmId, sessionKey) |