MAILGENT

identity.verify

Verify a signature against any did:web identity

Scope: identity:verify

Verify a signature against any did:web identity. Resolves the DID Document and checks the signature.

Parameters

NameTypeRequiredDescription
datastringYesBase64-encoded original data
signaturestringYesBase64-encoded signature to verify
didstringYesDID of the signer (e.g., did:web:api.mailgent.dev:identities:id-abc123)

Example

Agent: "Verify this message was signed by agent id-abc123"

-> identity.verify({
    data: "SGVsbG8gV29ybGQ=",
    signature: "base64-signature",
    did: "did:web:api.mailgent.dev:identities:id-abc123"
  })

Returns

{
  "valid": true,
  "did": "did:web:api.mailgent.dev:identities:id-abc123"
}

How it works

  1. For Mailgent identities — resolves the public key directly.
  2. For external DIDs — fetches the DID Document over HTTPS and extracts the public key.
  3. Verifies the signature against the resolved public key.

Use cases

  • Agent-to-agent trust: One agent verifies that a message was signed by another agent
  • Proof of origin: Verify that data was produced by a specific identity
  • Cross-platform verification: Verify signatures from any did:web identity, not just Mailgent

On this page