diff --git a/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt b/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt index 95b31697dc..5304536b47 100644 --- a/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt +++ b/core/src/main/kotlin/net/corda/core/messaging/CordaRPCOps.kt @@ -241,6 +241,15 @@ interface CordaRPCOps : RPCOps { // TODO These need rethinking. Instead of these direct calls we should have a way of replicating a subset of // the node's state locally and query that directly. + /** + * Returns the well known identity from an abstract party. This is intended to resolve the well known identity + * from a confidential identity, however it transparently handles returning the well known identity back if + * a well known identity is passed in. + * + * @param party identity to determine well known identity for. + * @return well known identity, if found. + */ + fun partyFromAnonymous(party: AbstractParty): Party? /** * Returns the [Party] corresponding to the given key, if found. */ diff --git a/core/src/main/kotlin/net/corda/core/node/services/IdentityService.kt b/core/src/main/kotlin/net/corda/core/node/services/IdentityService.kt index 40b4a33f00..72266c8e3c 100644 --- a/core/src/main/kotlin/net/corda/core/node/services/IdentityService.kt +++ b/core/src/main/kotlin/net/corda/core/node/services/IdentityService.kt @@ -109,10 +109,12 @@ interface IdentityService { fun partyFromX500Name(principal: X500Name): Party? /** - * Resolve the well known identity of a party. If the party passed in is already a well known identity - * (i.e. a [Party]) this returns it as-is. + * Returns the well known identity from an abstract party. This is intended to resolve the well known identity + * from a confidential identity, however it transparently handles returning the well known identity back if + * a well known identity is passed in. * - * @return the well known identity, or null if unknown. + * @param party identity to determine well known identity for. + * @return well known identity, if found. */ fun partyFromAnonymous(party: AbstractParty): Party? diff --git a/node/src/main/kotlin/net/corda/node/internal/CordaRPCOpsImpl.kt b/node/src/main/kotlin/net/corda/node/internal/CordaRPCOpsImpl.kt index 77fc84b277..2b61838f39 100644 --- a/node/src/main/kotlin/net/corda/node/internal/CordaRPCOpsImpl.kt +++ b/node/src/main/kotlin/net/corda/node/internal/CordaRPCOpsImpl.kt @@ -149,6 +149,7 @@ class CordaRPCOpsImpl( override fun deauthoriseContractUpgrade(state: StateAndRef<*>) = services.vaultService.deauthoriseContractUpgrade(state) override fun currentNodeTime(): Instant = Instant.now(services.clock) override fun waitUntilRegisteredWithNetworkMap() = services.networkMapCache.mapServiceRegistered + override fun partyFromAnonymous(party: AbstractParty): Party? = services.identityService.partyFromAnonymous(party) override fun partyFromKey(key: PublicKey) = services.identityService.partyFromKey(key) @Suppress("DEPRECATION") @Deprecated("Use partyFromX500Name instead")