Skip to content

Commit 36969fa

Browse files
committed
WIP: tests
1 parent 21c01ec commit 36969fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cryptography-providers/webcrypto/src/commonMain/kotlin/materials/WebCryptoKeyDecoder.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/*
2-
* Copyright (c) 2023-2024 Oleg Yukhnevich. Use of this source code is governed by the Apache 2.0 license.
2+
* Copyright (c) 2023-2025 Oleg Yukhnevich. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

55
package dev.whyoleg.cryptography.providers.webcrypto.materials
66

77
import dev.whyoleg.cryptography.materials.key.*
88
import dev.whyoleg.cryptography.providers.webcrypto.internal.*
9+
import kotlin.io.encoding.*
910

1011
internal class WebCryptoKeyDecoder<KF : KeyFormat, K : Key>(
1112
private val algorithm: Algorithm,
@@ -14,7 +15,9 @@ internal class WebCryptoKeyDecoder<KF : KeyFormat, K : Key>(
1415
) : KeyDecoder<KF, K> {
1516
override suspend fun decodeFromByteArray(format: KF, bytes: ByteArray): K = keyWrapper.wrap(
1617
WebCrypto.importKey(
17-
format = keyProcessor.stringFormat(format),
18+
format = keyProcessor.stringFormat(format).also {
19+
println("format: $it | ${algorithm} | ${Base64.encode(bytes)}\n")
20+
},
1821
keyData = keyProcessor.beforeDecoding(algorithm, format, bytes),
1922
algorithm = algorithm,
2023
extractable = true,

0 commit comments

Comments
 (0)