Azure Key Vault Keys Samples client library for Java
This document explains samples and how to use them.
Key concepts
Key concepts are explained in detail here.
Getting started
Getting started explained in detail here.
Examples
Following section document various examples.
Hello World Samples
- HelloWorld.java - and HelloWorldAsync.java - Contains samples for following scenarios:
- Create a Key
- Retrieve a Key
- Update a Key
- Delete a Key
List Operations Samples
- ListOperations.java and ListOperationsAsync.java - Contains samples for following scenarios:
- Create a Key
- List Keys
- Create new version of existing key.
- List versions of an existing key.
Backup And Restore Operations Samples
- BackupAndRestoreOperations.java and BackupAndRestoreOperationsAsync.java - Contains samples for following scenarios:
- Create a Key
- Backup a Key -- Write it to a file.
- Delete a key
- Restore a key
Managing Deleted Keys Samples:
- ManagingDeletedKeys.java and ManagingDeletedKeysAsync.java - Contains samples for following scenarios:
- Create a Key
- Delete a key
- List deleted keys
- Recover a deleted key
- Purge Deleted key
Encrypt And Decrypt Operations Samples:
- EncryptAndDecryptOperations.java and EncryptAndDecryptOperationsAsync.java - Contains samples for following scenarios:
- Encrypting plain text with asymmetric key
- Decrypting plain text with asymmetric key
- Encrypting plain text with symmetric key
- Decrypting plain text with symmetric key
Sign And Verify Operations Samples:
- SignAndVerifyOperations.java and SignAndVerifyOperationsAsync.java - Contains samples for following scenarios:
- Signing a digest
- Verifying signature against a digest
- Signing raw data content
- Verifyng signature against raw data content
Key Wrap And Unwrap Operations Samples:
- KeyWrapUnwrapOperations.java and KeyWrapUnwrapOperationsAsync.java - Contains samples for following scenarios:
- Wrapping a key with asymmetric key
- Unwrapping a key with asymmetric key
- Wrapping a key with symmetric key
- Unwrapping a key with symmetric key
Troubleshooting
General
Key Vault clients raise exceptions. For example, if you try to retrieve a key after it is deleted a 404 error is returned, indicating resource not found. In the following snippet, the error is handled gracefully by catching the exception and displaying additional information about the error.
try {
keyClient.getKey("deletedKey")
} catch (ResourceNotFoundException e) {
System.out.println(e.getMessage());
}
Next steps
Start using KeyVault Java SDK in your solutions. Our SDK details could be found at SDK README.
Additional Documentation
For more extensive documentation on Azure Key Vault, see the API reference documentation.
Contributing
This project welcomes contributions and suggestions. Find more contributing details here.