Class SignResult.Builder

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

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

    • jwsToken

      public SignResult.Builder jwsToken(String jwsToken)
      Sets the JWS token (required).
      Parameters:
      jwsToken - the Compact JWS string
      Returns:
      this builder
    • keyRequested

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

      public SignResult.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 SignResult.Builder algorithmUsed(String algorithmUsed)
      Sets the algorithm used.
      Parameters:
      algorithmUsed - the algorithm identifier
      Returns:
      this builder
    • warnings

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

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

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