public class IbmKeyProtectApi
extends com.ibm.cloud.sdk.core.service.BaseService
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_RETRY |
static long |
DEFAULT_RETRY_MAX_INTERVAL |
static String |
DEFAULT_SERVICE_NAME |
Constructor and Description |
---|
IbmKeyProtectApi(String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `IbmKeyProtectApi` client.
|
IbmKeyProtectApi(String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator,
int maxRetry,
long retryMaxInterval)
Constructs an instance of the `IbmKeyProtectApi` client.
|
IbmKeyProtectApi(String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator,
String keyRingId)
Constructs an instance of the `IbmKeyProtectApi` client, and use the key ring in the instance
The specified service name, authenticator and key ring ID are used to configure the client instance.
|
IbmKeyProtectApi(String serviceName,
com.ibm.cloud.sdk.core.security.Authenticator authenticator,
String keyRingId,
int maxRetry,
long retryMaxInterval)
Constructs an instance of the `IbmKeyProtectApi` client.
|
Modifier and Type | Method and Description |
---|---|
com.ibm.cloud.sdk.core.http.ServiceCall<KeyActionOneOfResponse> |
actionOnKey(ActionOnKeyOptions actionOnKeyOptions)
Invoke an action on a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Key> |
createKey(CreateKeyOptions createKeyOptions)
Create a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<KeyAlias> |
createKeyAlias(CreateKeyAliasOptions createKeyAliasOptions)
Create an alias.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
createKeyRing(CreateKeyRingOptions createKeyRingOptions)
Create Key Ring.
|
com.ibm.cloud.sdk.core.http.ServiceCall<DeleteKey> |
deleteKey(DeleteKeyOptions deleteKeyOptions)
Delete a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteKeyAlias(DeleteKeyAliasOptions deleteKeyAliasOptions)
Delete an alias.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
deleteKeyRing(DeleteKeyRingOptions deleteKeyRingOptions)
Delete Key Ring.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
disableKey(DisableKeyOptions disableKeyOptions)
Disable a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
enableKey(EnableKeyOptions enableKeyOptions)
Enable a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
eventAcknowledge(EventAcknowledgeOptions eventAcknowledgeOptions)
Acknowledge key events.
|
com.ibm.cloud.sdk.core.http.ServiceCall<AllowedIPPort> |
getAllowedIPPort(GetAllowedIPPortOptions getAllowedIpPortOptions)
Retrieve allowed IP port.
|
com.ibm.cloud.sdk.core.http.ServiceCall<GetImportToken> |
getImportToken(GetImportTokenOptions getImportTokenOptions)
Retrieve an import token.
|
com.ibm.cloud.sdk.core.http.ServiceCall<GetInstancePoliciesOneOf> |
getInstancePolicy(GetInstancePolicyOptions getInstancePolicyOptions)
List instance policies.
|
com.ibm.cloud.sdk.core.http.ServiceCall<GetKey> |
getKey(GetKeyOptions getKeyOptions)
Retrieve a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
getKeyCollectionMetadata(GetKeyCollectionMetadataOptions getKeyCollectionMetadataOptions)
Retrieve key total.
|
com.ibm.cloud.sdk.core.http.ServiceCall<GetKeyMetadata> |
getKeyMetadata(GetKeyMetadataOptions getKeyMetadataOptions)
Retrieve key metadata.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ListKeys> |
getKeys(GetKeysOptions getKeysOptions)
List keys.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ListKeyVersions> |
getKeyVersions(GetKeyVersionsOptions getKeyVersionsOptions)
List key versions.
|
com.ibm.cloud.sdk.core.http.ServiceCall<GetKeyPoliciesOneOf> |
getPolicy(GetPolicyOptions getPolicyOptions)
List key policies.
|
com.ibm.cloud.sdk.core.http.ServiceCall<RegistrationWithTotalCount> |
getRegistrations(GetRegistrationsOptions getRegistrationsOptions)
List registrations for a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<RegistrationWithTotalCount> |
getRegistrationsAllKeys(GetRegistrationsAllKeysOptions getRegistrationsAllKeysOptions)
List registrations for any key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ListKeyRings> |
listKeyRings(ListKeyRingsOptions listKeyRingsOptions)
List Key Rings.
|
static IbmKeyProtectApi |
newInstance()
Class method which constructs an instance of the `IbmKeyProtectApi` client.
|
static IbmKeyProtectApi |
newInstance(com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Class method which constructs an instance of the `IbmKeyProtectApi` client.
|
static IbmKeyProtectApi |
newInstance(com.ibm.cloud.sdk.core.security.Authenticator authenticator,
int maxRetry,
long retryMaxInterval)
Class method which constructs an instance of the `IbmKeyProtectApi` client.
|
static IbmKeyProtectApi |
newInstance(com.ibm.cloud.sdk.core.security.Authenticator authenticator,
String keyRingId)
Class method which constructs an instance of the `IbmKeyProtectApi` client.
|
static IbmKeyProtectApi |
newInstance(com.ibm.cloud.sdk.core.security.Authenticator authenticator,
String keyRingId,
int maxRetry,
long retryMaxInterval)
Class method which constructs an instance of the `IbmKeyProtectApi` client.
|
static IbmKeyProtectApi |
newInstance(String serviceName)
Class method which constructs an instance of the `IbmKeyProtectApi` client.
|
com.ibm.cloud.sdk.core.http.ServiceCall<PatchKeyResponseBody> |
patchKey(PatchKeyOptions patchKeyOptions)
Update (patch) a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<ImportToken> |
postImportToken(PostImportTokenOptions postImportTokenOptions)
Create an import token.
|
com.ibm.cloud.sdk.core.http.ServiceCall<PurgeKey> |
purgeKey(PurgeKeyOptions purgeKeyOptions)
Purge a deleted key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
putInstancePolicy(PutInstancePolicyOptions putInstancePolicyOptions)
Set instance policies.
|
com.ibm.cloud.sdk.core.http.ServiceCall<GetKeyPoliciesOneOf> |
putPolicy(PutPolicyOptions putPolicyOptions)
Set key policies.
|
com.ibm.cloud.sdk.core.http.ServiceCall<InputStream> |
restoreKey(RestoreKeyOptions restoreKeyOptions)
Restore a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<RewrapKeyResponseBody> |
rewrapKey(RewrapKeyOptions rewrapKeyOptions)
Rewrap a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
rotateKey(RotateKeyOptions rotateKeyOptions)
Rotate a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
setKeyForDeletion(SetKeyForDeletionOptions setKeyForDeletionOptions)
Set a key for deletion.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
syncAssociatedResources(SyncAssociatedResourcesOptions syncAssociatedResourcesOptions)
Sync associated resources.
|
com.ibm.cloud.sdk.core.http.ServiceCall<Void> |
unsetKeyForDeletion(UnsetKeyForDeletionOptions unsetKeyForDeletionOptions)
Unset a key for deletion.
|
com.ibm.cloud.sdk.core.http.ServiceCall<UnwrapKeyResponseBody> |
unwrapKey(UnwrapKeyOptions unwrapKeyOptions)
Unwrap a key.
|
com.ibm.cloud.sdk.core.http.ServiceCall<WrapKeyResponseBody> |
wrapKey(WrapKeyOptions wrapKeyOptions)
Wrap a key.
|
configureClient, configureService, constructServiceUrl, constructServiceURL, disableRetries, enableGzipCompression, enableRetries, getAuthenticator, getClient, getDefaultHeaders, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, setClient, setDefaultHeaders, setEndPoint, setServiceUrl, toString
public static final String DEFAULT_SERVICE_NAME
public static final int DEFAULT_MAX_RETRY
public static final long DEFAULT_RETRY_MAX_INTERVAL
public IbmKeyProtectApi(String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
serviceName
- the service name to be used when configuring the client instanceauthenticator
- the Authenticator
instance to be configured for this clientpublic IbmKeyProtectApi(String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator, String keyRingId)
serviceName
- the service name to be used when configuring the client instanceauthenticator
- the Authenticator
instance to be configured for this clientkeyRingId
- Key Ring ID of the key ring which the client will be bound topublic IbmKeyProtectApi(String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator, int maxRetry, long retryMaxInterval)
serviceName
- the service name to be used when configuring the client instanceauthenticator
- the Authenticator
instance to be configured for this clientmaxRetry
- maximum number of retry attempts for failed HTTP requestsretryMaxInterval
- maximum time interval between two subsequent retriespublic IbmKeyProtectApi(String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator, String keyRingId, int maxRetry, long retryMaxInterval)
serviceName
- the service name to be used when configuring the client instanceauthenticator
- the Authenticator
instance to be configured for this clientkeyRingId
- Key Ring ID of the key ring which the client will be bound tomaxRetry
- maximum number of retry attempts for failed HTTP requestsretryMaxInterval
- maximum time interval between two subsequent retriespublic static IbmKeyProtectApi newInstance()
public static IbmKeyProtectApi newInstance(com.ibm.cloud.sdk.core.security.Authenticator authenticator)
authenticator
- the Authenticator
instance to be configured for this clientpublic static IbmKeyProtectApi newInstance(com.ibm.cloud.sdk.core.security.Authenticator authenticator, int maxRetry, long retryMaxInterval)
authenticator
- the Authenticator
instance to be configured for this clientmaxRetry
- maximum number of retry attempts for failed HTTP requestsretryMaxInterval
- maximum time interval between two subsequent retriespublic static IbmKeyProtectApi newInstance(com.ibm.cloud.sdk.core.security.Authenticator authenticator, String keyRingId)
authenticator
- the Authenticator
instance to be configured for this clientkeyRingId
- Key Ring ID of the key ring which the client will be bound topublic static IbmKeyProtectApi newInstance(com.ibm.cloud.sdk.core.security.Authenticator authenticator, String keyRingId, int maxRetry, long retryMaxInterval)
authenticator
- the Authenticator
instance to be configured for this clientkeyRingId
- Key Ring ID of the key ring which the client will be bound tomaxRetry
- maximum number of retry attempts for failed HTTP requestsretryMaxInterval
- maximum time interval between two subsequent retriespublic static IbmKeyProtectApi newInstance(String serviceName)
serviceName
- the service name to be used when configuring the client instancepublic com.ibm.cloud.sdk.core.http.ServiceCall<KeyAlias> createKeyAlias(CreateKeyAliasOptions createKeyAliasOptions)
Creates an alias for the specified key.
createKeyAliasOptions
- the CreateKeyAliasOptions
containing the options for the callServiceCall
with a result of type KeyAlias
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteKeyAlias(DeleteKeyAliasOptions deleteKeyAliasOptions)
Deletes an alias from the associated key.
Delete alias does not delete the key.
deleteKeyAliasOptions
- the DeleteKeyAliasOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<ImportToken> postImportToken(PostImportTokenOptions postImportTokenOptions)
Creates an import token that you can use to encrypt and import root keys into the service. [Learn more](/docs/key-protect?topic=key-protect-importing-keys#using-import-tokens)
When you call `POST /import_token`, Key Protect creates an RSA key-pair from its HSMs. The service encrypts and stores the private key in the HSM, and returns the corresponding public key when you call `GET /import_token`. You can create only one import token per service instance.
postImportTokenOptions
- the PostImportTokenOptions
containing the options for the callServiceCall
with a result of type ImportToken
public com.ibm.cloud.sdk.core.http.ServiceCall<GetImportToken> getImportToken(GetImportTokenOptions getImportTokenOptions)
Retrieves the import token that is associated with your service instance.
When you call `GET /import_token`, Key Protect returns the public key that you can use to encrypt and import key material to the service, along with details about the key.
**Note:** After you reach the `maxAllowedRetrievals` or `expirationDate` for the import token, the import token and its associated public key can no longer be used for key operations. To create a new import token, use `POST /import_token`.
getImportTokenOptions
- the GetImportTokenOptions
containing the options for the callServiceCall
with a result of type GetImportToken
public com.ibm.cloud.sdk.core.http.ServiceCall<WrapKeyResponseBody> wrapKey(WrapKeyOptions wrapKeyOptions)
Use a root key to [wrap or encrypt a data encryption key](/docs/key-protect?topic=key-protect-wrap-keys).
wrapKeyOptions
- the WrapKeyOptions
containing the options for the callServiceCall
with a result of type WrapKeyResponseBody
public com.ibm.cloud.sdk.core.http.ServiceCall<UnwrapKeyResponseBody> unwrapKey(UnwrapKeyOptions unwrapKeyOptions)
Use a root key to [unwrap or decrypt a data encryption key](/docs/key-protect?topic=key-protect-unwrap-keys).
**Note:** When you unwrap a wrapped data encryption key (WDEK) by using a rotated root key, the service returns a new ciphertext in the response entity-body. Each ciphertext remains available for `unwrap` actions. If you unwrap a DEK with a previous ciphertext, the service also returns the latest ciphertext and latest key version in the response. Use the latest ciphertext for future unwrap operations.
unwrapKeyOptions
- the UnwrapKeyOptions
containing the options for the callServiceCall
with a result of type UnwrapKeyResponseBody
public com.ibm.cloud.sdk.core.http.ServiceCall<RewrapKeyResponseBody> rewrapKey(RewrapKeyOptions rewrapKeyOptions)
Use a root key to [rewrap or reencrypt a data encryption key](/docs/key-protect?topic=key-protect-rewrap-keys).
rewrapKeyOptions
- the RewrapKeyOptions
containing the options for the callServiceCall
with a result of type RewrapKeyResponseBody
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> rotateKey(RotateKeyOptions rotateKeyOptions)
[Create a new version](/docs/key-protect?topic=key-protect-rotate-keys) of a root key.
rotateKeyOptions
- the RotateKeyOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> setKeyForDeletion(SetKeyForDeletionOptions setKeyForDeletionOptions)
[Authorize deletion](/docs/key-protect?topic=key-protect-delete-dual-auth-keys#set-key-deletion-api) for a key with a dual authorization policy.
setKeyForDeletionOptions
- the SetKeyForDeletionOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> unsetKeyForDeletion(UnsetKeyForDeletionOptions unsetKeyForDeletionOptions)
[Remove an authorization](/docs/key-protect?topic=key-protect-delete-dual-auth-keys#unset-key-deletion-api) for a key with a dual authorization policy.
unsetKeyForDeletionOptions
- the UnsetKeyForDeletionOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> enableKey(EnableKeyOptions enableKeyOptions)
[Enable operations](/docs/key-protect?topic=key-protect-disable-keys#enable-api) for a key.
enableKeyOptions
- the EnableKeyOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> disableKey(DisableKeyOptions disableKeyOptions)
[Disable operations](/docs/key-protect?topic=key-protect-disable-keys) for a key.
disableKeyOptions
- the DisableKeyOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> syncAssociatedResources(SyncAssociatedResourcesOptions syncAssociatedResourcesOptions)
Initiate a manual data synchronization request to the associated resources of a key. Regular key lifecycle events automatically notify integrated services of the change, however, in the case a service does not respond to a key lifecycle event notification, the `sync` API may be used to initiate a renotification to the integrated services that manage the associated resources linked to the key.
**Note:** The services that manage the associated resources linked to the key are responsible for maintaining up-to-date records of the key state and version. Key Protect does not have the ability to force data synchronization for other services. The `sync` API is purely to **initiate** a request for all associated resources to synchronize their key records with what the Key Protect API returns.
syncAssociatedResourcesOptions
- the SyncAssociatedResourcesOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> eventAcknowledge(EventAcknowledgeOptions eventAcknowledgeOptions)
**Service to service calls only.** Acknowledges a key lifecycle event.
When a customer performs an action on a root key, Key Protect uses Hyperwarp to notify the cloud services that are registered with the key. To acknowledge the Hyperwarp event, registered services must call `POST /api/v2/event_ack`.
eventAcknowledgeOptions
- the EventAcknowledgeOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<ListKeyRings> listKeyRings(ListKeyRingsOptions listKeyRingsOptions)
List all key rings in the instance.
listKeyRingsOptions
- the ListKeyRingsOptions
containing the options for the callServiceCall
with a result of type ListKeyRings
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> createKeyRing(CreateKeyRingOptions createKeyRingOptions)
Create a key ring in the instance with the specified name. The key ring ID `default` is a reserved key ring ID and cannot be created nor destroyed. The default key ring is initial key ring that is generated with each newly created instance. All keys not associated with an otherwise specified key ring exist within the default key ring.
createKeyRingOptions
- the CreateKeyRingOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> deleteKeyRing(DeleteKeyRingOptions deleteKeyRingOptions)
Delete the key ring from the instance. key ring ID `default` cannot be destroyed. Currently, only key rings with 0 (zero) keys, in any state [Active (1), Suspended (2), Deactivated (3), Destroyed (5)], may be deleted.
deleteKeyRingOptions
- the DeleteKeyRingOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Void> getKeyCollectionMetadata(GetKeyCollectionMetadataOptions getKeyCollectionMetadataOptions)
Returns the same HTTP headers as a GET request without returning the entity-body. This operation returns the number of keys in your instance in a header called `Key-Total`.
getKeyCollectionMetadataOptions
- the GetKeyCollectionMetadataOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<Key> createKey(CreateKeyOptions createKeyOptions)
Creates a new key with specified key material.
Key Protect designates the resource as either a root key or a standard key based on the `extractable` value that you specify. A successful `POST /keys` operation adds the key to the service and returns the details of the request in the response entity-body, if the Prefer header is set to `return=representation`.
createKeyOptions
- the CreateKeyOptions
containing the options for the callServiceCall
with a result of type Key
public com.ibm.cloud.sdk.core.http.ServiceCall<ListKeys> getKeys(GetKeysOptions getKeysOptions)
Retrieves a list of keys that are stored in your Key Protect service instance.
**Note:** `GET /keys` will not return the key material in the response body. You can retrieve the key material for a standard key with a subsequent `GET /keys/{id}` request.
getKeysOptions
- the GetKeysOptions
containing the options for the callServiceCall
with a result of type ListKeys
public com.ibm.cloud.sdk.core.http.ServiceCall<GetKey> getKey(GetKeyOptions getKeyOptions)
Retrieves a key and its details by specifying the ID or alias of the key.
getKeyOptions
- the GetKeyOptions
containing the options for the callServiceCall
with a result of type GetKey
public com.ibm.cloud.sdk.core.http.ServiceCall<KeyActionOneOfResponse> actionOnKey(ActionOnKeyOptions actionOnKeyOptions)
**Note:** This API has been **deprecated** and transitioned to individual request paths. Existing actions using this API will continue to be supported, but new actions will no longer be added to it. We recommend, if possible, aligning your request URLs to the new API path. The generic format of actions is now the following: `/api/v2/keys/<key_ID>/actions/<action>` where `key_ID` is the key you want to operate on/with and `action` is the same action that was passed as a query parameter previously.
Invokes an action on a specified key. This method supports the following actions:
- `disable`: [Disable operations](/docs/key-protect?topic=key-protect-disable-keys) for a key - `enable`: [Enable operations](/docs/key-protect?topic=key-protect-disable-keys#enable-api) for a key - `restore`: [Restore a root key](/docs/key-protect?topic=key-protect-restore-keys) - `rewrap`: Use a root key to [rewrap or reencrypt a data encryption key](/docs/key-protect?topic=key-protect-rewrap-keys) - `rotate`: [Create a new version](/docs/key-protect?topic=key-protect-rotate-keys) of a root key - `setKeyForDeletion`: [Authorize deletion](/docs/key-protect?topic=key-protect-delete-dual-auth-keys#set-key-deletion-api) for a key with a dual authorization policy - `unsetKeyForDeletion`: [Remove an authorization]((/docs/key-protect?topic=key-protect-delete-dual-auth-keys#unset-key-deletion-api) for a key with a dual authorization policy - `unwrap`: Use a root key to [unwrap or decrypt a data encryption key](/docs/key-protect?topic=key-protect-unwrap-keys) - `wrap`: Use a root key to [wrap or encrypt a data encryption key](/docs/key-protect?topic=key-protect-wrap-keys)
**Note:** When you unwrap a wrapped data encryption key (WDEK) by using a rotated root key, the service returns a new ciphertext in the response entity-body. Each ciphertext remains available for `unwrap` actions. If you unwrap a DEK with a previous ciphertext, the service also returns the latest ciphertext and latest key version in the response. Use the latest ciphertext for future unwrap operations.
actionOnKeyOptions
- the ActionOnKeyOptions
containing the options for the callServiceCall
with a result of type KeyActionOneOfResponse
public com.ibm.cloud.sdk.core.http.ServiceCall<PatchKeyResponseBody> patchKey(PatchKeyOptions patchKeyOptions)
Update attributes of a key. Currently only the following attributes are applicable for update: - keyRingID Note: If provided, the `X-Kms-Key-Ring` header should specify the key's current key ring. To change the key ring of the key, specify the new key ring in the request body.
patchKeyOptions
- the PatchKeyOptions
containing the options for the callServiceCall
with a result of type PatchKeyResponseBody
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteKey> deleteKey(DeleteKeyOptions deleteKeyOptions)
Deletes a key by specifying the ID of the key.
By default, Key Protect requires a single authorization to delete keys. For added protection, you can [enable a dual authorization policy](#set-key-policies) to safely delete keys from your service instance.
**Important:** When you delete a key, you permanently shred its contents and associated data. The action cannot be reversed.
**Note:** By default, Key Protect blocks the deletion of a key that's protecting a cloud resource, such as a Cloud Object Storage bucket. Use `GET keys/{id}/registrations` to verify if the key has an active registration to a resource. To delete the key and its associated registrations, set the optional `force` parameter to `true`.
deleteKeyOptions
- the DeleteKeyOptions
containing the options for the callServiceCall
with a result of type DeleteKey
public com.ibm.cloud.sdk.core.http.ServiceCall<GetKeyMetadata> getKeyMetadata(GetKeyMetadataOptions getKeyMetadataOptions)
Retrieves the details of a key by specifying the ID of the key.
getKeyMetadataOptions
- the GetKeyMetadataOptions
containing the options for the callServiceCall
with a result of type GetKeyMetadata
public com.ibm.cloud.sdk.core.http.ServiceCall<PurgeKey> purgeKey(PurgeKeyOptions purgeKeyOptions)
Purge all key metadata and registrations associated with the specified key. Purge key can only be applied to a key in the Destroyed (5) state. After a key is deleted, there is a wait period of up to four hours before purge key operation is allowed. **Important:** When you purge a key, you permanently shred its contents and associated data. The action cannot be reversed.
purgeKeyOptions
- the PurgeKeyOptions
containing the options for the callServiceCall
with a result of type PurgeKey
public com.ibm.cloud.sdk.core.http.ServiceCall<InputStream> restoreKey(RestoreKeyOptions restoreKeyOptions)
[Restore a key](/docs/key-protect?topic=key-protect-restore-keys).
restoreKeyOptions
- the RestoreKeyOptions
containing the options for the callServiceCall
with a result of type InputStream
public com.ibm.cloud.sdk.core.http.ServiceCall<ListKeyVersions> getKeyVersions(GetKeyVersionsOptions getKeyVersionsOptions)
Retrieves all versions of a root key by specifying the ID of the key.
When you rotate a root key, you generate a new version of the key. If you're using the root key to protect resources across IBM Cloud, the stered cloud services that you associate with the key use the latest key version to wrap your data. [Learn more](/docs/key-protect?topic=key-protect-key-rotation).
getKeyVersionsOptions
- the GetKeyVersionsOptions
containing the options for the callServiceCall
with a result of type ListKeyVersions
public com.ibm.cloud.sdk.core.http.ServiceCall<GetKeyPoliciesOneOf> putPolicy(PutPolicyOptions putPolicyOptions)
Creates or updates one or more policies for the specified key.
You can set policies for a key, such as an [automatic rotation policy](/docs/key-protect?topic=key-protect-set-rotation-policy) or a [dual authorization policy](/docs/key-protect?topic=key-protect-set-dual-auth-key-policy) to protect against the accidental deletion of keys. Use `PUT /keys/{id}/policies` to create new policies for a key or update an existing policy.
putPolicyOptions
- the PutPolicyOptions
containing the options for the callServiceCall
with a result of type GetKeyPoliciesOneOf
public com.ibm.cloud.sdk.core.http.ServiceCall<GetKeyPoliciesOneOf> getPolicy(GetPolicyOptions getPolicyOptions)
Retrieves a list of policies that are associated with a specified key.
You can set policies for a key, such as an [automatic rotation policy](/docs/key-protect?topic=key-protect-set-rotation-policy) or a [dual authorization policy](/docs/key-protect?topic=key-protect-set-dual-auth-key-policy) to protect against the accidental deletion of keys. Use `GET /keys/{id}/policies` to browse the policies that exist for a specified key.
getPolicyOptions
- the GetPolicyOptions
containing the options for the callServiceCall
with a result of type GetKeyPoliciesOneOf
public com.ibm.cloud.sdk.core.http.ServiceCall<Void> putInstancePolicy(PutInstancePolicyOptions putInstancePolicyOptions)
Creates or updates one or more policies for the specified service instance.
**Note:** When you set an instance policy, Key Protect associates the policy information with keys that you add to the instance after the policy is updated. This operation does not affect existing keys in the instance.
putInstancePolicyOptions
- the PutInstancePolicyOptions
containing the options for the callServiceCall
with a void resultpublic com.ibm.cloud.sdk.core.http.ServiceCall<GetInstancePoliciesOneOf> getInstancePolicy(GetInstancePolicyOptions getInstancePolicyOptions)
Retrieves a list of policies that are associated with a specified service instance.
You can manage advanced preferences for keys in your service instance by creating instance-level policies. Use `GET /instance/policies` to browse the policies that are associated with the specified instance. Currently, dual authorization policies are supported.
getInstancePolicyOptions
- the GetInstancePolicyOptions
containing the options for the callServiceCall
with a result of type GetInstancePoliciesOneOf
public com.ibm.cloud.sdk.core.http.ServiceCall<AllowedIPPort> getAllowedIPPort(GetAllowedIPPortOptions getAllowedIpPortOptions)
Retrieves the private endpoint port associated with your service instance's active allowed IP policy. If the instance does not contain an active allowed IP policy, no information will be returned.
getAllowedIpPortOptions
- the GetAllowedIPPortOptions
containing the options for the callServiceCall
with a result of type AllowedIPPort
public com.ibm.cloud.sdk.core.http.ServiceCall<RegistrationWithTotalCount> getRegistrations(GetRegistrationsOptions getRegistrationsOptions)
Retrieves a list of registrations that are associated with a specified root key.
When you use a root key to protect an IBM Cloud resource, such as a Cloud Object Storage bucket, Key Protect creates a registration between the resource and root key. You can use `GET /keys/{id}/registrations` to understand which cloud resources are protected by the key that you specify.
getRegistrationsOptions
- the GetRegistrationsOptions
containing the options for the callServiceCall
with a result of type RegistrationWithTotalCount
public com.ibm.cloud.sdk.core.http.ServiceCall<RegistrationWithTotalCount> getRegistrationsAllKeys(GetRegistrationsAllKeysOptions getRegistrationsAllKeysOptions)
Retrieves a list of registrations that match the Cloud Resource Name (CRN) query that you specify.
When you use a root key to protect an IBM Cloud resource, such as a Cloud Object Storage bucket, Key Protect creates a registration between the resource and root key. You can use `GET /keys/registrations` to understand which cloud resources are protected by keys in your Key Protect service instance.
getRegistrationsAllKeysOptions
- the GetRegistrationsAllKeysOptions
containing the options for the callServiceCall
with a result of type RegistrationWithTotalCount
Copyright © 2022 IBM Cloud. All rights reserved.