Skip to main content
Agent API key creation asks the Neuron to create and store encrypted key material for supported signing workflows. This differs from a direct XMPP client that manages its own private keys.

Expected result

Procedure

  1. Call POST /Agent/Crypto/GetAlgorithms with the documented empty JSON body.
  2. Select an algorithm accepted by the relying identity or contract workflow; do not hard-code an algorithm merely because one Neuron returns it.
  3. Choose a unique id for the key. This caller-supplied value is the keyId used by later identity and signing operations.
  4. Calculate the signatures using the formulas below.
  5. Submit the request and retain the submitted id, localName, and namespace.
  6. Retrieve the public key through POST /Agent/Crypto/GetPublicKey when the relying workflow needs verification material.

State to retain

Never store a key password or account password beside these identifiers. CreateKey returns created and updated; it does not return a generated keyId.

Construct the request

The signed messages use colon separators with no whitespace:
HTTP-Host is the exact value sent in the HTTP Host header, including a non-default port. Generate nonce from at least 32 cryptographically random bytes, encode it as Base64, and do not reuse it.
Send the request over HTTPS using your authenticated session and application URL as Referer. Use the same id in the signed message and JSON body. Store that submitted identifier with the account and Legal Identity that will use it. See Create key reference.

Next