Class EncryptFileResult
invalid reference
co.ankatech.ankasecure.sdk.AnkaSecureSdk#encryptFile()
This class encapsulates the full Compact JWE produced by the Anka Secure platform when encrypting a file. A Compact JWE is represented as five Base64URL-encoded segments separated by dots:
- Protected Header: JSON object containing JWE metadata
such as
alg
(key management algorithm, e.g., hybrid ML-KEM-1024),enc
(content encryption algorithm, e.g., A256GCM), andkid
(key identifier). - Encrypted Key: the Data Encryption Key (DEK) encrypted with the server-selected hybrid algorithm, combining classical (RSA/ECC) and post-quantum (e.g., Kyber) mechanisms for quantum resilience.
- Initialization Vector (IV): random nonce for AEAD.
- Ciphertext: the encrypted file payload.
- Authentication Tag: ensures integrity and authenticity of the payload.
The Protected Header binds the classical key-wrap algorithm and the
post-quantum key encapsulation into one hybrid scheme, ensuring both
forward security and quantum resistance. Because the JWE format already
packages all necessary cryptographic parameters and material, applications
can store or transmit the jweToken
directly, or process it
further with any standards-compliant JWE library.
Persistence Strategy The SDK writes the
Compact JWE verbatim to the outputFile
path provided by the caller, encoded as UTF-8. Because the token already
contains the encrypted key material, IV, ciphertext and authentication tag
(per
RFC 7516), the application can:
- Store the file as-is for later decryption via the SDK, or
- Pass the string to any standards-compliant JWE library for additional processing.
Thread-Safety: Instances are immutable data carriers after construction and may be shared across threads safely.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the effective key identifier used by the server after rotation or successor resolution.Returns the hybrid algorithm negotiated by the server, combining key-encryption and content-encryption.Returns the raw Compact JWE exactly as emitted by the server.Returns the key identifier originally supplied by the client.Returns any warning messages returned by the service.
-
Constructor Details
-
EncryptFileResult
public EncryptFileResult()
-
-
Method Details
-
getJweToken
Returns the raw Compact JWE exactly as emitted by the server.- Returns:
- non-null Compact JWE string
-
getKeyRequested
Returns the key identifier originally supplied by the client.- Returns:
- non-null requested kid
-
getActualKeyUsed
Returns the effective key identifier used by the server after rotation or successor resolution.- Returns:
- non-null effective kid
-
getAlgorithmUsed
Returns the hybrid algorithm negotiated by the server, combining key-encryption and content-encryption.- Returns:
- non-null algorithm identifier
-
getWarnings
-