This is an example for Lowkey Vault. It demonstrates a basic scenario where a key is used for encrypt/decrypt operations and database connection specific credentials as well as getting a PKCS12 store with a certificate and matching private key inside.
- Client
- Tests
- Using FakeCredential
- Using Managed Identity with DefaultAzureCredential (requires Assumed Identity to run)
Note
In order to better understand what is needed in general to make similar examples work, please find a generic overview here.
- Start Lowkey Vault and Assumed Identity
- If you are not using the default
169.254.169.254:80
address for Assumed Identity (because for example you are running it in the cloud)- Set
IDENTITY_ENDPOINT
environment variable to point to the/metadata/identity/oauth2/token
path of Assumed Identity e.g., http://localhost:8080/metadata/identity/oauth2/token - Set
IDENTITY_HEADER
environment variable to anything (just needs to exist) e.g.,header
- Set
- Run the tests
Tip
Since v2.4.2, Lowkey Vault is providing the same token endpoint on the 8080
port by default. Therefore, you don't need to start another container.