> For the complete documentation index, see [llms.txt](https://vectis.liesware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://vectis.liesware.com/signatures.md).

# Signatures

## POST /sign/{kid}

> Sign a message hash with EdDSA and ML-DSA

```json
{"openapi":"3.1.0","info":{"title":"Vectis HTTP API","version":"v1"},"tags":[{"name":"Signatures"}],"servers":[{"url":"http://127.0.0.1:3000","description":"Local default server over HTTP"},{"url":"https://127.0.0.1:3000","description":"Local HTTPS server when VECTIS_MODE=prod"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}},"parameters":{"Kid":{"name":"kid","in":"path","required":true,"schema":{"$ref":"#/components/schemas/Kid"}}},"schemas":{"Kid":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"},"SignInput":{"type":"object","additionalProperties":false,"required":["message_hash"],"properties":{"message_hash":{"$ref":"#/components/schemas/MessageHash"}}},"MessageHash":{"oneOf":[{"$ref":"#/components/schemas/Hash160"},{"$ref":"#/components/schemas/Hash224Blake2b"},{"$ref":"#/components/schemas/Hash224Sha2"},{"$ref":"#/components/schemas/Hash224Sha3"},{"$ref":"#/components/schemas/Hash256"},{"$ref":"#/components/schemas/Hash384"},{"$ref":"#/components/schemas/Hash512"}]},"Hash160":{"type":"object","additionalProperties":false,"required":["alg","hex"],"properties":{"alg":{"const":"BLAKE2b(160)"},"hex":{"type":"string","pattern":"^[0-9a-fA-F]{40}$"}}},"Hash224Blake2b":{"type":"object","additionalProperties":false,"required":["alg","hex"],"properties":{"alg":{"const":"BLAKE2b(224)"},"hex":{"type":"string","pattern":"^[0-9a-fA-F]{56}$"}}},"Hash224Sha2":{"type":"object","additionalProperties":false,"required":["alg","hex"],"properties":{"alg":{"const":"SHA-224"},"hex":{"type":"string","pattern":"^[0-9a-fA-F]{56}$"}}},"Hash224Sha3":{"type":"object","additionalProperties":false,"required":["alg","hex"],"properties":{"alg":{"const":"SHA-3(224)"},"hex":{"type":"string","pattern":"^[0-9a-fA-F]{56}$"}}},"Hash256":{"type":"object","additionalProperties":false,"required":["alg","hex"],"properties":{"alg":{"enum":["BLAKE2b(256)","SHA-256","SHA-512-256","SHA-3(256)"]},"hex":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"}}},"Hash384":{"type":"object","additionalProperties":false,"required":["alg","hex"],"properties":{"alg":{"enum":["BLAKE2b(384)","SHA-384","SHA-3(384)"]},"hex":{"type":"string","pattern":"^[0-9a-fA-F]{96}$"}}},"Hash512":{"type":"object","additionalProperties":false,"required":["alg","hex"],"properties":{"alg":{"enum":["BLAKE2b(512)","SHA-512","SHA-3(512)","Whirlpool"]},"hex":{"type":"string","pattern":"^[0-9a-fA-F]{128}$"}}},"CompactSignatureToken":{"type":"object","additionalProperties":false,"required":["kid","signature"],"properties":{"kid":{"$ref":"#/components/schemas/Kid"},"signature":{"type":"string","maxLength":65536,"description":"Four unpadded Base64URL segments: header.payload.eddsa.ml-dsa."}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/TextField"}}},"TextField":{"type":"string","minLength":1,"pattern":"^[^\\x00-\\x1F\\x7F-\\x9F]+$"}},"responses":{"RequestBodyTooLarge":{"description":"Request body exceeds the internal 2 MiB limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Error":{"description":"Public error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/sign/{kid}":{"post":{"tags":["Signatures"],"summary":"Sign a message hash with EdDSA and ML-DSA","parameters":[{"$ref":"#/components/parameters/Kid"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignInput"}}}},"responses":{"200":{"description":"Compact hybrid signature token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompactSignatureToken"}}}},"413":{"$ref":"#/components/responses/RequestBodyTooLarge"},"default":{"$ref":"#/components/responses/Error"}}}}}}
```

## POST /sign/verification

> Verify a compact hybrid signature token

```json
{"openapi":"3.1.0","info":{"title":"Vectis HTTP API","version":"v1"},"tags":[{"name":"Signatures"}],"servers":[{"url":"http://127.0.0.1:3000","description":"Local default server over HTTP"},{"url":"https://127.0.0.1:3000","description":"Local HTTPS server when VECTIS_MODE=prod"}],"paths":{"/sign/verification":{"post":{"tags":["Signatures"],"summary":"Verify a compact hybrid signature token","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompactSignatureToken"}}}},"responses":{"200":{"description":"Signature verification result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationOutput"}}}},"413":{"$ref":"#/components/responses/RequestBodyTooLarge"},"default":{"$ref":"#/components/responses/Error"}}}}},"components":{"schemas":{"CompactSignatureToken":{"type":"object","additionalProperties":false,"required":["kid","signature"],"properties":{"kid":{"$ref":"#/components/schemas/Kid"},"signature":{"type":"string","maxLength":65536,"description":"Four unpadded Base64URL segments: header.payload.eddsa.ml-dsa."}}},"Kid":{"type":"string","pattern":"^[0-9a-fA-F]{64}$"},"VerificationOutput":{"type":"object","required":["status","valid"],"properties":{"status":{"type":"object","required":["eddsa","ml-dsa"],"properties":{"eddsa":{"enum":["ok","fail","not_checked"]},"ml-dsa":{"enum":["ok","fail"]}}},"valid":{"enum":["ok","fail"]}}},"ErrorResponse":{"type":"object","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/TextField"}}},"TextField":{"type":"string","minLength":1,"pattern":"^[^\\x00-\\x1F\\x7F-\\x9F]+$"}},"responses":{"RequestBodyTooLarge":{"description":"Request body exceeds the internal 2 MiB limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"Error":{"description":"Public error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}
```
