net.corda.core.crypto

## Class Party

- net.corda.core.crypto.AbstractParty
- - net.corda.core.crypto.Party

-     public class Party
      extends AbstractParty

  The `class Party` class represents an entity on the network, which is typically identified by a legal name and public key that it can sign transactions under. As parties may use multiple keys for signing and, for example, have offline backup keys, the "public key" of a party is represented by a composite construct – a `class CompositeKey`, which combines multiple cryptographic public key primitives into a tree structure.

  For example: Alice has two key pairs (pub1/priv1 and pub2/priv2), and wants to be able to sign transactions with either of them. Her advertised `class Party` then has a legal name "Alice" and an owningKey "pub1 or pub2".

  `class Party` is also used for service identities. E.g. Alice may also be running an interest rate oracle on her Corda node, which requires a separate signing key (and an identifying name). Services can also be distributed – run by a coordinated cluster of Corda nodes. A `class Party` representing a distributed service will use a composite key containing all individual cluster nodes' public keys. Each of the nodes in the cluster will advertise the same group `class Party`.

  Note that equality is based solely on the owning key.

  See Also:
    `class Party`, `class CompositeKey`, `class Party`, `class Party`, `class Party`, `class Party`, `class CompositeKey`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Party(java.lang.String name, CompositeKey owningKey)` The `class Party` class represents an entity on the network, which is typically identified by a legal name and public key that it can sign transactions under. As parties may use multiple keys for signing and, for example, have offline backup keys, the "public key" of a party is represented by a composite construct – a `class CompositeKey`, which combines multiple cryptographic public key primitives into a tree structure.
    `Party(java.lang.String name, java.security.PublicKey owningKey)` A helper constructor that converts the given PublicKey in to a `class CompositeKey` with a single node

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getName()`
    `java.lang.String` | `nameOrNull()`
    `PartyAndReference` | `ref(OpaqueBytes bytes)`
    `AnonymousParty` | `toAnonymous()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class net.corda.core.crypto.AbstractParty

      `equals, getOwningKey, hashCode, nameOrNull, ref, ref, toAnonymous`

- - ### Constructor Detail

    - #### Party

          public Party(java.lang.String name,
                       CompositeKey owningKey)

      The `class Party` class represents an entity on the network, which is typically identified by a legal name and public key that it can sign transactions under. As parties may use multiple keys for signing and, for example, have offline backup keys, the "public key" of a party is represented by a composite construct – a `class CompositeKey`, which combines multiple cryptographic public key primitives into a tree structure.

      For example: Alice has two key pairs (pub1/priv1 and pub2/priv2), and wants to be able to sign transactions with either of them. Her advertised `class Party` then has a legal name "Alice" and an owningKey "pub1 or pub2".

      `class Party` is also used for service identities. E.g. Alice may also be running an interest rate oracle on her Corda node, which requires a separate signing key (and an identifying name). Services can also be distributed – run by a coordinated cluster of Corda nodes. A `class Party` representing a distributed service will use a composite key containing all individual cluster nodes' public keys. Each of the nodes in the cluster will advertise the same group `class Party`.

      Note that equality is based solely on the owning key.

      See Also:
        `class Party`, `class CompositeKey`, `class Party`, `class Party`, `class Party`, `class Party`, `class CompositeKey`

    - #### Party

          public Party(java.lang.String name,
                       java.security.PublicKey owningKey)

      A helper constructor that converts the given PublicKey in to a `class CompositeKey` with a single node

      See Also:
        PublicKey, `class CompositeKey`

  - ### Method Detail

    - #### toAnonymous

          public AnonymousParty toAnonymous()

    - #### toString

          public java.lang.String toString()

    - #### nameOrNull

          public java.lang.String nameOrNull()

    - #### ref

          public PartyAndReference ref(OpaqueBytes bytes)

    - #### getName

          public java.lang.String getName()