page_type | languages | products | urlFragment | |||
---|---|---|---|---|---|---|
sample |
|
|
keyvault-keys-samples |
This document explains samples and how to use them.
Key concepts are explained in detail here.
Getting started explained in detail here.
Following section document various examples.
- HelloWorld.java - and HelloWorldAsync.java - Contains samples for following scenarios:
- Create a Key
- Retrieve a Key
- Update a Key
- Delete a Key
- 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.
- 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
- 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
- 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
- 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
- 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
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());
}
Start using KeyVault Java SDK in your solutions. Our SDK details could be found at SDK README.
For more extensive documentation on Azure Key Vault, see the API reference documentation.
This project welcomes contributions and suggestions. Find more contributing details here.