Updated on 2026-08-14

This commit is contained in:
Tangem 2020-04-02 17:46:51 +03:00
parent ee88184e1d
commit 880189ebe0

View file

@ -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)
class KeyPair(val publicKey: ByteArray, val privateKey: ByteArray) {
constructor(privateKey: ByteArray, curve: EllipticCurve = EllipticCurve.Secp256k1) :
this(generatePublicKey(privateKey, curve), privateKey)
}