Package org.springframework.vault.core
Interface VaultWrappingOperations
- All Known Implementing Classes:
VaultWrappingTemplate
public interface VaultWrappingOperations
Interface that specifies wrapping-related operations.
- Since:
- 2.1
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionlookup
(VaultToken token) Looks upmetadata
for the given token containing a wrapped response.read
(VaultToken token) Read a wrapped secret.<T> VaultResponseSupport<T>
read
(VaultToken token, Class<T> responseType) Read a wrapped secret of typeresponseType
.rewrap
(VaultToken token) Rewraps a response-wrapped token.Wraps the given user-supplied data inside a response-wrapped token.
-
Method Details
-
lookup
Looks upmetadata
for the given token containing a wrapped response.- Parameters:
token
- must not be null.- Returns:
- the
WrappedMetadata
thetoken
or null if the token was invalid or expired.
-
read
Read a wrapped secret.- Parameters:
token
- must not be null.- Returns:
- the data or null if the token was invalid or expired.
-
read
Read a wrapped secret of typeresponseType
.- Parameters:
token
- must not be null.responseType
- must not be null.- Returns:
- the data or null if the token was invalid or expired.
-
rewrap
Rewraps a response-wrapped token. The new token will use the same creation TTL as the original token and contain the same response. The old token will be invalidated. This can be used for long-term storage of a secret in a response-wrapped token when rotation is a requirement. Rewrapping with an invalid token throwsVaultException
.- Parameters:
token
- must not be null.- Returns:
- the
WrappedMetadata
for this wrapping operation.
-
wrap
Wraps the given user-supplied data inside a response-wrapped token.- Parameters:
body
- must not be null.ttl
- must not be null.- Returns:
- the
WrappedMetadata
for this wrapping operation.
-