Class StaticKeyProvider.Builder
java.lang.Object
org.apache.juneau.rest.server.mcp.v20260728.StaticKeyProvider.Builder
- Enclosing class:
- StaticKeyProvider
Builder for
StaticKeyProvider.-
Method Summary
Modifier and TypeMethodDescriptionAdds a resolvable key.build()Builds an immutableStaticKeyProvidersnapshot of this builder's current state.Designates the current sealing key by identifier.
-
Method Details
-
addKey
Adds a resolvable key.- Parameters:
keyId- The key's identifier. Must not benull or blank.key- The key material. Must not benull .- Returns:
- This object.
- Throws:
IllegalArgumentException- IfkeyIdisnull /blank orkeyisnull .
-
current
Designates the current sealing key by identifier. Must name a key previously added viaaddKey(String, SecretKey).- Parameters:
keyId- The identifier of the key to designate as current. Must not benull or blank.- Returns:
- This object.
- Throws:
IllegalArgumentException- IfkeyIdisnull or blank.
-
build
Builds an immutableStaticKeyProvidersnapshot of this builder's current state.- Returns:
- A new, immutable
StaticKeyProvider. Nevernull . - Throws:
IllegalArgumentException- If no current key was designated viacurrent(String), or the designated current key was never added viaaddKey(String, SecretKey).
-