diff --git a/demoapp/composeApp/src/commonMain/kotlin/at/asitplus/cryptotest/App.kt b/demoapp/composeApp/src/commonMain/kotlin/at/asitplus/cryptotest/App.kt index f0df41e3..862ecfb1 100644 --- a/demoapp/composeApp/src/commonMain/kotlin/at/asitplus/cryptotest/App.kt +++ b/demoapp/composeApp/src/commonMain/kotlin/at/asitplus/cryptotest/App.kt @@ -123,9 +123,10 @@ internal fun App() { var currentSigner by remember { mutableStateOf?>(null) } val currentKey by getter { currentSigner?.mapCatching(Signer::publicKey) } val currentKeyStr by getter { - currentKey?.fold(onSuccess = { - it.toString() - }, + currentKey?.fold( + onSuccess = { + it.toString() + }, onFailure = { Napier.e("Key failed", it) "${it::class.simpleName ?: ""}: ${it.message}" @@ -310,8 +311,8 @@ internal fun App() { when (val alg = keyAlgorithm.algorithm) { is SignatureAlgorithm.ECDSA -> { this@createSigningKey.ec { - curve = alg.requiredCurve - ?: ECCurve.entries.find { it.nativeDigest == alg.digest }!! + curve = alg.requiredCurve ?: + ECCurve.entries.find { it.nativeDigest == alg.digest }!! digests = setOf(alg.digest) } } diff --git a/docs/docs/indispensable.md b/docs/docs/indispensable.md index 78b5a039..242f5788 100644 --- a/docs/docs/indispensable.md +++ b/docs/docs/indispensable.md @@ -275,7 +275,7 @@ All of these functions throw an `Asn1Exception` when decoding fails. Moreover, a generic tag assertion function is present on `Asn1Element`, which throws an `Asn1TagMisMatchException` on error and returns the tag-asserted element on success: -* `Asn1Element.assertTag()` takes either an `Asn1Element.Tag` or an `Ulong` tag number +* `Asn1Element.assertTag()` takes either an `Asn1Element.Tag` or an `ULong` tag number ### Encoding diff --git a/indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/Asn1Elements.kt b/indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/Asn1Elements.kt index 43b01a2d..cb9654b5 100644 --- a/indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/Asn1Elements.kt +++ b/indispensable/src/commonMain/kotlin/at/asitplus/signum/indispensable/asn1/Asn1Elements.kt @@ -247,7 +247,7 @@ sealed class Asn1Element( /** * Creates a copy of this tag, overriding [tagValue], but keeping [isConstructed] and [tagClass] */ - fun withNumber(number: ULong) = Tag(number, constructed = isConstructed, tagClass = tagClass) + infix fun withNumber(number: ULong) = Tag(number, constructed = isConstructed, tagClass = tagClass) constructor(tagValue: ULong, constructed: Boolean, tagClass: TagClass = TagClass.UNIVERSAL) : this( encode( @@ -409,7 +409,7 @@ inline fun T.assertTag(tag: Asn1Element.Tag): T { * @throws Asn1TagMismatchException on failure */ @Throws(Asn1TagMismatchException::class) -inline fun T.assertTag(tagNumber: ULong): T = assertTag(tag.withNumber(tagNumber)) +inline fun T.assertTag(tagNumber: ULong): T = assertTag(tag withNumber tagNumber) object Asn1EncodableSerializer : KSerializer { override val descriptor = PrimitiveSerialDescriptor("Asn1Encodable", PrimitiveKind.STRING) diff --git a/supreme/src/commonMain/kotlin/at/asitplus/signum/supreme/PkiExtensions.kt b/supreme/src/commonMain/kotlin/at/asitplus/signum/supreme/PkiExtensions.kt index 44c11ea8..c6389d05 100644 --- a/supreme/src/commonMain/kotlin/at/asitplus/signum/supreme/PkiExtensions.kt +++ b/supreme/src/commonMain/kotlin/at/asitplus/signum/supreme/PkiExtensions.kt @@ -23,7 +23,7 @@ suspend fun Signer.sign(tbsCertificate: TbsCertificate): KmmResult { val toX509SignatureAlgorithm =