corda / net.corda.testing.core / TestIdentity

TestIdentity

class TestIdentity

A class that encapsulates a test identity containing a CordaX500Name and a KeyPair, alongside a range of utility methods for use during testing.

Constructors

<init>

TestIdentity(name: CordaX500Name, entropy: Long)

Creates an identity with a deterministic keyPair i.e. same entropy same keyPair .

TestIdentity(name: CordaX500Name)

Creates an identity with the given name and a fresh keyPair.

TestIdentity(name: CordaX500Name, keyPair: KeyPair)

A class that encapsulates a test identity containing a CordaX500Name and a KeyPair, alongside a range of utility methods for use during testing.

Properties

identity

val identity: PartyAndCertificate

keyPair

val keyPair: KeyPair

name

val name: CordaX500Name

party

val party: Party

publicKey

val publicKey: PublicKey

Functions

ref

fun ref(vararg bytes: Byte): PartyAndReference

Returns a PartyAndReference for this identity and the given reference

Companion Object Functions

fresh

fun fresh(organisation: String): TestIdentity

Creates an identity that won't equal any other. This is mostly useful as a throwaway for test helpers.

Extension Functions

contextLogger

fun Any.contextLogger(): Logger

When called from a companion object, returns the logger for the enclosing class.