Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to signum 3.11 #176

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ Release 5.2.0:
- New artefact `vck-openid-ktor` implements a ktor client for OpenID for Verifiable Credential Issuance and OpenID for Verifiable Presentations
- Remove `scopePresentationDefinitionRetriever` from `OidcSiopWallet` to keep implementation simple
- In subclasses of `SubjectCredentialStore.StoreEntry` replace `scheme: ConstantIndex.CredentialScheme` with `schemaUri: String` to actually make it serializable
- Dependency Updates:
- Signum 3.11.0
- Kotlin 2.1.0 through Conventions 2.1.0+20241204

Release 5.1.0:
- Drop ARIES protocol implementation, and the `vck-aries` artifact
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
[![A-SIT Plus Official](https://img.shields.io/badge/A--SIT_Plus-official-005b79?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxNDMuNzYyODYgMTg0LjgxOTk5Ij48ZGVmcz48Y2xpcFBhdGggaWQ9ImEiIGNsaXBQYXRoVW5pdHM9InVzZXJTcGFjZU9uVXNlIj48cGF0aCBkPSJNMCA1OTUuMjhoODQxLjg5VjBIMFoiLz48L2NsaXBQYXRoPjwvZGVmcz48ZyBjbGlwLXBhdGg9InVybCgjYSkiIHRyYW5zZm9ybT0ibWF0cml4KDEuMzMzMzMzMyAwIDAgLTEuMzMzMz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ljg5LS40Yy0uMi0uMDQtLjM0LjM0LS4zNC41NCAwIC4yNy0uMDMuNC0uMDYuNi0uNSAyLjgyLTEuMzggNS40LTIuNjEgNy42OWEyOC41MyAyOC41MyAwIDAgMS04LjI0IDkuNTggMzUuMDEgMzUuMDEgMCAwIDEtMTEuOTYgNS41NyA1NS4yNSA1NS4yNSAwIDAgMS0xMi41NyAxLjc3Yy00LjMyLS4xLTguNjEtLjcxLTEyLjc1LTEuOGEzNS4wNSAzNS4wNSAwIDAgMS0xMS45Ni01LjU3IDI4LjUyIDI4LjUyIDAgMCAxLTguMjMtOS41OGMtMS44Ni0zLjQ0LTIuOS03LjU1LTMuMDktMTIuMmwtLjAxLTcuNDdoODkuMTZhLjcuNyAwIDAgMCAuNy0uNzJ2LTM5LjVjLS4xLTcuNjUtMS41OC0xNC40LTQuMzgtMjAuMDZhNDAuNCA0MC40IDAgMCAwLTExLjk1LTE0LjU2IDUyLjM3IDUyLjM3IDAgMCAwLTE3LjQ4LTguNDcgNzcuNTYgNzcuNTYgMCAwIDAtMjAuMDEtMi43N1oiLz48cGF0aCBmaWxsPSIjY2U0OTJlIiBkPSJNNDE5LjM4IDI4MC42M2gtNy41N2EuNy43IDAgMCAwLS43MS43MXYxNS40MmE4LjE3IDguMTcgMCAwIDAtMy43OCA2LjkgOC4yOCA4LjI4IDAgMCAwIDE2LjU0IDAgOC4yOSA4LjI5IDAgMCAwLTMuNzYtNi45di0xNS40MmEuNy43IDAgMCAwLS43Mi0uNzEiLz48L2c%2BPC9zdmc%2B&logoColor=white&labelColor=white)](https://a-sit-plus.github.io)
[![GitHub license](https://img.shields.io/badge/license-Apache%20License%202.0-brightgreen.svg?style=flat)](http://www.apache.org/licenses/LICENSE-2.0)
[![Kotlin](https://img.shields.io/badge/kotlin-multiplatform--mobile-orange.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-2.0.20-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Kotlin](https://img.shields.io/badge/kotlin-2.1.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
[![Java](https://img.shields.io/badge/java-17-blue.svg?logo=OPENJDK)](https://www.oracle.com/java/technologies/downloads/#java17)
[![Maven Central](https://img.shields.io/maven-central/v/at.asitplus.wallet/vck)](https://mvnrepository.com/artifact/at.asitplus.wallet/vck)

Expand Down
4 changes: 2 additions & 2 deletions conventions-vclib/src/main/resources/vcLibVersions.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
signum=3.11.0-SNAPSHOT
supreme=0.5.0
signum=3.11.0
supreme=0.6.0
uuid=0.8.1
jsonpath=2.4.0
jvm.json=20230618
Expand Down
2 changes: 1 addition & 1 deletion signum
Submodule signum updated 64 files
+31 −9 CHANGELOG.md
+1 −1 README.md
+1 −1 build.gradle.kts
+1 −1 docs/docs/examples.md
+24 −19 docs/docs/features.md
+1 −0 docs/docs/index.md
+45 −9 docs/docs/indispensable.md
+5 −0 docs/docs/stylesheets/extra.css
+48 −1 docs/docs/supreme.md
+1 −0 docs/mkdocs.yml
+2 −2 gradle.properties
+49 −20 indispensable-asn1/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/Asn1Elements.kt
+8 −2 indispensable-asn1/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/Asn1Integer.kt
+4 −3 indispensable-asn1/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/encoding/Asn1Decoding.kt
+2 −1 indispensable-asn1/src/commonTest/kotlin/at/asitplus/signum/indispensable/asn1/CastingTest.kt
+1 −1 indispensable-asn1/src/jvmTest/kotlin/at/asitplus/signum/indispensable/asn1/Asn1ParserTest.kt
+1 −0 indispensable-cosef/build.gradle.kts
+3 −3 indispensable-cosef/src/jvmTest/kotlin/CoseKeySerializationTest.kt
+1 −0 indispensable-josef/build.gradle.kts
+1 −3 indispensable-josef/src/jvmTest/kotlin/at/asitplus/signum/indispensable/josef/JsonWebKeyJvmTest.kt
+3 −3 indispensable-josef/src/jvmTest/kotlin/at/asitplus/signum/indispensable/josef/JwsSignedTest.kt
+1 −0 indispensable/build.gradle.kts
+584 −0 indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/CryptoPrivateKey.kt
+4 −10 indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/CryptoPublicKey.kt
+2 −2 indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/CryptoSignature.kt
+43 −1 indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/ECCurve.kt
+1 −1 indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/ECPoint.kt
+1 −1 indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/Asn1Addons.kt
+82 −0 indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/PemEncodable.kt
+0 −1 indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/pki/Pkcs10CertificationRequest.kt
+386 −0 indispensable/src/commonTest/kotlin/PemTest.kt
+1 −1 indispensable/src/commonTest/kotlin/UtilTest.kt
+105 −81 indispensable/src/iosMain/kotlin/CommonCryptoExtensions.kt
+73 −20 indispensable/src/jvmMain/kotlin/at/asitplus/signum/indispensable/JcaExtensions.kt
+31 −11 indispensable/src/jvmTest/kotlin/at/asitplus/signum/indispensable/KeyTest.kt
+1 −1 indispensable/src/jvmTest/kotlin/at/asitplus/signum/indispensable/pki/Pkcs10CertificationRequestJvmTest.kt
+1 −1 indispensable/src/jvmTest/kotlin/at/asitplus/signum/indispensable/pki/X509CertificateJvmTest.kt
+1 −0 internals/.gitignore
+141 −0 internals/build.gradle.kts
+4 −7 internals/src/commonMain/kotlin/at/asitplus/signum/internals/Utils.kt
+132 −0 internals/src/iosMain/kotlin/at/asitplus/signum/internals/InteropUtils.kt
+10 −0 internals/src/jvmMain/kotlin/at/asitplus/signum/internals/JcaUtil.kt
+1 −0 settings.gradle.kts
+4 −2 supreme/build.gradle.kts
+61 −61 supreme/src/androidMain/kotlin/at/asitplus/signum/supreme/AndroidInitialization.kt
+4 −0 supreme/src/androidMain/kotlin/at/asitplus/signum/supreme/os/AndroidKeyStoreProvider.kt
+12 −0 supreme/src/androidMain/kotlin/at/asitplus/signum/supreme/sign/EphemeralKeysImpl.kt
+26 −0 supreme/src/androidMain/kotlin/at/asitplus/signum/supreme/sign/PrivateKeySignerImpl.kt
+5 −5 supreme/src/androidMain/kotlin/at/asitplus/signum/supreme/sign/VerifierImpl.kt
+5 −0 supreme/src/commonMain/kotlin/at/asitplus/signum/supreme/Throwables.kt
+12 −0 supreme/src/commonMain/kotlin/at/asitplus/signum/supreme/sign/EphemeralKeys.kt
+44 −18 supreme/src/commonMain/kotlin/at/asitplus/signum/supreme/sign/Signer.kt
+26 −6 supreme/src/commonTest/kotlin/at/asitplus/signum/supreme/sign/EphemeralSignerCommonTests.kt
+93 −0 supreme/src/commonTest/kotlin/at/asitplus/signum/supreme/sign/PrivateKeyCommonTests.kt
+3 −126 supreme/src/iosMain/kotlin/at/asitplus/signum/supreme/InteropUtils.kt
+7 −10 supreme/src/iosMain/kotlin/at/asitplus/signum/supreme/os/IosKeychainProvider.kt
+58 −44 supreme/src/iosMain/kotlin/at/asitplus/signum/supreme/sign/EphemeralKeysImpl.kt
+68 −0 supreme/src/iosMain/kotlin/at/asitplus/signum/supreme/sign/PrivateKeySignerImpl.kt
+1 −6 supreme/src/iosMain/kotlin/at/asitplus/signum/supreme/sign/VerifierImpl.kt
+2 −0 supreme/src/iosTest/kotlin/Test.kt
+14 −0 supreme/src/jvmMain/kotlin/at/asitplus/signum/supreme/sign/EphemeralKeysImpl.kt
+70 −0 supreme/src/jvmMain/kotlin/at/asitplus/signum/supreme/sign/PrivateKeySignerImpl.kt
+5 −5 supreme/src/jvmMain/kotlin/at/asitplus/signum/supreme/sign/VerifierImpl.kt
+1 −1 supreme/src/jvmTest/kotlin/at/asitplus/signum/supreme/os/JKSProviderTest.kt
10 changes: 10 additions & 0 deletions vck/src/commonTest/kotlin/at/asitplus/wallet/lib/TestUtils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package at.asitplus.wallet.lib

/** Drops bytes at the start, or adds zero bytes at the start, until the [size] is reached */
fun ByteArray.ensureSize(size: Int): ByteArray = (this.size - size).let { toDrop ->
when {
toDrop > 0 -> this.copyOfRange(toDrop, this.size)
toDrop < 0 -> ByteArray(-toDrop) + this
else -> this
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package at.asitplus.wallet.lib.jws

import at.asitplus.signum.indispensable.ECCurve
import at.asitplus.signum.indispensable.misc.ensureSize
import at.asitplus.signum.indispensable.josef.JsonWebKey
import at.asitplus.wallet.lib.ensureSize
import io.kotest.core.spec.style.FreeSpec
import io.kotest.matchers.nulls.shouldNotBeNull
import io.kotest.matchers.shouldBe
Expand All @@ -24,8 +24,8 @@ class JsonWebKeyJvmTest : FreeSpec({
}

"JWK can be created from Coordinates" - {
val xFromBc = (keyPair.public as ECPublicKey).w.affineX.toByteArray().ensureSize(ecCurve.coordinateLengthBytes)
val yFromBc = (keyPair.public as ECPublicKey).w.affineY.toByteArray().ensureSize(ecCurve.coordinateLengthBytes)
val xFromBc = (keyPair.public as ECPublicKey).w.affineX.toByteArray().ensureSize(ecCurve.coordinateLengthBytes.toInt())
val yFromBc = (keyPair.public as ECPublicKey).w.affineY.toByteArray().ensureSize(ecCurve.coordinateLengthBytes.toInt())
val jsonWebKey = JsonWebKey.fromCoordinates(ecCurve, xFromBc, yFromBc).getOrThrow()

jsonWebKey.x shouldBe xFromBc
Expand All @@ -42,8 +42,8 @@ class JsonWebKeyJvmTest : FreeSpec({
}

"JWK can be created from ANSI X962" - {
val xFromBc = (keyPair.public as ECPublicKey).w.affineX.toByteArray().ensureSize(ecCurve.coordinateLengthBytes)
val yFromBc = (keyPair.public as ECPublicKey).w.affineY.toByteArray().ensureSize(ecCurve.coordinateLengthBytes)
val xFromBc = (keyPair.public as ECPublicKey).w.affineX.toByteArray().ensureSize(ecCurve.coordinateLengthBytes.toInt())
val yFromBc = (keyPair.public as ECPublicKey).w.affineY.toByteArray().ensureSize(ecCurve.coordinateLengthBytes.toInt())
val ansiX962 = byteArrayOf(0x04) + xFromBc + yFromBc
val jsonWebKey = JsonWebKey.fromCoordinates(ecCurve, xFromBc, yFromBc).getOrThrow()

Expand Down
Loading