Party
Keywords: net.corda.core.identity.Party class
Date: 2023-09-18

net.corda.core.identity

## Class Party

- net.corda.core.identity.AbstractParty
- - net.corda.core.identity.Party

- All Implemented Interfaces:
    Destination

      public class Party
      extends AbstractParty
      implements Destination

  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 can be 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 X.500 name "CN=Alice Corp,O=Alice Corp,L=London,C=GB" 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.

  ### Flow sessions

  Communication with other parties is done using the flow framework with the `FlowLogic.initiateFlow` method. Message routing is done by using the network map to look up the connectivity details pertaining to the `class Party`.

  See Also:
    `class Party`, `class CompositeKey`, `class Party`, `class Party`, `class Party`, `class Party`, `FlowLogic.initiateFlow`, `class Party`, `class CompositeKey`

- - ### Field Detail

    - #### Companion

          public static net.corda.core.identity.Party.Companion Companion

  - ### Constructor Detail

    - #### Party

          public Party(@NotNull
                       CordaX500Name name,
                       @NotNull
                       java.security.PublicKey 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 can be 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 X.500 name "CN=Alice Corp,O=Alice Corp,L=London,C=GB" 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.

      ### Flow sessions

      Communication with other parties is done using the flow framework with the `FlowLogic.initiateFlow` method. Message routing is done by using the network map to look up the connectivity details pertaining to the `class Party`.

      See Also:
        `class Party`, `class CompositeKey`, `class Party`, `class Party`, `class Party`, `class Party`, `FlowLogic.initiateFlow`, `class Party`, `class CompositeKey`

    - #### Party

          public Party(@NotNull
                       java.security.cert.X509Certificate certificate)

  - ### Method Detail

    - #### nameOrNull

          @NotNull
          public CordaX500Name nameOrNull()

    - #### anonymise

          @NotNull
          public AnonymousParty anonymise()

    - #### ref

          @NotNull
          public PartyAndReference ref(@NotNull
                                                OpaqueBytes bytes)

      Build a reference to something being stored or issued by a party e.g. in a vault or (more likely) on their normal ledger.

    - #### toString

          @NotNull
          public java.lang.String toString()

    - #### description

          @NotNull
          public java.lang.String description()

    - #### getName

          @NotNull
          public CordaX500Name getName()