Class CreateInternalCryptoUseCaseRequest
java.lang.Object
co.ankatech.keymanagement.client.keymanagement.model.CreateInternalCryptoUseCaseRequest
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
comments="Generator version: 7.23.0")
public class CreateInternalCryptoUseCaseRequest
extends Object
Provision an internal crypto use case (Application self-use) as an authorization overlay over keys that ALREADY EXIST. Creates the control-plane entities atomically: Exchange Context (INTERNAL) + Actor (INTERNAL) + Credential + Asset references + Constraint Policy (permissive) + 1..N Capability Grants. It creates NO key: provision keys with POST /api/v3/admin/tenants/{tenantId}/keys and reference them here by kid.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddOperationsItem(String operationsItem) applicationId(UUID applicationId) description(String description) displayName(String displayName) booleanCreate an instance of CreateInternalCryptoUseCaseRequest given an JSON stringApplication that owns this use case.Auditor-readable description of the use case.Human-readable display name (UI label).Stable KID of an EXISTING key in this tenant that the use case authorizes.getName()Tenant-scoped slug for the use case (kebab-case, 1-64 chars).Operations to grant.The keys a CONVERT_PKCS7_TO_JOSE use case converts with.Stable KID of the EXISTING destination key for cross-kid REENCRYPT/RESIGN.Optional validity window for the underlying Constraint Policy.inthashCode()operations(List<String> operations) pkcs7Conversion(Pkcs7Conversion pkcs7Conversion) voidsetApplicationId(UUID applicationId) voidsetDescription(String description) voidsetDisplayName(String displayName) voidvoidvoidsetOperations(List<String> operations) voidsetPkcs7Conversion(Pkcs7Conversion pkcs7Conversion) voidsetTargetKeyKid(String targetKeyKid) voidsetValidityWindow(ValidityWindow validityWindow) targetKeyKid(String targetKeyKid) toJson()Convert an instance of CreateInternalCryptoUseCaseRequest to an JSON stringtoString()static voidvalidateJsonElement(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues foundstatic voidvalidateJsonElementAsCandidate(com.google.gson.JsonElement jsonElement) Validates the JSON Element as a candidate of a oneOf schema: the checks ofvalidateJsonElement(JsonElement), and the element carries no member this model does not declare.validityWindow(ValidityWindow validityWindow)
-
Field Details
-
SERIALIZED_NAME_APPLICATION_ID
- See Also:
-
SERIALIZED_NAME_DESCRIPTION
- See Also:
-
SERIALIZED_NAME_DISPLAY_NAME
- See Also:
-
SERIALIZED_NAME_KEY_KID
- See Also:
-
SERIALIZED_NAME_NAME
- See Also:
-
SERIALIZED_NAME_OPERATIONS
- See Also:
-
SERIALIZED_NAME_PKCS7_CONVERSION
- See Also:
-
SERIALIZED_NAME_TARGET_KEY_KID
- See Also:
-
SERIALIZED_NAME_VALIDITY_WINDOW
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
CreateInternalCryptoUseCaseRequest
public CreateInternalCryptoUseCaseRequest()
-
-
Method Details
-
applicationId
-
getApplicationId
Application that owns this use case. MUST exist in the tenant AND have status=ACTIVE (SUSPENDED/DELETED/PROVISIONING applications → 409).- Returns:
- applicationId
-
setApplicationId
-
description
-
getDescription
Auditor-readable description of the use case.- Returns:
- description
-
setDescription
-
displayName
-
getDisplayName
Human-readable display name (UI label). Defaults to name when omitted.- Returns:
- displayName
-
setDisplayName
-
keyKid
-
getKeyKid
Stable KID of an EXISTING key in this tenant that the use case authorizes. The key is referenced, never created: it must already exist (provision one with POST /api/v3/admin/tenants/{tenantId}/keys), it keeps its own lifecycle, and revoking the use case leaves it untouched. OPTIONAL: omit it when every declared operation is INTEROP_*, ANALYZE_PKCS7 or CONVERT_PKCS7_TO_JOSE — the first two bind no tenant-owned key, and the conversion names its keys in pkcs7Conversion, never here. Declaring a key-bound operation without a kid is refused 422.- Returns:
- keyKid
-
setKeyKid
-
name
-
getName
Tenant-scoped slug for the use case (kebab-case, 1-64 chars). Reusable after the use case is REVOKED (partial unique index excludes soft-deleted rows).- Returns:
- name
-
setName
-
operations
-
addOperationsItem
-
getOperations
Operations to grant. Vocabulary (11 values): ENCRYPT, DECRYPT, SIGN, VERIFY (atomic — require keyKid); REENCRYPT, RESIGN (cross-kid first-class — require keyKid + targetKeyKid); INTEROP_ENCRYPT, INTEROP_VERIFY (caller-supplied keys, no key reference); CONVERT_PKCS7_TO_JOSE (requires pkcs7Conversion, which names the opener, the other recipients and the signers; emits one REENCRYPT grant per recipient leg and one RESIGN grant per signer); ANALYZE_PKCS7 (no key reference); EXPORT_KEY (requires keyKid, emits no grant).- Returns:
- operations
-
setOperations
-
pkcs7Conversion
public CreateInternalCryptoUseCaseRequest pkcs7Conversion(@Nullable Pkcs7Conversion pkcs7Conversion) -
getPkcs7Conversion
The keys a CONVERT_PKCS7_TO_JOSE use case converts with. Required if and only if operations contains CONVERT_PKCS7_TO_JOSE: missing there is 422 key-reference-required, present without that operation is 400 naming it. Every kid names an EXISTING key in this tenant (404 with a fixed detail otherwise) and is referenced, never created. The conversion's grant gate in the cryptographic service asks REENCRYPT over [opener, recipient] for every recipient of the PKCS#7 structure (the opener's own pair included) and RESIGN over [signer, signer] for every signer, so the use case emits exactly those grants: one REENCRYPT [openerKid, recipient] per entry of recipientKids, an in-place REENCRYPT [openerKid] when recipientKids is empty (the opener is the sole recipient), and one RESIGN [signer] per entry of signerKids. A structure naming a recipient or signer this member does not bind is refused at conversion.- Returns:
- pkcs7Conversion
-
setPkcs7Conversion
-
targetKeyKid
-
getTargetKeyKid
Stable KID of the EXISTING destination key for cross-kid REENCRYPT/RESIGN. Required when operations contains REENCRYPT or RESIGN, and forbidden otherwise — both violations are refused 422. The grant binds the PAIR as asset_kids [keyKid, targetKeyKid], written source-first by convention — the order records intent and is not enforced: the runtime matches a grant's asset set with containsAll, a subset test, so the same grant authorizes the reversed pair too. Setting targetKeyKid equal to keyKid is VALID and expresses an in-place migration across material versions of one key. Patent-critical: the REENCRYPT capability authorizes re-encryption over that pair WITHOUT granting standalone DECRYPT.- Returns:
- targetKeyKid
-
setTargetKeyKid
-
validityWindow
-
getValidityWindow
Optional validity window for the underlying Constraint Policy. Defaults: validFrom=now, validUntil=now+1y when omitted (server-side).- Returns:
- validityWindow
-
setValidityWindow
-
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement- JSON Element- Throws:
IOException- if the JSON Element is invalid with respect to CreateInternalCryptoUseCaseRequest
-
validateJsonElementAsCandidate
public static void validateJsonElementAsCandidate(com.google.gson.JsonElement jsonElement) throws IOException Validates the JSON Element as a candidate of a oneOf schema: the checks ofvalidateJsonElement(JsonElement), and the element carries no member this model does not declare. A oneOf schema without a discriminator tells its candidates apart by their member sets, so a candidate is matched on its closed member set.- Parameters:
jsonElement- JSON Element- Throws:
IOException- if the JSON Element is not a CreateInternalCryptoUseCaseRequest
-
fromJson
Create an instance of CreateInternalCryptoUseCaseRequest given an JSON string- Parameters:
jsonString- JSON string- Returns:
- An instance of CreateInternalCryptoUseCaseRequest
- Throws:
IOException- if the JSON string is invalid with respect to CreateInternalCryptoUseCaseRequest
-
toJson
Convert an instance of CreateInternalCryptoUseCaseRequest to an JSON string- Returns:
- JSON string
-