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