Package co.ankatech.ankasecure.sdk.model
Class SignEncryptResult
java.lang.Object
co.ankatech.ankasecure.sdk.model.SignEncryptResult
Result of a sign-then-encrypt operation.
Contains the nested JWE(JWS) token produced by signing plaintext (creating JWS) then encrypting the JWS (creating JWE). Metadata for both operations is separated to provide transparency about which keys were used at each step.
Token structure: JWE( JWS(plaintext) )
- Since:
- 3.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the key identifier actually used for encryption.Gets the key identifier actually used for signing.Gets the algorithm used for encryption.Gets the key identifier requested for encryption.Gets warnings related to the encryption operation.Gets the nested JWE(JWS) token.Gets the algorithm used for signing.Gets the key identifier requested for signing.Gets warnings related to the signing operation.booleanChecks if there are any warnings (sign or encrypt).booleanChecks if encryption operation produced warnings.booleanChecks if signing operation produced warnings.setActualEncryptKeyUsed(String actualEncryptKeyUsed) Sets the key identifier actually used for encryption.setActualSignKeyUsed(String actualSignKeyUsed) Sets the key identifier actually used for signing.setEncryptAlgorithmUsed(String encryptAlgorithmUsed) Sets the algorithm used for encryption.setEncryptKeyRequested(String encryptKeyRequested) Sets the key identifier requested for encryption.setEncryptWarnings(List<String> encryptWarnings) Sets warnings related to the encryption operation.setJweToken(String jweToken) Sets the nested JWE(JWS) token.setSignAlgorithmUsed(String signAlgorithmUsed) Sets the algorithm used for signing.setSignKeyRequested(String signKeyRequested) Sets the key identifier requested for signing.setSignWarnings(List<String> signWarnings) Sets warnings related to the signing operation.toString()Returns string representation for debugging.
-
Constructor Details
-
SignEncryptResult
public SignEncryptResult()Default constructor initializing empty warning lists.
-
-
Method Details
-
getJweToken
Gets the nested JWE(JWS) token.- Returns:
- compact serialized JWE token containing JWS
-
setJweToken
Sets the nested JWE(JWS) token.- Parameters:
jweToken- the token- Returns:
- this instance for fluent API
-
getSignKeyRequested
Gets the key identifier requested for signing.- Returns:
- requested sign key ID
-
setSignKeyRequested
Sets the key identifier requested for signing.- Parameters:
signKeyRequested- the key ID- Returns:
- this instance for fluent API
-
getActualSignKeyUsed
Gets the key identifier actually used for signing.May differ from requested if key rotation or fallback occurred.
- Returns:
- actual sign key ID used
-
setActualSignKeyUsed
Sets the key identifier actually used for signing.- Parameters:
actualSignKeyUsed- the key ID- Returns:
- this instance for fluent API
-
getSignAlgorithmUsed
Gets the algorithm used for signing.Example: "ML-DSA-87", "ECDSA-P256-SHA256"
- Returns:
- signature algorithm
-
setSignAlgorithmUsed
Sets the algorithm used for signing.- Parameters:
signAlgorithmUsed- the algorithm- Returns:
- this instance for fluent API
-
getSignWarnings
Gets warnings related to the signing operation.Examples: key expiration, key rotation, deprecated algorithm.
- Returns:
- unmodifiable list of sign warnings (never null)
-
setSignWarnings
Sets warnings related to the signing operation.- Parameters:
signWarnings- the warnings- Returns:
- this instance for fluent API
-
getEncryptKeyRequested
Gets the key identifier requested for encryption.- Returns:
- requested encrypt key ID
-
setEncryptKeyRequested
Sets the key identifier requested for encryption.- Parameters:
encryptKeyRequested- the key ID- Returns:
- this instance for fluent API
-
getActualEncryptKeyUsed
Gets the key identifier actually used for encryption.May differ from requested if key rotation or fallback occurred.
- Returns:
- actual encrypt key ID used
-
setActualEncryptKeyUsed
Sets the key identifier actually used for encryption.- Parameters:
actualEncryptKeyUsed- the key ID- Returns:
- this instance for fluent API
-
getEncryptAlgorithmUsed
Gets the algorithm used for encryption.Example: "ML-KEM-1024+A256GCM", "RSA-OAEP-256+A256GCM"
- Returns:
- encryption algorithm
-
setEncryptAlgorithmUsed
Sets the algorithm used for encryption.- Parameters:
encryptAlgorithmUsed- the algorithm- Returns:
- this instance for fluent API
-
getEncryptWarnings
Gets warnings related to the encryption operation.Examples: key expiration, key rotation, deprecated algorithm.
- Returns:
- unmodifiable list of encrypt warnings (never null)
-
setEncryptWarnings
Sets warnings related to the encryption operation.- Parameters:
encryptWarnings- the warnings- Returns:
- this instance for fluent API
-
hasAnyWarnings
public boolean hasAnyWarnings()Checks if there are any warnings (sign or encrypt).- Returns:
- true if either signing or encryption produced warnings
-
hasSignWarnings
public boolean hasSignWarnings()Checks if signing operation produced warnings.- Returns:
- true if sign warnings list is non-empty
-
hasEncryptWarnings
public boolean hasEncryptWarnings()Checks if encryption operation produced warnings.- Returns:
- true if encrypt warnings list is non-empty
-
toString
Returns string representation for debugging.
-