Before You Integrate: Control-Plane Prerequisites
SDK Version: 3.4.0 Audience: Integration developers wiring the SDK into an application
The AnkaSecure SDK is a data-plane client. It performs cryptographic operations — encrypt, decrypt, sign, verify, re-encrypt, re-sign, PKCS#7/JOSE interop — on objects that already exist. It does not create tenants, applications, actors, keys, or authorization grants. Every object the SDK touches must first be provisioned in the control plane: by people in the Admin Console, or, for keys and grants, by an administrative workload through the Key Management SDK or CLI.
If you call authenticateApplication(...) or encrypt(...) before the underlying tenant, credentials, keys, and capability grants exist, the call fails at the server — not because of an SDK bug, but because there is nothing to operate on yet. This page lists exactly what must exist first, and the control-plane tool that creates each piece.
1. The Two Planes
AnkaSecure separates provisioning from operation. This is the single most important thing to understand before integrating.
| Plane | Purpose | Tools | Typical operator |
|---|---|---|---|
| Control plane | Provision and govern: tenants, applications/credentials, actors, roles, keys, capability grants, policies | Admin Console (UI); for keys and grants also the Key Management SDK (Java library) and the Key Management CLI (ankasecure-km) | Platform admin, tenant admin, an administrative workload |
| Data plane | Execute cryptographic operations on already-provisioned objects | AnkaSecure SDK, ankasecure-crypto CLI | Integrating application, service account |
Programmatic key management + the two-credential model
A third-party product (for example an MFT) can manage its keys and grants programmatically with the Key Management SDK, as an administrative workload of the tenant. In that model the product holds two credentials — the workload's key, which drives the Key Management SDK (create keys, rotate them, grant actors capabilities on them), and a runtime actor credential that drives this data-plane SDK for cryptography. The tenant administrator creates the runtime actor and issues its credential in the Admin Console once.
The SDK lives entirely in the data plane. Its read-only key access (listKeys, listAllKeys, getKeyMetadata, getSupportedAlgorithms) lets you discover what has been provisioned, but it can never create or modify a key.
The SDK has no key-lifecycle write operations
The SDK exposes no key-lifecycle write methods — no key creation, import, rotation, revocation, or destruction. Those are control-plane actions, performed in the Admin Console or through the Key Management SDK or CLI. The SDK's only key methods are read-only.
2. What Must Exist Before Your First SDK Call
Provision these in order. Each step names the Admin Console path and, where an administrative workload can do it, the equivalent ankasecure-km command.
2.1 Tenant
The isolation boundary that owns every other object. Provisioned and activated by a platform administrator in the Admin Console (see Tenant Management*).
2.2 Application, and the Actor that holds the credential
An application groups the identities your integration uses; it holds no credential of its own and cannot authenticate. The principal your SDK authenticates as is a Cryptographic Actor belonging to that application: the actor is what carries a credential, and the client_id you pass to authenticateApplication(clientId, clientSecret) is the actor's identifier, not the application's.
Create the application first, then issue a credential to one of its actors — that issuance is what returns the secret, once. Both are done by the tenant administrator in the Admin Console (Application Management*); the Admin API POST /api/v3/admin/tenants/{tenantId}/actors/{actorId}/credentials mints the actor's client_secret and returns it once.
2.3 Actor (machine principal) and roles
An actor is the cryptographic principal that holds authorization. Role assignments determine which API scopes the principal carries, which in turn gate the operations it can request.
The tenant administrator creates the actor and assigns its roles in the Admin Console, as part of the organization model alongside Key Management*; see the Cryptographic Actor entity for the model.
2.4 Keys (Cryptographic Assets)
The SDK operates on keys by their kid. You either create a fresh key or import an existing keystore.
-
Create —
- Admin Console: Key Management*.
-
Key Management CLI:
-
Import a legacy keystore (JKS / PKCS#12) —
- Admin Console: the Import Keystore tab of Key Management*. Import produces one
kidper keystore alias as<prefix><alias>(the UI concatenates the prefix and the alias verbatim — a trailing-in the prefix yields a double dash, e.g. prefixpkcs7+ aliascifrado→pkcs7-cifrado). Where an alias'sKeyUsageis ambiguous you must pick its purpose explicitly (ENCRYPT_DECRYPTorSIGN_VERIFY), otherwise the import returns422 purpose-required. - Key Management CLI:
ankasecure-km keys import-keystore --keystore-file <path> --metadata-file <json> --password-prompt. - Admin API:
POST /api/v3/admin/tenants/{tenantId}/keys/import-keystore, the same operation the console tab performs.
- Admin Console: the Import Keystore tab of Key Management*. Import produces one
2.5 Capability Grants
A capability grant is the runtime unit of authorization. It binds an Actor + a Capability + one or more Cryptographic Assets (plus an optional Exchange Context and Constraints). Without an ACTIVE grant on the target kid, the actor's operation is refused even if it authenticated successfully. See the Capability Grant entity reference for the authoritative model.
- Admin Console: create a capability grant directly, or drive the exchange wizard, from Key Management*.
-
Key Management CLI: create the grant directly, or drive the exchange lifecycle — reaching the
ACTIVEstate materializes the capability grant (1:1):
3. Operation → Capability Grant Matrix
For each data-plane SDK operation, the actor must hold the listed capability on the target kid. Cross-kid operations need a grant on both keys.
| SDK operation | Required capability grant |
|---|---|
encrypt / encryptFile* | ENCRYPT on the target kid |
decrypt / decryptFile* | DECRYPT on the target kid |
sign / signFile* | SIGN on the target kid |
verifySignature* | VERIFY on the target kid |
reencrypt* | REENCRYPT on both the source and target kid |
resign* | RESIGN on both the source and target kid |
signThenEncrypt* | SIGN on the sign kid and ENCRYPT on the encrypt kid |
decryptThenVerify* | DECRYPT and VERIFY |
analyzePkcs7 / analyzePkcs7Stream | Keyless — no grant required |
convertPkcs7ToJose* / performMigrationWorkflow | REENCRYPT from the recipient that opens the content (the decryptionKid when given) to every recipient, its own pair included, and RESIGN from every signer's key to itself. A REENCRYPT or RESIGN grant is requested with exactly two assetKids: N recipients need N-1 pair grants [opener, recipient], a single recipient the in-place grant requested as assetKids: [kid, kid] (stored as [kid]), each signer RESIGN [signer, signer]; there is no wildcard REENCRYPT or RESIGN grant. DECRYPT, ENCRYPT and SIGN grants authorize no conversion |
listKeys / listAllKeys / getKeyMetadata / getSupportedAlgorithms | Read-only — no capability grant |
The full capability enum is ENCRYPT, DECRYPT, SIGN, VERIFY, REENCRYPT, RESIGN, WRAP, UNWRAP, DERIVE.
4. Zero to First Operation (End-to-End)
A complete walkthrough that crosses both planes, from an empty platform to a working encrypt call.
-
Provision and activate the tenant (platform administrator, Admin Console).
-
Create the application and the actor, assign its role and issue its credential (tenant administrator, Admin Console). The credential issuance returns the
client_secretonce; the actor UUID is theclient_id. -
Prepare an administrative workload for automation, if the keys and grants are managed by a program (Key Management SDK — Prerequisites).
-
Create or import the key. Either create a fresh key:
ankasecure-km keys create \ --kid payments-encryption-key \ --kty ML-KEM --algorithm ML-KEM-768 \ --purpose ENCRYPT_DECRYPT…or import a legacy keystore through the Admin Console Import Keystore tab or
ankasecure-km keys import-keystore. For example, importing an aliascifradounder prefixpkcs7yields the kidpkcs7-cifrado; resolve each alias's purpose (pickENCRYPT_DECRYPT/SIGN_VERIFYwhenKeyUsageis ambiguous, or the import returns422 purpose-required). That kid is then usable as the recipient for PKCS#7 conversion. -
Grant the actor the needed capabilities on the key (Admin Console grant or exchange wizard, or
ankasecure-km capability-grants create/ theankasecure-km exchangeslifecycle). -
Configure the SDK with the host, port, and the actor credentials from step 2 (see SDK and example configuration).
-
Authenticate and operate (data plane):
Only step 7 is the SDK's job. Steps 1-6 are all control-plane.
5. SDK and Example Configuration
The SDK reads a Properties object (typically a cli.properties file). The keys that connect it to a provisioned tenant and its keys:
| Property | Provisioned by | Purpose |
|---|---|---|
openapi.scheme / openapi.host / openapi.port | Deployment | API endpoint the SDK calls |
openapi.insecureSkipTlsVerify | Operator | Skip TLS verification (development only) |
clientId / clientSecret | Credential issuance (Application) | Application credentials for authenticateApplication(...) |
ankasecure.demo.kids | Playground provisioning | Comma-separated list of pre-provisioned kids the example scenarios resolve |
pkcs7.decryptionKid | Keystore import (Keys) | Recipient kid the PKCS#7 → JOSE migration example uses |
pkcs7.decryptionKid is not an SDK setting
The SDK never reads pkcs7.decryptionKid. It is a harness property: the ExampleScenario20 migration example reads it from cli.properties and passes it as the decryptionKid request field of the migration API call. In your own integration, the recipient kid is a per-request parameter you supply to convertPkcs7ToJose* / performMigrationWorkflow — not SDK configuration.
The bundled example scenarios operate on a pre-provisioned demo-cli playground seeded by the ankasecure-demo-provisioning tool. For the example prerequisites (the cli-reference@demo-cli actor, the ankasecure.demo.kids catalogue, and the PKCS#7 fixture), see:
- The shared example prerequisites:
--8<-- "snippets/sdk-examples/_prerequisites.md"is included by every flow page; read it on any flow page such as Flow 1. - The Demo Provisioning Tool* that seeds the playground.
6. Next Steps
- SDK Overview — the data-plane surface and design goals.
- SDK Usage Guide — setup, authentication, and operations.
- Key Management CLI Commands — key and grant management from the command line.
- Deployment Organization Model — actors, assets, capabilities, and grants.