Skip to main content

Vault | C# SDK | Secrets Endpoints

Secrets Endpoints

Secret store

VaultClient.SecretStore(SecretStoreRequest)

Store a secret in the vault service.

required parameters

SecretStoreRequest

The request parameters to send to the '/secret/store' endpoint.

Response Object

Task<Response<SecretStoreResult>>

The response containing the stored secret information.

var request = new SecretStoreRequest
    ("12sdfgs4543qv@#%$casd", "my-very-secret-secret")
    ;
var response = await client.SecretStore(request);

Secret rotate

VaultClient.SecretRotate(SecretRotateRequest)

Rotate a secret in the vault service.

required parameters

SecretRotateRequest

The secret rotate request.

Response Object

Task<Response<SecretRotateResult>>

The response containing the rotated secret information.

var request = new SecretRotateRequest(
        "pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5",
        "12sdfgs4543qv@#%$casd")
    .WithRotationState(ItemVersionState.Deactivated)
    ;
var response = await client.SecretRotate(request);