public class VaultTransitTemplate extends Object implements VaultTransitOperations
VaultTransitOperations
.Constructor and Description |
---|
VaultTransitTemplate(VaultOperations vaultOperations,
String path) |
Modifier and Type | Method and Description |
---|---|
void |
configureKey(String keyName,
VaultTransitKeyConfiguration keyConfiguration)
Creates a new named encryption key given a
name . |
void |
createKey(String keyName)
Creates a new named encryption key given a
name . |
void |
createKey(String keyName,
VaultTransitKeyCreationRequest createKeyRequest)
Creates a new named encryption key given a
name and
VaultTransitKeyCreationRequest . |
String |
decrypt(String keyName,
String ciphertext)
Decrypts the provided plaintext using the named key.
|
byte[] |
decrypt(String keyName,
String ciphertext,
VaultTransitContext transitRequest)
Decrypts the provided plaintext using the named key.
|
void |
deleteKey(String keyName)
Deletes a named encryption key.
|
String |
encrypt(String keyName,
byte[] plaintext,
VaultTransitContext transitRequest)
Encrypts the provided plaintext using the named key.
|
String |
encrypt(String keyName,
String plaintext)
Encrypts the provided plaintext using the named key.
|
VaultTransitKey |
getKey(String keyName)
Returns information about a named encryption key.
|
String |
rewrap(String keyName,
String ciphertext)
Rewrap the provided ciphertext using the latest version of the named key.
|
String |
rewrap(String keyName,
String ciphertext,
VaultTransitContext transitRequest)
Rewrap the provided ciphertext using the latest version of the named key.
|
void |
rotate(String keyName)
Rotates the version of the named key.
|
public VaultTransitTemplate(VaultOperations vaultOperations, String path)
public void createKey(String keyName)
VaultTransitOperations
name
.createKey
in interface VaultTransitOperations
keyName
- must not be empty or null.public void createKey(String keyName, VaultTransitKeyCreationRequest createKeyRequest)
VaultTransitOperations
name
and
VaultTransitKeyCreationRequest
. The key options set here cannot be changed
after key creation.createKey
in interface VaultTransitOperations
keyName
- must not be empty or null.createKeyRequest
- must not be null.public void configureKey(String keyName, VaultTransitKeyConfiguration keyConfiguration)
VaultTransitOperations
name
.configureKey
in interface VaultTransitOperations
keyName
- must not be empty or null.keyConfiguration
- must not be null.public VaultTransitKey getKey(String keyName)
VaultTransitOperations
getKey
in interface VaultTransitOperations
keyName
- must not be empty or null.VaultTransitKey
.public void deleteKey(String keyName)
VaultTransitOperations
deleteKey
in interface VaultTransitOperations
keyName
- must not be empty or null.public void rotate(String keyName)
VaultTransitOperations
VaultTransitOperations.rewrap(String, String)
.rotate
in interface VaultTransitOperations
keyName
- must not be empty or null.VaultTransitOperations.rewrap(String, String)
public String encrypt(String keyName, String plaintext)
VaultTransitOperations
encrypt
in interface VaultTransitOperations
keyName
- must not be empty or null.plaintext
- must not be empty or null.public String encrypt(String keyName, byte[] plaintext, VaultTransitContext transitRequest)
VaultTransitOperations
encrypt
in interface VaultTransitOperations
keyName
- must not be empty or null.plaintext
- must not be empty or null.transitRequest
- may be null if no request options provided.public String decrypt(String keyName, String ciphertext)
VaultTransitOperations
decrypt
in interface VaultTransitOperations
keyName
- must not be empty or null.ciphertext
- must not be empty or null.public byte[] decrypt(String keyName, String ciphertext, VaultTransitContext transitRequest)
VaultTransitOperations
decrypt
in interface VaultTransitOperations
keyName
- must not be empty or null.ciphertext
- must not be empty or null.transitRequest
- may be null if no request options provided.public String rewrap(String keyName, String ciphertext)
VaultTransitOperations
rewrap
in interface VaultTransitOperations
keyName
- must not be empty or null.ciphertext
- must not be empty or null.VaultTransitOperations.rotate(String)
public String rewrap(String keyName, String ciphertext, VaultTransitContext transitRequest)
VaultTransitOperations
rewrap
in interface VaultTransitOperations
keyName
- must not be empty or null.ciphertext
- must not be empty or null.transitRequest
- may be null if no request options provided.VaultTransitOperations.rotate(String)
Copyright © 2016–2017 Pivotal Software, Inc.. All rights reserved.