crypto / org.apache.tuweni.crypto / SECP256K1 / PublicKey

PublicKey

class PublicKey (source)

A SECP256K1 public key.

Functions

asEcPoint

open fun asEcPoint(): ECPoint

Computes the public key as a point on the elliptic curve.

bytes

open fun bytes(): Bytes

bytesArray

open fun bytesArray(): ByteArray

equals

open fun equals(other: Any?): Boolean

fromBytes

open static fun fromBytes(bytes: Bytes): PublicKey

Create the public key from bytes.

fromHexString

open static fun fromHexString(str: CharSequence): PublicKey

Create the public key from a hex string.

fromInteger

open static fun fromInteger(privateKey: BigInteger): PublicKey

Create the public key from a secret key.

fromSecretKey

open static fun fromSecretKey(secretKey: SecretKey): PublicKey

Create the public key from a secret key.

hashCode

open fun hashCode(): Int

recoverFromHashAndSignature

open static fun recoverFromHashAndSignature(hash: ByteArray, signature: Signature): PublicKey?
open static fun recoverFromHashAndSignature(hash: Bytes32, signature: Signature): PublicKey?

Recover a public key using a digital signature and a keccak256 hash of the data it signs.

recoverFromSignature

open static fun recoverFromSignature(data: ByteArray, signature: Signature): PublicKey?
open static fun recoverFromSignature(data: Bytes, signature: Signature): PublicKey?

Recover a public key using a digital signature and the data it signs.

toHexString

open fun toHexString(): String

toString

open fun toString(): String