IdentityService

The IdentityService provides methods to retrieve Party and AnonymousParty instances. IdentityService can be injected into flows and services.

Retrieve Party instances

To retrieve a Party instance from IdentityService, you must provide a CordaX500Name:

  • Kotlin
val party: Party? = identityService.partyFromName(CordaX500Name("Alice Corp", "Madrid", "ES"))
  • Java
Party party = identityService.partyFromName(new CordaX500Name("Alice Corp", "Madrid", "ES"))

This will return the Party that matches the input CordaX500Name, otherwise null is returned if the party does not exist.

You can also retrieve the Party that matches an AbstractParty (which could be an AnonymousParty):

  • Kotlin
val party: Party? = identityService.partyFromAnonymous(anonymousParty)
  • Java
Party party = identityService.partyFromAnonymous(anonymousParty)

This will return the Party that matches the input AbstractParty if the well-known identity is known, otherwise null is returned.

Retrieve AnonymousParty instances

To retrieve an AnonymousParty instance from IdentityService you must provide the PublicKey that is used to represent the anonymous party:

  • Kotlin
val anonymousParty: AnonymousParty = identityService.anonymousPartyFromKey(publicKey)
  • Java
AnonymousParty anonymousParty = identityService.anonymousPartyFromKey(publicKey)

Was this page helpful?

Thanks for your feedback!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.

We're sorry this page wasn't helpful. Let us know how we can make it better!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Create an issue

Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.