> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WalletJwtGenerator

> Generates Wallet Auth JWT tokens for authenticating with wallet-specific endpoints.

Package: [`com.coinbase.cdp.auth`](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/auth/index)

```java theme={null}
public final class WalletJwtGenerator extends Object
```

Generates Wallet Auth JWT tokens for authenticating with wallet-specific endpoints.

Wallet JWTs are required for write operations (POST, PUT, DELETE) on account and spend-permission endpoints. They include a hash of the request body for integrity verification.

Example usage:

```

 String walletJwt = WalletJwtGenerator.generateWalletJwt(
     new WalletJwtOptions(
         walletSecret,
         "POST",
         "api.cdp.coinbase.com",
         "/platform/v1/accounts",
         Map.of("name", "my-account")
     ));
 
```

## Method Details

### `generateWalletJwt`

```java theme={null}
public static String generateWalletJwt(WalletJwtOptions options)
```

Generates a wallet authentication JWT.

**Parameters:**

`options` ([WalletJwtOptions](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/auth/WalletJwtOptions)) - the wallet JWT configuration options

**Returns:**

`String` - the generated JWT string

**Throws:**

`[JwtGenerationException](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/auth/exceptions/JwtGenerationException "class in com.coinbase.cdp.auth.exceptions")` - if token generation fails
