Package co.ankatech.ankasecure.sdk.model
Class EncryptResult.Builder
java.lang.Object
co.ankatech.ankasecure.sdk.model.EncryptResult.Builder
- Enclosing class:
- EncryptResult
Builder for constructing immutable EncryptResult instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddWarning(CryptoWarning warning) Adds a single warning.algorithmUsed(String algorithmUsed) Sets the algorithm used.build()Builds an immutable EncryptResult instance.Sets the JWE token (required).keyRequested(String keyRequested) Sets the requested key identifier.materialVersion(Integer materialVersion) Sets the key-material version that performed the operation.warnings(List<CryptoWarning> warnings) Sets the list of warnings.
-
Method Details
-
jweToken
Sets the JWE token (required).- Parameters:
jweToken- the Compact JWE string- Returns:
- this builder
-
keyRequested
Sets the requested key identifier.- Parameters:
keyRequested- the kid originally requested- Returns:
- this builder
-
materialVersion
Sets the key-material version that performed the operation.- Parameters:
materialVersion- the material version (ank_kv), ornullwhen not resolvable- Returns:
- this builder
-
algorithmUsed
Sets the algorithm used.- Parameters:
algorithmUsed- the algorithm identifier- Returns:
- this builder
-
warnings
Sets the list of warnings.- Parameters:
warnings- the structured warnings (will be copied)- Returns:
- this builder
-
addWarning
Adds a single warning.- Parameters:
warning- the structured warning to add- Returns:
- this builder
-
build
Builds an immutable EncryptResult instance.- Returns:
- the constructed EncryptResult
- Throws:
NullPointerException- if jweToken is null
-