Skip to content

Commit 9345c8b

Browse files
authored
Merge pull request #11 from contentpass/CHORE-fix-key-store-unique-id
Fix crash in KeyStore due to non-unique key pair alias
2 parents 1955bdd + 71b187a commit 9345c8b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
Our SDK is available on Maven Central.
1515

1616
```groovy
17-
implementation 'de.contentpass:contentpass-android:2.2.1'
17+
implementation 'de.contentpass:contentpass-android:2.2.2'
1818
```
1919

2020
Add this to your app's `build.gradle` file's `dependencies` element.

lib/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ kapt {
5858
extra.apply{
5959
set("PUBLISH_GROUP_ID", "de.contentpass")
6060
set("PUBLISH_ARTIFACT_ID", "contentpass-android")
61-
set("PUBLISH_VERSION", "2.2.1")
61+
set("PUBLISH_VERSION", "2.2.2")
6262
}
6363

6464
apply("${rootProject.projectDir}/scripts/publish-module.gradle")

lib/src/main/java/de/contentpass/lib/ContentPass.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class ContentPass internal constructor(
112112
fun build(): ContentPass {
113113
configuration = grabConfiguration()
114114
val authorizer = Authorizer(configuration!!, context!!)
115-
val store = TokenStore(context!!, KeyStore(context!!))
115+
val store = TokenStore(context!!, KeyStore(context!!, configuration!!.propertyId))
116116
return ContentPass(authorizer, store, configuration!!)
117117
}
118118

lib/src/main/java/de/contentpass/lib/KeyStore.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import javax.crypto.spec.SecretKeySpec
1818
import javax.security.auth.x500.X500Principal
1919
import java.security.KeyStore as VendorKeyStore
2020

21-
internal class KeyStore(private val context: Context) {
21+
internal class KeyStore(private val context: Context, private val propertyId: String) {
2222
private val keystoreName = "AndroidKeyStore"
23-
private val keyPairAlias = "de.contentpass.KeyPair"
23+
private val keyPairAlias = "de.contentpass.KeyPair.$propertyId"
2424
private val privateKey: PrivateKey
2525
private val publicKey: PublicKey
2626
private val keystore = VendorKeyStore.getInstance(keystoreName)

0 commit comments

Comments
 (0)