Skip to main content

Vault | Java SDK | Secrets Endpoints

Secrets Endpoints

Store a secret

secretStore(SecretStoreRequest request)

Store a secret in vault service.

required parameters

SecretStoreRequest
  • request parameters to send to /secret/store endpoint

Response Object

SecretStoreResponse

SecretStoreResponse

 SecretStoreResponse storeResponse =
 	client.secretStore(new SecretStoreRequest.SecretStoreRequestBuilder("mysecret", "mysecretname").build());

Rotate a secret

secretRotate(SecretRotateRequest request)

Rotate a secret in vault service.

required parameters

SecretRotateRequest
  • secret rotate request

Response Object

SecretRotateResponse

SecretRotateResponse

 SecretRotateResponse rotateResponse = client.secretRotate(
 	new SecretRotateRequest.SecretRotateRequestBuilder("secretid", "mynewsecret")
 		.setRotationState(ItemVersionState.SUSPENDED)
 		.build()
 );