From 880189ebe0bc5ab4106170149c45d1e59e9de422 Mon Sep 17 00:00:00 2001 From: Tangem Date: Thu, 2 Apr 2020 17:46:51 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../src/main/java/com/tangem/common/CardEnvironment.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tangem-core/src/main/java/com/tangem/common/CardEnvironment.kt b/tangem-core/src/main/java/com/tangem/common/CardEnvironment.kt index c556f427b3..09cfd736b4 100644 --- a/tangem-core/src/main/java/com/tangem/common/CardEnvironment.kt +++ b/tangem-core/src/main/java/com/tangem/common/CardEnvironment.kt @@ -1,5 +1,8 @@ package com.tangem.common +import com.tangem.commands.EllipticCurve +import com.tangem.crypto.CryptoUtils.generatePublicKey + /** * Contains data relating to a Tangem card. It is used in constructing all the commands, @@ -27,4 +30,8 @@ enum class EncryptionMode(val code: Byte) { STRONG(0x2) } -class KeyPair(val publicKey: ByteArray, val privateKey: ByteArray) \ No newline at end of file +class KeyPair(val publicKey: ByteArray, val privateKey: ByteArray) { + + constructor(privateKey: ByteArray, curve: EllipticCurve = EllipticCurve.Secp256k1) : + this(generatePublicKey(privateKey, curve), privateKey) +} \ No newline at end of file