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

net.corda.core.identity

## Class IdentityUtils

- net.corda.core.identity.IdentityUtils

-     public class IdentityUtils

- - ### Constructor Detail

    - #### IdentityUtils

          public IdentityUtils()

  - ### Method Detail

    - #### groupPublicKeysByWellKnownParty

          @NotNull
          public static java.util.Map<net.corda.core.identity.Party,java.util.List> groupPublicKeysByWellKnownParty(@NotNull
                                                                                                                             ServiceHub serviceHub,
                                                                                                                             @NotNull
                                                                                                                             java.util.Collection<? extends java.security.PublicKey> publicKeys,
                                                                                                                             boolean ignoreUnrecognisedParties)

      Group each PublicKey by the well known party using the `ServiceHub.identityService`, in preparation for creating FlowSessions, for example.

      Parameters:
        `publicKeys` - the PublicKeys to group.
        `ignoreUnrecognisedParties` - if this is false, throw an exception if some of the PublicKeys cannot be mappedto a `class Party`.
      Returns:
        a map of well known `class Party` to associated PublicKeys.
      See Also:
        PublicKey, `ServiceHub.identityService`, FlowSession

    - #### groupPublicKeysByWellKnownParty

          @NotNull
          public static java.util.Map<net.corda.core.identity.Party,java.util.List> groupPublicKeysByWellKnownParty(@NotNull
                                                                                                                             ServiceHub serviceHub,
                                                                                                                             @NotNull
                                                                                                                             java.util.Collection<? extends java.security.PublicKey> publicKeys)

      Group each PublicKey by the well known party using the `ServiceHub.identityService`, in preparation for creating FlowSessions, for example. Throw an exception if some of the PublicKeys cannot be mapped to a `class Party`.

      Parameters:
        `publicKeys` - the PublicKeys to group.
      Returns:
        a map of well known `class Party` to associated PublicKeys.
      See Also:
        PublicKey, `ServiceHub.identityService`, FlowSession, PublicKey, `class Party`

    - #### groupAbstractPartyByWellKnownParty

          @NotNull
          public static java.util.Map<net.corda.core.identity.Party,java.util.List> groupAbstractPartyByWellKnownParty(@NotNull
                                                                                                                                ServiceHub serviceHub,
                                                                                                                                @NotNull
                                                                                                                                java.util.Collection<? extends net.corda.core.identity.AbstractParty> parties,
                                                                                                                                boolean ignoreUnrecognisedParties)

      Group each `class AbstractParty` by the well known party using the `ServiceHub.identityService`, in preparation for creating FlowSessions, for example.

      Parameters:
        `parties` - the `class AbstractParty`s to group.
        `ignoreUnrecognisedParties` - if this is false, throw an exception if some of the `class AbstractParty`s cannot be mappedto a `class Party`.
      Returns:
        a map of well known `class Party` to associated `class AbstractParty`s.
      See Also:
        `class AbstractParty`, `ServiceHub.identityService`, FlowSession

    - #### groupAbstractPartyByWellKnownParty

          @NotNull
          public static java.util.Map<net.corda.core.identity.Party,java.util.List> groupAbstractPartyByWellKnownParty(@NotNull
                                                                                                                                ServiceHub serviceHub,
                                                                                                                                @NotNull
                                                                                                                                java.util.Collection<? extends net.corda.core.identity.AbstractParty> parties)

      Group each `class AbstractParty` by the well known party using the `ServiceHub.identityService`, in preparation for creating FlowSessions, for example. Throw an exception if some of the `class AbstractParty`s cannot be mapped to a `class Party`.

      Parameters:
        `parties` - the `class AbstractParty`s to group.
      Returns:
        a map of well known `class Party` to associated `class AbstractParty`s.
      See Also:
        `class AbstractParty`, `ServiceHub.identityService`, FlowSession, `class AbstractParty`, `class Party`

    - #### excludeHostNode

          @NotNull
          public static <T> java.util.Map<net.corda.core.identity.Party,T> excludeHostNode(@NotNull
                                                                                                    ServiceHub serviceHub,
                                                                                                    @NotNull
                                                                                                    java.util.Map<net.corda.core.identity.Party,? extends T> map)

      Remove this node from a map of well known `class Party`s.

      Returns:
        a new copy of the map, with he well known `class Party` for this node removed.
      See Also:
        `class Party`

    - #### excludeNotary

          @NotNull
          public static <T> java.util.Map<net.corda.core.identity.Party,T> excludeNotary(@NotNull
                                                                                                  java.util.Map<net.corda.core.identity.Party,? extends T> map,
                                                                                                  @NotNull
                                                                                                  SignedTransaction stx)

      Remove the `class Party` associated with the notary of a `class SignedTransaction` from the a map of `class Party`s. It is a no-op if the notary is null.

      Returns:
        a new copy of the map, with the well known `class Party` for the notary removed.
      See Also:
        `class Party`, `class SignedTransaction`, `class Party`

    - #### x500Matches

          public static boolean x500Matches(@NotNull
                                            java.lang.String query,
                                            boolean exactMatch,
                                            @NotNull
                                            CordaX500Name x500name)

      Check if `x500name` matches the `query`.

      See Also:
        `x500name`, `query`