IdentityService.DefaultImpls
Keywords: net.corda.core.node.services.IdentityService.DefaultImpls class
Date: 2023-09-18

net.corda.core.node.services

## Class IdentityService.DefaultImpls

- net.corda.core.node.services.IdentityService.DefaultImpls

- Enclosing interface:
    IdentityService

      public static class IdentityService.DefaultImpls

  An identity service maintains a directory of parties by their associated distinguished name/public keys and thus supports lookup of a party given its key, or name. The service also manages the certificates linking confidential identities back to the well known identity.

  Well known identities in Corda are the public identity of a party, registered with the network map directory, whereas confidential identities are distributed only on a need to know basis (typically between parties in a transaction being built). See `interface NetworkMapCache` for retrieving well known identities from the network map.

  See Also:
    `interface NetworkMapCache`

- - ### Constructor Detail

    - #### DefaultImpls

          public DefaultImpls()

  - ### Method Detail

    - #### assertOwnership

          public static void assertOwnership(IdentityService $this,
                                             @NotNull
                                             Party party,
                                             @NotNull
                                             AnonymousParty anonymousParty)

      Asserts that an anonymous party maps to the given full party, by looking up the certificate chain associated with the anonymous party and resolving it back to the given full party.

      Throws:
        `UnknownAnonymousPartyException` - if the anonymous party is not owned by the full party.

    - #### wellKnownPartyFromAnonymous

          @Nullable
          public static Party wellKnownPartyFromAnonymous(IdentityService $this,
                                                                    @NotNull
                                                                    AbstractParty party)

      Resolves a (optionally) confidential identity to the corresponding well known identity `class Party`. It transparently handles returning the well known identity back if a well known identity is passed in.

      Parameters:
        `$this` - identity to determine well known identity for.
        `party` - identity to determine well known identity for.
      Returns:
        well known identity, if found.
      See Also:
        `class Party`

    - #### wellKnownPartyFromAnonymous

          @Nullable
          public static Party wellKnownPartyFromAnonymous(IdentityService $this,
                                                                    @NotNull
                                                                    PartyAndReference partyRef)

      Resolves a (optionally) confidential identity to the corresponding well known identity `class Party`. Convenience method which unwraps the `class Party` from the `class PartyAndReference` and then resolves the well known identity as normal. It transparently handles returning the well known identity back if a well known identity is passed in.

      Parameters:
        `$this` - identity (and reference, which is unused) to determine well known identity for.
        `partyRef` - identity (and reference, which is unused) to determine well known identity for.
      Returns:
        the well known identity, or null if unknown.
      See Also:
        `class Party`, `class Party`, `class PartyAndReference`

    - #### requireWellKnownPartyFromAnonymous

          @NotNull
          public static Party requireWellKnownPartyFromAnonymous(IdentityService $this,
                                                                          @NotNull
                                                                          AbstractParty party)

      Resolve the well known identity of a party. Throws an exception if the party cannot be identified. If the party passed in is already a well known identity (i.e. a `class Party`) this returns it as-is.

      Returns:
        the well known identity.
      Throws:
        `IllegalArgumentException`
      See Also:
        `class Party`