Vault | Golang SDK | JWT Endpoints
JWT Endpoints
JWT Retrieve
func (v *vault) JWKGet(ctx context.Context, input *JWKGetRequest) (*pangea.PangeaResponse[JWKGetResult], error)Retrieve a key in JWK format.
input := &vault.JWKGetRequest{
ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
}
jr, err := vaultcli.JWKGet(ctx, input)
JWT Sign
func (v *vault) JWTSign(ctx context.Context, input *JWTSignRequest) (*pangea.PangeaResponse[JWTSignResult], error)Sign a JSON Web Token (JWT) using a key.
input := &vault.JWTSignRequest{
ID: pangea.StringValue("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5"),
Payload: pangea.StringValue("{\"sub\": \"1234567890\",\"name\": \"John Doe\",\"admin\": true}"),
}
jr, err := vaultcli.JWTSign(ctx, input)
JWT Verify
func (v *vault) JWTVerify(ctx context.Context, input *JWTVerifyRequest) (*pangea.PangeaResponse[JWTVerifyResult], error)Verify the signature of a JSON Web Token (JWT).
input := &vault.JWTVerifyRequest{
JWS: pangea.StringValue("ewogICJhbGciO..."),
}
jr, err := vaultcli.JWTVerify(ctx, input)