Forum chevron_right Corda Topics chevron_right CorDapp Development chevron_right How to access Corda Notary’s Publickey?

  • Creator
  • #9724
    QA Bot

    Hello. I’m new to Corda, (and Slack as well).

    I’m creating an app using corda open source 4.8.5. There is a requirement for me to store the actual public key of the notary who approved the transaction once the transaction has been recorded in the node’s vaults. I want to send the notary’s public key as part of the response when the client calls the API. Please tell me how do I obtain it.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #9726
    QA Bot

    Do you need to do this every time you are sending a transaction? Or you just need to once in a while?

    Because each transaction (once finalized, meaning stored in the vault) will state what signatures it has on it. If you are doing a transaction involving two parties, and the notary, you will see three signatures in the transaction, under the Signatures section.

    For example:

    And you gotta do some checking to find which the pub key belongs to the notary. but that is not really difficult.

    QA Bot

    [Follow up question]:

    I’m returning FlowLogic from my flow to the spring-boot controller (RPC) that I have. When I try doing:

    val signedTx =proxy.startTrackedFlow(::NewLoadFlowInitiator,req).returnValue.getOrThrow()
    val notaryPublicKey = signedTx.notary.owningKey

    The value which I get inside the notaryPublicKey variable looks something like this:

    How do I get the public key from here?

    QA Bot

    RPC cant deserialize the content that was serialized by Corda node. If you want to do it via code, you gotta implmeent a new flow that get the keys (signers) from the node directly via a flow.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.

Subscribe to our newsletter to stay up to date on the latest developer news, tools, and articles.