Entity reference
Target audience: Solution Architects, Enterprise Architects, Platform Implementers
Reading time: 25 minutes (full read), or jump to a specific entity
Prerequisites: The six-layer model
Introduction
This page is the canonical reference for the thirteen entities documented here: the twelve entities of the deployment organization model, plus the single control-plane orchestration entity that sits above it. Each entity definition includes its purpose, key attributes, lifecycle considerations, and concrete examples.
For the layered structure that groups these entities, see The six-layer model. For their relationships and runtime composition, see Relationships and runtime flow.
Organizational entities
Deployment
A Deployment is a complete installation of ANKASecure©. It defines:
- The infrastructure footprint (compute, network, storage)
- The global compliance baseline (regulatory region, certification posture)
- HSM and KMS integrations (vendor, slots, partitions)
- Default cryptographic policies inherited by tenants
A Deployment maps to a productive environment, a regulatory region, or a logical infrastructure boundary. Organizations operating under conflicting regulatory regimes — for example, jurisdictions with incompatible cryptographic mandates — typically run separate deployments.
Key attributes:
| Attribute | Description |
|---|---|
| Compliance region | The regulatory frame (BSI, NIST, ANSSI, ETSI, EU, UNRESTRICTED) |
| HSM provider | The cryptographic substrate (PKCS#11, AWS CloudHSM, Thales Luna, SoftHSM) |
| Default policies | The baseline algorithm catalog and lifecycle rules |
| Environment classification | Production, disaster recovery, development |
When to define a separate deployment: when the regulatory or jurisdictional context differs in ways that require independent governance. A single multinational organization may run multiple deployments — one per major regulatory region — to satisfy data residency and sovereign cryptography requirements.
Tenant
A Tenant is an isolated cryptographic domain within a Deployment. It provides:
- Boundaries of key ownership
- Independent policy scope (within deployment baseline)
- Administrative separation
- Audit isolation
Each tenant owns its cryptographic assets and defines its own governance rules within the constraints imposed by the deployment. A compromise within one tenant cannot reach assets in another tenant, even when both run on the same infrastructure.
Key attributes:
| Attribute | Description |
|---|---|
| Tenant identifier | UUID, stable across the tenant's lifetime |
| Display name | Human-readable name (Core Banking, Digital Channels, Risk & Compliance) |
| KEK label | Reference to the tenant's Key Encryption Key in the HSM |
| Inherited policies | Policies inherited from the deployment baseline |
| Local policy overrides | Tenant-specific policy overrides within allowed ranges |
Multi-tenancy scope: a Tenant is the unit of cryptographic isolation. It is also the natural unit of administrative delegation — different tenants can be administered independently. For details on the technical isolation mechanisms, see Multi-Tenant Isolation Model.
Application
An Application is a business system or functional domain. It defines:
- Business ownership
- Risk classification
- Regulatory scope
- Operational context
Examples: Core Banking, Card Issuance, CRM, Collections, Regulatory Reporting.
Key attributes:
| Attribute | Description |
|---|---|
| Application identifier | UUID |
| Display name | Human-readable name |
| Owning tenant | The tenant within which this application operates |
| Business unit | Organizational owner (Treasury, Digital Division, Risk) |
| Cost center | Financial accountability tag |
| Risk level | CRITICAL, HIGH, MEDIUM, LOW |
| Regulatory scope | Regulations applicable (SOX, PCI-DSS, GDPR, AML, eIDAS 2) |
| Data classification | RESTRICTED, CONFIDENTIAL, INTERNAL, PUBLIC |
| Application type | INTERNAL, EXTERNAL, HYBRID |
Important distinction: Applications are not technical identities. They do not authenticate, do not hold credentials, and do not invoke operations directly. They are the business container under which technical actors operate. The technical identity is the Cryptographic Actor.
Application status is a runtime control over its actors. While an Application never authenticates itself, its status is a runtime governance lever, not mere metadata. Effective status is the logical AND over the containment chain tenant ∧ application ∧ actor (within an ACTIVE deployment): an actor may authenticate and operate only when its owning tenant, its owning application, AND the actor itself are all ACTIVE. Suspending an Application therefore immediately blocks every actor it contains — their M2M authentication is denied at token issuance (reason APPLICATION_NOT_ACTIVE), and any already-issued, still-valid JWT is denied at the Core API crypto seam and on scope-gated metadata reads (listKeys / viewKeyMetadata) with reason application-suspended.
Application status follows the same reversible/terminal distinction as the actor (below):
- SUSPENDED — reversible; the application (and therefore its actors) returns to service on reactivation. Suspension is a status flag on the application alone — it rewrites no child entity. The contained actors, grants, exchange contexts, exchanges, and keys are left untouched; effective status is re-composed by the AND over the containment chain at read time, and reactivation restores service instantly because nothing below was mutated.
- DISABLED — terminal; a DISABLED application cannot be reactivated. DISABLE does not revoke the actors' credentials (credential revocation is a separate, explicit lifecycle act).
DELETE is a terminal, irreversible cascade (distinct from SUSPEND). Where SUSPEND rewrites no child, deleting an Application (DELETE /api/v3/admin/tenants/{tenantId}/applications/{applicationId}, HTTP 204) drives every entity the application contains to its terminal state in a single best-effort cascade. There is no refuse-if-dependents guard: the presence of active Actors, Exchange Contexts, Cryptographic Exchanges, or Internal Crypto Use Cases does not block the delete. The cascade runs in dependency order:
- Resolve the application's owned key identifiers (KIDs) first.
- Revoke the application's Internal Crypto Use Cases.
- Revoke the associated Capability Grants.
- Close the Exchange Contexts.
- Revoke the Cryptographic Exchanges (status
REVOKED, soft-deleted). - Disable the Cryptographic Actors — including the application's non-deletable Default Actor, which is cascade-disabled here (its
isDefaultflag does not block the cascade). - Archive the application's non-shared keys.
Nothing is physically destroyed. The application's keys move to ARCHIVED — their material is retained, never destroyed. A key that is shared with another still-active aggregate is not archived; it keeps its real current lifecycle status. Each key is retired according to its current status and is never revoked twice: an active or expired key is revoked for ADMINISTRATIVE and archived; a suspended key is revoked and archived — for SECURITY_COMPROMISE when that is its suspension cause, so a key held for a security compromise stays sealed, and for ADMINISTRATIVE otherwise; a revoked key is archived keeping its cause; an archived or pending_destruction key is left as it is. After the cascade, the retired application and its terminal children are removed from the active listings but remain inspectable through a read-only retired-applications surface (see the admin-api endpoints documentation). The terminal DELETE cascade is what makes the application.deleted propagation on the Cryptographic Actor and Cryptographic Exchange reachable — SUSPEND never reaches it.
Operational identity entities
Cryptographic Actor
A Cryptographic Actor is the operational subject that executes or requests cryptographic operations. It represents:
- An internal API service
- A batch processing job
- An integration channel
- A third party (for example, a card embossing vendor)
- A BPO processing system
Each Cryptographic Actor belongs to an Application, operates under defined constraints, and is the primary subject of authorization. Authorization decisions, audit events, and rate-limit enforcement are anchored on the actor.
Actors are the unit of trust at runtime. The model treats internal services and external parties uniformly: both are actors with clearly delimited capabilities.
Key attributes:
| Attribute | Description |
|---|---|
| Actor identifier | UUID |
| Owning application | The Application this actor operates within |
| Actor type | One of six: INTERNAL, PARTNER, SERVICE, THIRD_PARTY, REGULATORY, RAPIDAPI |
| Status | One of three: ACTIVE, SUSPENDED, DISABLED |
| Display name | Human-readable name (visa-embossing-actor, fraud-detection-service) |
The six actor types, which are the complete persisted set:
| Type | Means |
|---|---|
INTERNAL | Organization-owned service or process |
PARTNER | Allied organization with a trust relationship (embedded partner) |
SERVICE | Automated batch, scheduled job, or background processor |
THIRD_PARTY | External vendor integrating via published interfaces |
REGULATORY | Auditor or regulator; typically verify-only capability grants |
RAPIDAPI | Marketplace user auto-provisioned by the RapidAPI bridge; plan tier is carried by the attached Constraint Policy, not by a separate actor attribute |
Actor lifecycle: an actor is created when an integration is established, suspended when it is paused (without losing its authorizations), and disabled when the integration is terminated. Suspending the actor immediately blocks all of its grants without deleting them; reactivation restores the previous state. There is no REVOKED actor state — termination is DISABLED, and it is terminal.
Actor status is a runtime control (effective-status containment). The actor is the lowest leg of the effective-status containment chain tenant ∧ application ∧ actor (within an ACTIVE deployment). Suspending the actor — independently of its application's status — makes it effectively non-ACTIVE, which blocks:
- M2M authentication — the
client_credentialsgrant is denied at token issuance (reasonACTOR_NOT_ACTIVE). - Cryptographic operations — an already-issued, still-valid JWT is denied at the Core API crypto seam.
- Scope-gated metadata reads —
listKeys/viewKeyMetadataare denied at the seam with reasonactor-suspended(a status denial, neverNO_GRANT). - The interoperability and migration planes —
interoperability.encrypt,interoperability.verifySignature,migration.convertPkcs7andmigration.analyzePkcs7are denied at the same seam, across six handlers: each PKCS#7 operation carries a streaming twin on the same scope. The interoperability operations andmigration.analyzePkcs7use no tenant key and take no Capability Grant decision, so for them the containment check is the only thing that closes them. A PKCS#7 → JOSE conversion (migration.convertPkcs7, buffered and streaming) does use tenant keys: after the containment check it also takes a Capability Grant decision per leg —REENCRYPTfrom the opening recipient to every recipient (its own pair included) andRESIGNfrom every signer to itself — so a suspended actor is refused before any grant is charged.
The two control states are:
- SUSPENDED — reversible. The actor pauses without losing its grants or credentials; reactivation restores its effective status.
- DISABLED — terminal. A DISABLED actor cannot be reactivated (suspend/reactivate of a DISABLED actor returns HTTP 422). DISABLE does not revoke the actor's credentials — credential revocation is a separate, explicit lifecycle act.
The control is enforced at two points (defense-in-depth): the admin-api token-issuance gate (which denies the grant unless the whole containment chain is ACTIVE) and the core-api crypto seam (a fail-closed resolver that re-checks the live effective status on every operation and scope-gated read, so a JWT minted while the actor was ACTIVE stops working the moment the actor is suspended).
Default Actor and cascade-disable on application.deleted. Each Application auto-provisions a non-deletable Default Actor (isDefault = true) that cannot be deleted independently — an attempt to delete it on its own is refused. When its owning Application is terminally deleted, however, the Default Actor — like every other actor the application contains — is cascade-disabled as one step of the application's DELETE cascade; isDefault does not exempt it. This is the distinction the cascade resolves: the disable happens because the parent Application is being terminally deleted, not as an independent actor delete. See Application for the full ordered cascade.
Credential
A Credential is the authentication mechanism associated with a Cryptographic Actor. The platform persists three kinds, recorded on actor_credentials.kind:
CLIENT_SECRET— an OAuth 2.0client_credentialspair: aclient_idand a secret held only as a hash. The plaintext is returned once, at issuance or rotation, and never again.PRIVATE_KEY_JWT— a registered public key (JWK). The actor proves possession of the private half by signing a client assertion; the platform stores no secret at all.FEDERATED_JWT— the actor is bound to an external issuer and subject, and authenticates with a token that issuer minted. Federated identity therefore applies to Cryptographic Actors as well as to human users.
A Cryptographic Actor may hold multiple credentials simultaneously (for credential rotation), and credentials have independent lifecycle management. The separation between actor and credential allows secret rotation without altering authorization grants.
Key attributes:
| Attribute | Description |
|---|---|
| Credential identifier | UUID |
| Owning actor | The actor this credential authenticates |
| Mechanism | One of CLIENT_SECRET (a client_id + hashed secret pair), PRIVATE_KEY_JWT (a registered public JWK, no stored secret) or FEDERATED_JWT (a binding to an external issuer and subject). Actor-level mTLS is not implemented |
| Status | One of three: ACTIVE, ROTATING_OUT, REVOKED |
| Version | Monotonic counter, incremented on each rotation |
| Valid from / valid until | Validity window |
| Revoke at | Timestamp at which a ROTATING_OUT credential transitions to REVOKED (set by the rotation grace-window logic; null for ACTIVE and REVOKED rows) |
Credential rotation pattern: an actor can hold an ACTIVE credential alongside a ROTATING_OUT one during a rotation window. The new credential is issued and tested in parallel with the old one, which keeps authenticating until its revoke_at elapses. No grant changes are required.
Disabling the actor does not revoke its credentials. The two are independent lifecycle acts, which is exactly why a deprovisioning cascade revokes the credential explicitly rather than relying on the actor transition to do it.
ROTATING_OUT intermediate state: when a rotate operation specifies a positive graceWindowHours (default 24h, max 720h), the previous credential transitions from ACTIVE to ROTATING_OUT with revoke_at = now + graceWindowHours. A ROTATING_OUT credential continues to authenticate until revoke_at elapses — this is the entire point of the grace window. A scheduled finalization task in ankasecure-admin-api sweeps ROTATING_OUT rows on a fixed cadence (default 60s) and transitions them to REVOKED when their revoke_at is in the past. When the rotate operation specifies graceWindowHours = 0 (INLINE hard cutover), the previous credential transitions directly to REVOKED in the same transaction as the new credential's INSERT — no ROTATING_OUT row is ever observable by a concurrent reader.
Governed exchange entity
Exchange Context
An Exchange Context is a governed interaction scenario involving cryptographic operations. It models:
- The relationship between parties
- The purpose of the exchange
- The direction of data flow
- The trust model
Examples:
- Card Embossing — VISA
- Card Embossing — AMEX
- Collections Processing — BPO Alpha
- Regulatory Reporting — Central Bank
- Internal Analytics Pipeline
Key attributes:
| Attribute | Description |
|---|---|
| Context identifier | UUID |
| Owning application | The Application that owns the exchange |
| Counterparty | The external or internal party involved |
| Direction | OUTBOUND, INBOUND, BIDIRECTIONAL, INTERNAL |
| Business purpose | The reason the exchange exists |
| Sensitivity level | PUBLIC, INTERNAL, RESTRICTED, CONFIDENTIAL |
| Status | One of four: PENDING_ACTIVATION, ACTIVE, SUSPENDED, CLOSED |
| Effective from | Start of validity |
| Effective until | End of validity (optional) |
Why this entity exists: the Exchange Context distinguishes ANKASecure© from a traditional KMS. By modeling the business interaction explicitly, authorization decisions can reflect not only who is acting and what they are doing, but the governed business relationship in which the action takes place.
The four states:
| Status | Means |
|---|---|
PENDING_ACTIVATION | Composed but not yet in force; no grant scoped to it authorizes |
ACTIVE | In force |
SUSPENDED | Every capability grant scoped to this context is denied. No token is blacklisted: suspension writes the new status, publishes it and updates the authorization projection, so an already-issued token keeps authenticating and is refused at the capability decision — a fail-closed re-resolution, not a token revocation. Reversible |
CLOSED | Permanent, non-reversible termination |
The terminal state is CLOSED. Earlier revisions of this page called it TERMINATED; no such value exists, and PENDING_ACTIVATION was missing entirely.
Lifecycle implication: when a third-party relationship is renegotiated or terminated, the cryptographic implications propagate through the affected Exchange Context. Suspending or closing a context affects every grant scoped to it — without requiring per-grant inspection.
Cryptographic resource entities
Cryptographic Asset
A Cryptographic Asset is managed cryptographic material. Types include:
| Type | Examples |
|---|---|
| Symmetric keys | AES (128, 192, 256), ChaCha20, Camellia |
| Asymmetric key pairs | RSA, EC (P-256, P-384, P-521) |
| Post-quantum keys | ML-KEM-512/768/1024, ML-DSA-44/65/87, SLH-DSA, Falcon |
| Hybrid keys | Composite PQC + classical pairs |
| Verification keys | Public material derived from private keys |
| Wrapping keys | KEKs used to protect other assets |
Each asset belongs to a Tenant, is governed by policy, and follows a lifecycle that is two-dimensional: a stable alias (the KID identity) and the material versions underneath it each carry their own status, and what the API publishes as the key's status is a projection of the pair. The nine published tokens and how they are produced are set out in Asset lifecycle below.
Key attributes:
| Attribute | Description |
|---|---|
| KID (Key Identifier) | Stable human-readable identifier (payment-signing-key-001) |
| Internal UUID | System-generated unique reference |
| Owning tenant | The tenant that owns this asset |
| Algorithm | The cryptographic algorithm (ML-DSA-87, AES-GCM-256) |
Key type (kty) | One of the twenty-one published key-type tokens — ML-KEM, HQC, FRODO, CMCE, BIKE, SABER, NTRU, NTRUPRIME, SMAUG-T, ML-DSA, SLH-DSA, FALCON, XMSS, LMS, EC, RSA, oct, OKP, SM2, GOST-EC, COMPOSITE. A hybrid asset publishes the single coarse token COMPOSITE |
Composite construction (compositeMode) | For a hybrid asset only — COMPOSITE_KEM_COMBINE or COMPOSITE_SIGNATURE. The construction is a separate axis from the key type; it is never a kty value |
| Permitted operations | The capabilities this asset supports |
| Lifecycle status | The projected status — one of the nine published lower-case tokens. Seven are reachable at the kid level; see Asset lifecycle |
| Created at | Timestamp |
| Expires at | Timestamp (if time-limited) |
| Usage count | Cumulative operation counter |
| Max usage limit | Hard limit (optional) |
| Origin | GENERATED, IMPORTED — always stated on every material; a version created by rotation is GENERATED |
| Exportable | Boolean, always stated on every material (typically false in production); a rotation keeps the key's current value unless it names a new one |
| KEK version | Reference to the wrapping key version |
Asset identification: assets are referenced by stable KID. The runtime resolves the appropriate version based on policy, lifecycle state, and operation type. This is the foundation of the KID system.
Asset lifecycle — two dimensions, one projection
An asset is not a row with a status column. It is a stable alias plus the material versions recorded under it, and each dimension has its own state machine. Rotation advances the material while the alias — and therefore the KID every grant and every ciphertext refers to — stays constant. That is the whole point of the KID system, and it is why a flat single-status reading of a key is wrong.
Dimension 1 — the alias (the KID identity). Four states:
(creation) -> ACTIVE
ACTIVE -> SUSPENDED (incident investigation)
SUSPENDED -> ACTIVE (incident cleared)
ACTIVE -> RETIRED (decommission or revoke)
SUSPENDED -> RETIRED (compromise confirmed)
RETIRED -> DELETED_LOGICAL (retention elapsed + operator delete)
Dimension 2 — each material version. Six states, with at most one PRIMARY per alias at any time:
PENDING_PRIMARY -> PRIMARY (atomic rotation activation)
PENDING_PRIMARY -> DESTROYED (operator cancels the rotation)
PRIMARY -> RETIRED (a rotation supersedes it)
PRIMARY -> REVOKED (alias revoke cascade)
RETIRED -> REVOKED (operator revokes this material)
RETIRED | REVOKED -> PENDING_DESTRUCTION (approval of a destruction request)
PENDING_DESTRUCTION -> RETIRED | REVOKED (cancel-destruction restores the prior state)
PENDING_DESTRUCTION -> DESTROYED (cooling-off elapsed, the platform's destruction executor)
The projection. The published key status is computed from the alias and its representative material — the current PRIMARY when the key has one, otherwise (a revoked, archived or pending-destruction key) a deterministic representative of its non-destroyed versions, preferring a PENDING_DESTRUCTION version and then the highest version number. The key list, the single-key read and the lifecycle guards all use this one rule, so they never disagree on a key's status. It is evaluated strictly in this order:
| # | Condition | Projects |
|---|---|---|
| 1 | alias DELETED_LOGICAL | deleted_logical |
| 2 | alias SUSPENDED | suspended |
| 3 | alias RETIRED, material PENDING_DESTRUCTION | pending_destruction |
| 4 | alias RETIRED, archived_at not set | revoked |
| 5 | alias RETIRED, archived_at set | archived |
| 6 | alias ACTIVE, material PENDING_DESTRUCTION | pending_destruction |
| 7 | alias ACTIVE, material REVOKED | revoked |
| 8 | alias ACTIVE, material past its expiresAt | expired |
| 9 | alias ACTIVE, otherwise | active |
Two consequences of the table that a flat list conceals:
archivedis not a persisted status. It is a derived label: an alias inRETIREDwhosearchived_atis set. Archiving is the act of recordingarchived_at/archived_by— which is why archiving is only reachable fromrevoked, and whyarchivedandrevokedare the same alias state distinguished solely by that timestamp. Both carry the revocation cause: aRETIREDalias always has one, and archiving keeps it.pending_rotationandrotatedare never emitted at the kid level. They belong to the material dimension, where the corresponding states arePENDING_PRIMARYandRETIRED. The projection above has no branch that can produce either token for a key, so no client should switch on them.
Archiving is not data-denying — the cause is. Archive keeps the cause the key was revoked for: under the default lifecycle policy an archived key revoked for any cause other than SECURITY_COMPROMISE still permits decrypt and verify, while one revoked for SECURITY_COMPROMISE stays sealed on every plane; what archiving itself stops permitting is encrypt and sign. This is the same semantics AWS, GCP and Azure KMS apply to a disabled or retired key, and it is what makes a decrypt-only authorization over an archived key a legitimate data-recovery shape rather than a misconfiguration.
The destruction chain and its cooling-off gate
Destroying key material is a deliberate, multi-step, temporally gated cycle. It is never a side effect of another action, and no administrative action on an authorization construct — deleting a grant, revoking a use case, deleting an Application — enters this chain at any point.
stateDiagram-v2
[*] --> active
active --> revoked: POST /revoke (cause recorded)
revoked --> archived: POST /archive (cause kept, archivedAt set)
archived --> pending_destruction: POST /mark-for-destruction<br/>(sets destructionEligibleFrom = now + coolingOffDays)
pending_destruction --> archived: POST /cancel-destruction
pending_destruction --> deleted_logical: DELETE<br/>(only after destructionEligibleFrom)
deleted_logical --> [*] Each transition is guarded, and the guards are the point:
| Step | Precondition | Effect |
|---|---|---|
revoke | projected status is active, expired or suspended — refused 409 from revoked, archived and pending_destruction (Key already revoked: <kid> is <status>.), and from a key suspended for SECURITY_COMPROMISE when the revoke names another cause; a destroyed key is not found (404) by the live-key lookup | Alias RETIRED with a revocation cause; non-destroyed materials REVOKED with that cause, except a version already revoked for SECURITY_COMPROMISE, which keeps its cause and reason |
archive | projected status is revoked | archived_at / archived_by recorded on the alias, which keeps its revocation cause; the other material causes are cleared and those materials move to RETIRED, except a version revoked for SECURITY_COMPROMISE, which stays REVOKED with its cause and reason so it keeps refusing decrypt and verify — the key now projects archived |
mark-for-destruction | projected status is archived | Opens a quorum request that a person other than the requester approves; the approval moves every non-destroyed material to PENDING_DESTRUCTION and schedules a destruction order for the approval plus coolingOffDays (7–365; the tenant lifecycle policy's default, else the deployment's, else 30) |
cancel-destruction | projected status is pending_destruction | Materials revert to their prior status (REVOKED if the material carries a cause, otherwise RETIRED), so a version revoked for SECURITY_COMPROMISE is REVOKED with that cause again; the alias keeps its cause and archived_at, so the key projects archived again |
| destruction (the platform) | the order's cooling-off has ended and its versions are still the approved ones | Materials DESTROYED; alias DELETED_LOGICAL; the Key ID is never reused. An order whose versions changed ends FAILED and destroys nothing |
The cooling-off window is a temporal gate, not advice: no caller can destroy the key, and the platform destroys it only once the window has ended. The window exists so that an irreversible act has a period in which it can be reconsidered — which is also where a warning belongs when other constructs still reference the key.
DELETED_LOGICAL is the end of the published lifecycle: the KID cannot be revived, and no authorization may be composed over it. The identity is however retained for audit, and because the uniqueness constraint on a KID applies only to live aliases, the same KID may be created again afterwards — a fresh key with a fresh identity that happens to reuse the name.
Purpose projection on import (Origin = IMPORTED): every Asset has a single KeyPurpose (ENCRYPT_DECRYPT or SIGN_VERIFY) — its permitted operations never span both families. When an Asset originates from a legacy JKS/PKCS#12 import, its purpose is derived from the certificate X.509 KeyUsage or declared explicitly; an ambiguous key cannot be imported as a single dual-capable Asset. A genuinely dual-use legacy keypair is projected onto two single-purpose Assets (<kid>-enc and <kid>-sig) over the same key material, each with its own material version. The precedence that decides an alias's purpose is declared on the import request itself, POST /api/v3/admin/tenants/{tenantId}/keys/import-keystore.
Capability
A Capability is a cryptographic function that can be executed. Capabilities abstract the use of cryptographic material into controlled operations.
Standard capabilities:
| Capability | Operation | Typical use |
|---|---|---|
encrypt | Encrypt data with a key | Protecting data at rest or in transit |
decrypt | Decrypt data with a key | Unwrapping protected data |
sign | Produce a digital signature | Authenticating data origin |
verify | Verify a digital signature | Validating data origin |
reencrypt | Decrypt and re-encrypt with the same or different key | Algorithm rotation, KEK rotation |
resign | Verify and re-sign with a different key | Signature rotation |
wrap, unwrap and derive are not grantable
Core API has no corresponding endpoints, so a grant carrying one could authorize nothing; they are not in the persisted vocabulary. The six above are the whole set a grant may carry.
Why capabilities matter: a consumer never receives a key; it requests the execution of a capability and receives the operational result. This abstraction enables crypto-agility — the underlying algorithm or key version can change without affecting consumers.
For the broader principles behind this design, see Policy-Driven Crypto-Agility.
Control entities
Capability Grant
A Capability Grant is the authorization given to a Cryptographic Actor to invoke one or more capabilities under specific conditions. It binds:
- An Actor
- A set of Capabilities — the field is a list, and a grant that authorizes two functions carries both in one record
- One or more Cryptographic Assets
- An Exchange Context (optional or required, depending on the use case)
- Constraints
In practice most grants carry a single capability: an orchestrated use case declaring [ENCRYPT, DECRYPT] emits two grants, one carrying ["ENCRYPT"] and one carrying ["DECRYPT"], not one grant carrying both. The multi-capability shape is what makes the cross-kid capabilities expressible: REENCRYPT is a first-class capability over a pair of assets — stored in the order given, source-first by convention, though that order is a recording convention rather than a control — and it does not decompose into, or imply, a standalone DECRYPT on the source key.
A Capability Grant answers four questions in a single record:
- Who can act? — the Actor
- What can they do? — the Capability
- On what assets? — the Cryptographic Assets
- Under what conditions? — the Constraints, scoped to an Exchange Context
Key attributes:
| Attribute | Description |
|---|---|
| Grant identifier | UUID |
| Subject actor | The Cryptographic Actor receiving the authorization |
| Capabilities | An array of the functions this grant authorizes — persisted as a list, not a single value. Most grants carry exactly one |
| Target assets | One or more Cryptographic Assets, by stable KID |
| Exchange Context | The business context this grant is scoped to (optional or required) |
| Constraint Policy | The restrictions applied to this grant: the policy and the version of it the grant pinned when it was issued (constraintPolicyVersion), whose limits the grant enforces for its whole life (constraintSnapshot) |
| Status | None — a Capability Grant carries no status column. A live row is the authorization; revocation is a soft delete (deleted_at), after which the grant authorizes nothing. Suspension and expiry are properties of the Cryptographic Exchange or the Constraint Policy the grant is scoped to, never of the grant row |
| Consumption | Present only when the grant was used up: when its single use was taken or its maxUsage reached (consumedAt, useCount, cause = REVOKED_ON_USE or MAX_USAGE). There is no live use count before that: the count is held by core-api's ledger, and admin-api learns it only from the consumption. A consumed grant is retired and authorizes nothing more, and is still readable by its id (getCapabilityGrant returns it with its consumption; a revoked or expired grant reads 404). Its owning Exchange reads CONSUMED |
| Issued at | Timestamp |
| Issued by | Identity of the granting principal |
Why this is the unit of authorization: revoking a grant removes the actor's ability to invoke the capability without affecting other grants or other actors, and it also removes the operation scope the grant derived into that actor's tokens — no role row is written, so nothing has to be unwound. Removal is bounded rather than instant: up to the 900 s access-token lifetime, plus up to 300 s of enforcement-plane grant cache. The grant is the smallest unit of fine-grained governance.
Constraint Policy
A Constraint Policy expresses restrictions on how a capability can be used. It is a named, reusable tenant-level entity with four enforced dimensions, not a typed parametric object — a single policy row carries all four fields, and any subset of them may be left unset.
| Dimension | Fields | Effect |
|---|---|---|
| Time window | validFrom, validUntil | The grant authorizes only within the period |
| Maximum usage | maxUsage | The capability may be invoked at most N times in total. The count is kept per grant, durably, by the service that enforces the capability (core-api's consumption ledger in PostgreSQL), and is never stored on the policy — one policy governing several grants gives each grant its own count. Every invocation the grant admits is charged, even if the operation then fails or a later gate refuses it; an invocation refused by a constraint is charged nothing. The use that reaches N consumes the grant |
| Rate limit | rateLimitPerMinute | Maximum operations per grant per calendar minute (a fixed one-minute window, so approximate: a burst across a minute boundary can briefly reach twice the rate) |
| Single use | revokeOnUse | The first invocation the grant admits consumes it, whether or not the operation succeeds, and the grant can never be used again. The consumption is recorded durably at the enforcement point (core-api's ledger, in PostgreSQL) and then reflected on the grant, which is retired with its consumption, and on its Exchange, which becomes CONSUMED. Single use authorizes one operation, not one message — to let a counterparty decrypt N messages once each, issue N single-use grants (or one per batch request) |
Key attributes:
| Attribute | Description |
|---|---|
| Constraint identifier | UUID |
| Version | The policy's current version: create writes version 1 and every edit writes the next one as an immutable record |
| Owning tenant | The tenant this policy belongs to |
| Name, description | Human-readable identity; the policy is referenced by name and is reusable |
| Time window | validFrom / validUntil (both optional) |
| Usage cap | maxUsage (optional). The policy carries the cap only; the count against it is kept per grant at enforcement time and is not a member of the policy |
| Rate limit | rateLimitPerMinute (optional) |
| Single use | revokeOnUse (boolean, default false) — see the note above on what "single use" does and does not do to the grant |
Four dimensions — and only four
Earlier revisions of this page described a typed, parametric constraint model with BATCH_SCOPE, CONTEXT_REQUIREMENT (source IP ranges, required headers, mTLS client certificates) and AUTO_REVOKE (behavioral revocation on anomaly signals). None of those is implemented, and none is enforced anywhere in the platform. Documenting them stated a security control that does not exist, which is worse than documenting nothing: an operator could have relied on it in a compliance assessment. The four dimensions in the table above are the complete set the control plane evaluates.
A policy is a template; a grant enforces a version of it. Every write of a Constraint Policy is an immutable version. A grant pins the version current when it is issued — an Exchange's grant at activation, a standalone grant at creation, a use case's grants when it is provisioned — and enforces that version's limits for its whole life. Editing the policy therefore changes only grants issued afterwards: an active grant keeps the limits it was issued under, and a consumed single-use grant stays consumed even if revokeOnUse is then unticked. To change an active grant's limits, issue a new grant (clone and activate its Exchange; revoke and re-create a standalone grant). The crypto audit row of every grant decision names the pinned pair (constraintPolicyId, constraintPolicyVersion).
Composability: the four dimensions compose by conjunction — all populated ones must be satisfied for the grant to authorize. A grant may be simultaneously time-windowed (valid within a stated period), usage-capped (at most 50,000 invocations) and rate-limited (at most 500 per minute). A Constraint Policy is a tenant-level entity referenced by grants; the relationship is N:1, so one policy may govern several grants.
Policy
A Policy is a global or scoped rule that governs platform behavior. Policies exist at multiple levels:
- Deployment — regulatory region, allowed algorithms, FIPS posture
- Tenant — tenant-specific algorithm catalog, lifecycle defaults
- Exchange Context — rules specific to a business interaction
- Cryptographic Asset — rotation cadence, usage limits, exportability
- Capability — invocation rules, audit requirements
What policies define:
| Policy domain | Examples |
|---|---|
| Algorithm availability | Allowed algorithms and their security levels |
| Lifecycle rules | Rotation, expiration, archival cadence |
| Compliance constraints | FIPS, eIDAS 2, BSI, ANSSI, ETSI alignment |
| Crypto-agility rules | PQC enforcement, hybrid requirements, downgrade prevention |
| Security enforcement | Mandatory wrapping, key origin, attestation requirements |
Key attributes:
| Attribute | Description |
|---|---|
| Policy identifier | UUID |
| Scope | DEPLOYMENT, TENANT, EXCHANGE_CONTEXT, ASSET, CAPABILITY |
| Domain | ALGORITHM, LIFECYCLE, COMPLIANCE, AGILITY, SECURITY |
| Definition | Rule expression (algorithm catalog, allowed values, thresholds) |
| Inheritance | Resolution order (deployment baseline → tenant override → context override) |
Policy versus Constraint Policy: Policies govern platform behavior at architectural levels and apply to many grants. Constraint Policies govern individual grants. The two are complementary: a Policy may say "ML-DSA-87 is the required signature algorithm for the Treasury tenant"; a Constraint Policy may say "this specific grant is single-use and expires in 4 hours."
For the broader policy framework, see Policy-Driven Crypto-Agility.
Evidence entity
Audit Event
An Audit Event records every cryptographic operation and every authorization decision. Each event captures the full context of what happened.
Captured fields:
| Field | Content |
|---|---|
| Event identifier | UUID |
| Tenant | Organizational scope. A deployment identifier is not an audit field — the deployment is the installation the trail belongs to, not a value on the row |
| Application, Actor | Operational subject |
| Exchange Context | Business interaction context |
| Capability | Function invoked |
| Cryptographic Asset | Material involved |
| Constraints applied | Active conditions at decision time |
| Outcome | SUCCESS, FAILURE or DENIED (with reason). ALLOW / DENY is the vocabulary of a lifecycle-policy permission cell, a different decision on a different artifact, and is never an audit outcome |
| Timestamp | Decision time |
| Correlation identifier | Request trace ID for cross-service correlation |
| Source IP | Network origin |
| Request metadata | Additional contextual headers |
Integrity: audit events are HMAC-SHA256-signed at production time over the whole event envelope (metadata canonical fields plus the payload type's own canonical field list) and stored in an isolated audit data store. Tampering is detectable; events are immutable once produced.
Both allow and deny: the evidence layer captures the full decision context, not only successful operations. A denied invocation produces an audit record with the reason for denial, supporting forensic analysis and continuous monitoring.
What audit events enable: compliance reporting (DORA, PCI-DSS, SOX, GDPR), incident response, forensic reconstruction, continuous posture monitoring, and detection of anomalous patterns.
Control plane orchestration entities
The 12 entities defined above this section — every entity on this page except the one that follows — form the runtime authorization model. Core API runtime authorization resolves against Capability Grant and never references the orchestration layer described here.
The platform also exposes one control-plane orchestration entity that lives strictly above the runtime model and exists for administrative usability. The runtime model is unaffected by anything in this section.
Cryptographic Exchange
A Cryptographic Exchange is an admin-managed aggregate that groups one Application + one Cryptographic Actor + one Cryptographic Asset (by KID) + one Exchange Context + one Constraint Policy under a single managed lifecycle. It owns its Capability Grant 1:1.
Where the runtime model asks "is this Actor authorized to invoke this Capability on this Asset?", the orchestration model answers a different question for the admin: "what is this whole intercambio I am setting up, and where is it in its lifecycle?". The 7-step manual onboarding sidebar (Applications → Actors → Contexts → Constraint Policies → Capability Grants) is replaced by a single tabbed wizard that materializes one Exchange.
Lifecycle states:
| State | Meaning |
|---|---|
DRAFT | References may be NULL; no Grant exists yet |
READY | All 6 references resolved + cross-validation passed; Grant not created until activate |
ACTIVE | Capability Grant created; runtime authorization in effect |
SUSPENDED | Grant suspended; runtime authorization denies invocations. Reversible |
EXPIRED | Terminal — effective_until passed. Core-api already refuses every request at or after effective_until; the expiry job then records the state, its terminal cause and audit row |
CONSUMED | Terminal — the grant was used up: its single use was taken or its maxUsage reached (terminal cause CONSUMED). Fulfilled authority, not a revocation. Set from core-api's verified consumption fact, from ACTIVE or SUSPENDED |
REVOKED | Terminal — manual revoke, the destruction of the asset key, the deletion of the Application, or tenant closure |
A terminal Exchange (EXPIRED, CONSUMED, REVOKED) cannot be suspended, resumed, edited or re-entered; clone it to issue a new grant, which pins the policy's current version on activation.
Cascade from
application.deleted(end-to-end). When an Application is terminally deleted, each Cryptographic Exchange it references transitions toREVOKEDand is soft-deleted as one step of the application's irreversible DELETE cascade — alongside revoking the application's Internal Crypto Use Cases and Capability Grants, closing its Exchange Contexts, disabling its Cryptographic Actors (including the non-deletable Default Actor), and archiving its non-shared keys (material retained, never destroyed). The cascade is terminal and best-effort; it never refuses on the presence of active dependents. This is the behaviour that makes theapplication.deletedtransition above reachable. See Application for the full ordered cascade.
Key attributes:
| Attribute | Description |
|---|---|
| Exchange identifier | UUID, stable for the lifetime of the aggregate |
| Owning tenant | The tenant that owns this Exchange |
| Name | Display name (e.g., VISA Embossing 2026-04-26) |
| Business purpose | Free-text purpose for the intercambio |
| Counterparty | Derived from the referenced Exchange Context (single source of truth on the Context). Projected on list/detail responses for convenience and remains filterable from the list view; not stored on the aggregator itself. |
| Status | Lifecycle state (table above) |
| Application | The owning Application (reference) |
| Actor | The Cryptographic Actor that will execute the operation (reference) |
| Asset KID | String reference to a Cryptographic Asset by stable Key Identifier |
| Exchange Context | The governance scope (reference) |
| Constraint Policy | The usage restrictions (reference) |
| Owned Grant | The Capability Grant this Exchange composes (1:1, populated on activation) |
| Owner principal | The admin who owns this Exchange |
| Effective from / until | Validity window (optional), half-open: usable from effective_from inclusive until effective_until exclusive. Sent as an RFC 3339 instant with an offset (a value without one is 400), stored and returned in UTC, and enforced by core-api on every request |
| Revocation metadata | revoked_at, revoked_by, revoked_reason populated on terminal transitions (revoked_by is system:scheduler for an expiry and system:consumption for a consumption) |
| Last triggering event id | Forensic correlation when a transition was driven by a cascade |
| Cloned from exchange id | Provenance pointer for clones |
| Tags | Free-form tag array |
| Notes | Free-text operator notes |
| Version | JPA optimistic-locking discriminator (carry into PATCH/transition request bodies) |
Composition vs reference (key invariant):
- Composes (1:1, owned): the Capability Grant. The 1:1 invariant is enforced at the database layer via a
UNIQUEconstraint ongrant_id. Two Exchanges cannot share a Grant. - References (N:1): Application, Actor, Asset (by KID), Exchange Context, Constraint Policy. These remain reusable across multiple Exchanges. The same Actor can participate in many exchanges.
Why this entity exists: the orchestration layer collapses the admin's mental model from "5 separate entities I have to wire correctly" into "one Exchange I am setting up". Activate / Suspend / Resume / Revoke act on the Exchange and propagate atomically to the underlying Grant. The runtime authorization path (Core API) does not change — it still resolves against the Grant. The orchestration is purely an admin usability layer.
API: the Cryptographic Exchange is exposed by ankasecure-admin-api under /api/v3/admin/exchanges. See Exchange Management for the full surface (list, detail, create, PATCH, validate, activate, suspend, resume, revoke, clone), including the mandatory operator justification that suspend and revoke require.
Quick reference table
| Entity | Layer | Cardinality |
|---|---|---|
| Deployment | Organizational | One per installation |
| Tenant | Organizational | Many per deployment |
| Application | Organizational | Many per tenant |
| Cryptographic Actor | Operational identity | Many per application |
| Credential | Operational identity | Many per actor (rotation) |
| Exchange Context | Governed exchange | Many per application |
| Cryptographic Asset | Cryptographic resource | Many per tenant |
| Capability | Cryptographic resource | Standard set, platform-defined |
| Capability Grant | Control | Many per actor |
| Constraint Policy | Control | Tenant-level and reusable; referenced by many grants (N:1) |
| Policy | Control | Scoped at multiple levels |
| Audit Event | Evidence | One per operation/decision |
| Cryptographic Exchange | Control plane orchestration | Many per tenant; composes Grant 1:1; references Actor/Asset/Context/Policy N:1 |
Next steps
- For relationships between these entities and the runtime decision flow, see Relationships and runtime flow.
- For worked examples that show these entities composed in real scenarios, see Reference scenarios.
- For the broader architectural context, return to Deployment organization model — Overview.