Vault | Java SDK
State change
stateChange(java.lang.String, int,cloud.pangeacyber.pangea.vault.models.ItemVersionState)Change the state of a specific version of a secret or key.
StateChangeResponse stateChangeResponse = client.stateChange("id", 1, ItemVersionState.DEACTIVATED);
Delete
delete(java.lang.String)Delete a secret or key.
DeleteResponse deleteResponse = client.delele("id");
Retrieve
get(cloud.pangeacyber.pangea.vault.requests.GetRequest)Retrieve a secret or key, and any associated information.
GetResponse getResponse = client.get(
new GetRequest.GetRequestBuilder("id").build()
);
List
list(cloud.pangeacyber.pangea.vault.requests.ListRequest)Retrieve a list of secrets, keys and folders, and their associated information.
ListResponse listResponse = client.list(
new ListRequest.ListRequestBuilder().build()
);
Update
update(cloud.pangeacyber.pangea.vault.requests.UpdateRequest)Update information associated with a secret or key.
UpdateResponse updateResponse = client.update(
new UpdateRequest.UpdateRequestBuilder("id")
.setFolder("updated")
.build()
);
Store a secret
secretStore(cloud.pangeacyber.pangea.vault.requests.SecretStoreRequest)Store a secret in vault service.
SecretStoreResponse storeResponse =
client.secretStore(new SecretStoreRequest.SecretStoreRequestBuilder("mysecret", "mysecretname").build());
Store a Pangea Token
pangeaTokenStore(cloud.pangeacyber.pangea.vault.requests.PangeaTokenStoreRequest)Store a pangea token in vault service.
SecretStoreResponse storeResponse =
client.pangeaTokenStore(new PangeaTokenStoreRequest.PangeaTokenStoreRequestBuilder("mytoken", "mytokenname").build());
Rotate a secret
secretRotate(cloud.pangeacyber.pangea.vault.requests.SecretRotateRequest)Rotate a secret in vault service.
SecretRotateResponse rotateResponse = client.secretRotate(
new SecretRotateRequest.SecretRotateRequestBuilder("secretid", "mynewsecret")
.setRotationState(ItemVersionState.SUSPENDED)
.build()
);
Rotate a Pangea Token
pangeaTokenRotate(cloud.pangeacyber.pangea.vault.requests.PangeaTokenRotateRequest)Rotate a Pangea Token in vault service.
SecretRotateResponse rotateResponse = client.pangeaTokenRotate(
new PangeaTokenStoreRequest.PangeaTokenRotateRequestBuilder("tokenid", "3m")
.build()
);
Symmetric generate
symmetricGenerate(cloud.pangeacyber.pangea.vault.requests.SymmetricGenerateRequest)Generate a symmetric key.
SymmetricGenerateRequest generateRequest = new SymmetricGenerateRequest.SymmetricGenerateRequestBuilder(
SymmetricAlgorithm.AES128_CFB,
KeyPurpose.ENCRYPTION,
"keyname"
).build();
SymmetricGenerateResponse generateResp = client.symmetricGenerate(generateRequest);
Asymmetric generate
asymmetricGenerate(cloud.pangeacyber.pangea.vault.requests.AsymmetricGenerateRequest)Generate an asymmetric key.
AsymmetricGenerateRequest generateRequest = new AsymmetricGenerateRequest.AsymmetricGenerateRequestBuilder(
AsymmetricAlgorithm.ED25519,
KeyPurpose.SIGNING,
"keyname"
).build();
AsymmetricGenerateResponse generateResp = client.asymmetricGenerate(generateRequest);
Asymmetric store
asymmetricStore(cloud.pangeacyber.pangea.vault.requests.AsymmetricStoreRequest)Import an asymmetric key.
AsymmetricStoreRequest storeRequest = new AsymmetricStoreRequest.AsymmetricStoreRequestBuilder(
"encodedprivatekey",
"encodedpublickey",
AsymmetricAlgorithm.ED25519,
KeyPurpose.SIGNING,
"keyname"
).build();
AsymmetricStoreResponse storeResp = client.asymmetricStore(storeRequest);
Symmetric store
symmetricStore(cloud.pangeacyber.pangea.vault.requests.SymmetricStoreRequest)Import a symmetric key.
SymmetricStoreRequest storeRequest = new SymmetricStoreRequest.SymmetricStoreRequestBuilder(
"encodedkey"
SymmetricAlgorithm.AES,
KeyPurpose.ENCRYPTION,
"keyname"
).build();
SymmetricStoreResponse storeResp = client.symmetricStore(storeRequest);
Key rotate
keyRotate(cloud.pangeacyber.pangea.vault.requests.KeyRotateRequest)Manually rotate a symmetric or asymmetric key.
KeyRotateResponse rotateResponse = client.keyRotate(
new KeyRotateRequest.KeyRotateRequestBuilder("keyid", ItemVersionState.SUSPENDED).build()
);
Encrypt
encrypt(cloud.pangeacyber.pangea.vault.requests.EncryptRequest)Encrypt a message using a key.
EncryptResponse encryptResponse = client.encrypt(
new EncryptRequest.EncryptRequestBuilder("keyid", "base64message").setVersion(2).build()
);
Decrypt
decrypt(cloud.pangeacyber.pangea.vault.requests.DecryptRequest)Decrypt a message using a key.
DecryptResponse decryptResponse = client.decrypt(
new DecryptRequest.DecryptRequestBuilder("keyid", "validciphertext")
.setVersion(2)
.build()
);
Sign
sign(java.lang.String, java.lang.String)Sign a message using a key.
SignResponse signResponse = client.sign("keyid", "base64data2sign");
Sign
sign(java.lang.String, java.lang.String,int)sign a message
SignResponse signResponse = client.sign("keyid", "base64data2sign", 2);
JWT Sign
jwtSign(java.lang.String, java.lang.String)Sign a JSON Web Token (JWT) using a key.
String payload = """
{'message': 'message to sign', 'data': 'Some extra data'}
""";
JWTSignResponse signResponse1 = client.jwtSign("keyid", payload);
Verify
verify(java.lang.String, java.lang.String,java.lang.String)Verify a signature using a key.
VerifyResponse verifyResponse = client.verify("keyid", "data2verify", "signature");
Verify
verify(java.lang.String, java.lang.String,java.lang.String,java.lang.Integer)Verify a signature using a key.
VerifyResponse verifyResponse = client.verify("keyid", "data2verify", "signature", 1);
JWT Verify
jwtVerify(java.lang.String)Verify the signature of a JSON Web Token (JWT).
JWTVerifyResponse verifyResponse = client.jwtVerify(signResponse.getResult().getJws());
JWT Retrieve
jwkGet(java.lang.String)Retrieve a key in JWK format.
JWKGetResponse getResponse = client.jwkGet("jwkid");
JWT Retrieve
jwkGet(java.lang.String, java.lang.String)Retrieve a key in JWK format.
JWKGetResponse getResponse = client.jwkGet("jwkid", 2);
Create
folderCreate(cloud.pangeacyber.pangea.vault.requests.FolderCreateRequest)Creates a folder.
FolderCreateResponse createParentResp = client.folderCreate(
new FolderCreateRequest.Builder("folder_name", "parent/folder/name").build()
);
Encrypt structured
<K, V,T>encryptStructured(cloud.pangeacyber.pangea.vault.requests.EncryptStructuredRequest<K,V,T>)Encrypt parts of a JSON object.
var request = new EncryptStructuredRequest.Builder<SomeModel>(
key,
data,
"$.field1[2:4]"
).build();
var encrypted = client.encryptStructured(request);
Decrypt structured
<K, V,T>decryptStructured(cloud.pangeacyber.pangea.vault.requests.EncryptStructuredRequest<K,V,T>)Decrypt parts of a JSON object.
var request = new EncryptStructuredRequest.Builder<SomeModel>(
key,
data,
"$.field1[2:4]"
).build();
var encrypted = client.decryptStructured(request);
Encrypt transform
encryptTransform(cloud.pangeacyber.pangea.vault.requests.EncryptTransformRequest)Encrypt using a format preserving algorithm (FPE).
var encrypted = client.encryptTransform(
new EncryptTransformRequest.Builder(
"pvi_[...]",
"123-4567-8901",
TransformAlphabet.ALPHANUMERIC
).tweak("MTIzMTIzMT==").build()
);
Decrypt transform
decryptTransform(cloud.pangeacyber.pangea.vault.requests.DecryptTransformRequest)Decrypt using a format preserving algorithm (FPE).
var decrypted = client.decryptTransform(
new DecryptTransformRequest.Builder(
"pvi_[...]",
"tZB-UKVP-MzTM",
"MTIzMTIzMT==",
TransformAlphabet.ALPHANUMERIC
).build()
);