Class EncryptResult.Builder

java.lang.Object
co.ankatech.ankasecure.sdk.model.EncryptResult.Builder
Enclosing class:
EncryptResult

public static final class EncryptResult.Builder extends Object
Builder for constructing immutable EncryptResult instances.
  • Method Details

    • jweToken

      public EncryptResult.Builder jweToken(String jweToken)
      Sets the JWE token (required).
      Parameters:
      jweToken - the Compact JWE string
      Returns:
      this builder
    • keyRequested

      public EncryptResult.Builder keyRequested(String keyRequested)
      Sets the requested key identifier.
      Parameters:
      keyRequested - the kid originally requested
      Returns:
      this builder
    • materialVersion

      public EncryptResult.Builder materialVersion(Integer materialVersion)
      Sets the key-material version that performed the operation.
      Parameters:
      materialVersion - the material version (ank_kv), or null when not resolvable
      Returns:
      this builder
    • algorithmUsed

      public EncryptResult.Builder algorithmUsed(String algorithmUsed)
      Sets the algorithm used.
      Parameters:
      algorithmUsed - the algorithm identifier
      Returns:
      this builder
    • warnings

      public EncryptResult.Builder warnings(List<CryptoWarning> warnings)
      Sets the list of warnings.
      Parameters:
      warnings - the structured warnings (will be copied)
      Returns:
      this builder
    • addWarning

      public EncryptResult.Builder addWarning(CryptoWarning warning)
      Adds a single warning.
      Parameters:
      warning - the structured warning to add
      Returns:
      this builder
    • build

      public EncryptResult build()
      Builds an immutable EncryptResult instance.
      Returns:
      the constructed EncryptResult
      Throws:
      NullPointerException - if jweToken is null