Class GetParametersForImportRequest

All Implemented Interfaces:
SdkPojo, ToCopyableBuilder<GetParametersForImportRequest.Builder,GetParametersForImportRequest>

@Generated("software.amazon.awssdk:codegen") public final class GetParametersForImportRequest extends KmsRequest implements ToCopyableBuilder<GetParametersForImportRequest.Builder,GetParametersForImportRequest>
  • Method Details

    • keyId

      public final String keyId()

      The identifier of the KMS key that will be associated with the imported key material. The Origin of the KMS key must be EXTERNAL.

      All KMS key types are supported, including multi-Region keys. However, you cannot import key material into a KMS key in a custom key store.

      Specify the key ID or key ARN of the KMS key.

      For example:

      • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

      • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

      To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.

      Returns:
      The identifier of the KMS key that will be associated with the imported key material. The Origin of the KMS key must be EXTERNAL.

      All KMS key types are supported, including multi-Region keys. However, you cannot import key material into a KMS key in a custom key store.

      Specify the key ID or key ARN of the KMS key.

      For example:

      • Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab

      • Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab

      To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey.

    • wrappingAlgorithm

      public final AlgorithmSpec wrappingAlgorithm()

      The algorithm you will use with the RSA public key (PublicKey) in the response to protect your key material during import. For more information, see Select a wrapping algorithm in the Key Management Service Developer Guide.

      For RSA_AES wrapping algorithms, you encrypt your key material with an AES key that you generate, then encrypt your AES key with the RSA public key from KMS. For RSAES wrapping algorithms, you encrypt your key material directly with the RSA public key from KMS.

      The wrapping algorithms that you can use depend on the type of key material that you are importing. To import an RSA private key, you must use an RSA_AES wrapping algorithm.

      • RSA_AES_KEY_WRAP_SHA_256 — Supported for wrapping RSA and ECC key material.

      • RSA_AES_KEY_WRAP_SHA_1 — Supported for wrapping RSA and ECC key material.

      • RSAES_OAEP_SHA_256 — Supported for all types of key material, except RSA key material (private key).

        You cannot use the RSAES_OAEP_SHA_256 wrapping algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key material.

      • RSAES_OAEP_SHA_1 — Supported for all types of key material, except RSA key material (private key).

        You cannot use the RSAES_OAEP_SHA_1 wrapping algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key material.

      • RSAES_PKCS1_V1_5 (Deprecated) — As of October 10, 2023, KMS does not support the RSAES_PKCS1_V1_5 wrapping algorithm.

      If the service returns an enum value that is not available in the current SDK version, wrappingAlgorithm will return AlgorithmSpec.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from wrappingAlgorithmAsString().

      Returns:
      The algorithm you will use with the RSA public key (PublicKey) in the response to protect your key material during import. For more information, see Select a wrapping algorithm in the Key Management Service Developer Guide.

      For RSA_AES wrapping algorithms, you encrypt your key material with an AES key that you generate, then encrypt your AES key with the RSA public key from KMS. For RSAES wrapping algorithms, you encrypt your key material directly with the RSA public key from KMS.

      The wrapping algorithms that you can use depend on the type of key material that you are importing. To import an RSA private key, you must use an RSA_AES wrapping algorithm.

      • RSA_AES_KEY_WRAP_SHA_256 — Supported for wrapping RSA and ECC key material.

      • RSA_AES_KEY_WRAP_SHA_1 — Supported for wrapping RSA and ECC key material.

      • RSAES_OAEP_SHA_256 — Supported for all types of key material, except RSA key material (private key).

        You cannot use the RSAES_OAEP_SHA_256 wrapping algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key material.

      • RSAES_OAEP_SHA_1 — Supported for all types of key material, except RSA key material (private key).

        You cannot use the RSAES_OAEP_SHA_1 wrapping algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key material.

      • RSAES_PKCS1_V1_5 (Deprecated) — As of October 10, 2023, KMS does not support the RSAES_PKCS1_V1_5 wrapping algorithm.

      See Also:
    • wrappingAlgorithmAsString

      public final String wrappingAlgorithmAsString()

      The algorithm you will use with the RSA public key (PublicKey) in the response to protect your key material during import. For more information, see Select a wrapping algorithm in the Key Management Service Developer Guide.

      For RSA_AES wrapping algorithms, you encrypt your key material with an AES key that you generate, then encrypt your AES key with the RSA public key from KMS. For RSAES wrapping algorithms, you encrypt your key material directly with the RSA public key from KMS.

      The wrapping algorithms that you can use depend on the type of key material that you are importing. To import an RSA private key, you must use an RSA_AES wrapping algorithm.

      • RSA_AES_KEY_WRAP_SHA_256 — Supported for wrapping RSA and ECC key material.

      • RSA_AES_KEY_WRAP_SHA_1 — Supported for wrapping RSA and ECC key material.

      • RSAES_OAEP_SHA_256 — Supported for all types of key material, except RSA key material (private key).

        You cannot use the RSAES_OAEP_SHA_256 wrapping algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key material.

      • RSAES_OAEP_SHA_1 — Supported for all types of key material, except RSA key material (private key).

        You cannot use the RSAES_OAEP_SHA_1 wrapping algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key material.

      • RSAES_PKCS1_V1_5 (Deprecated) — As of October 10, 2023, KMS does not support the RSAES_PKCS1_V1_5 wrapping algorithm.

      If the service returns an enum value that is not available in the current SDK version, wrappingAlgorithm will return AlgorithmSpec.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from wrappingAlgorithmAsString().

      Returns:
      The algorithm you will use with the RSA public key (PublicKey) in the response to protect your key material during import. For more information, see Select a wrapping algorithm in the Key Management Service Developer Guide.

      For RSA_AES wrapping algorithms, you encrypt your key material with an AES key that you generate, then encrypt your AES key with the RSA public key from KMS. For RSAES wrapping algorithms, you encrypt your key material directly with the RSA public key from KMS.

      The wrapping algorithms that you can use depend on the type of key material that you are importing. To import an RSA private key, you must use an RSA_AES wrapping algorithm.

      • RSA_AES_KEY_WRAP_SHA_256 — Supported for wrapping RSA and ECC key material.

      • RSA_AES_KEY_WRAP_SHA_1 — Supported for wrapping RSA and ECC key material.

      • RSAES_OAEP_SHA_256 — Supported for all types of key material, except RSA key material (private key).

        You cannot use the RSAES_OAEP_SHA_256 wrapping algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key material.

      • RSAES_OAEP_SHA_1 — Supported for all types of key material, except RSA key material (private key).

        You cannot use the RSAES_OAEP_SHA_1 wrapping algorithm with the RSA_2048 wrapping key spec to wrap ECC_NIST_P521 key material.

      • RSAES_PKCS1_V1_5 (Deprecated) — As of October 10, 2023, KMS does not support the RSAES_PKCS1_V1_5 wrapping algorithm.

      See Also:
    • wrappingKeySpec

      public final WrappingKeySpec wrappingKeySpec()

      The type of RSA public key to return in the response. You will use this wrapping key with the specified wrapping algorithm to protect your key material during import.

      Use the longest RSA wrapping key that is practical.

      You cannot use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private key. Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public key.

      If the service returns an enum value that is not available in the current SDK version, wrappingKeySpec will return WrappingKeySpec.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from wrappingKeySpecAsString().

      Returns:
      The type of RSA public key to return in the response. You will use this wrapping key with the specified wrapping algorithm to protect your key material during import.

      Use the longest RSA wrapping key that is practical.

      You cannot use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private key. Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public key.

      See Also:
    • wrappingKeySpecAsString

      public final String wrappingKeySpecAsString()

      The type of RSA public key to return in the response. You will use this wrapping key with the specified wrapping algorithm to protect your key material during import.

      Use the longest RSA wrapping key that is practical.

      You cannot use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private key. Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public key.

      If the service returns an enum value that is not available in the current SDK version, wrappingKeySpec will return WrappingKeySpec.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from wrappingKeySpecAsString().

      Returns:
      The type of RSA public key to return in the response. You will use this wrapping key with the specified wrapping algorithm to protect your key material during import.

      Use the longest RSA wrapping key that is practical.

      You cannot use an RSA_2048 public key to directly wrap an ECC_NIST_P521 private key. Instead, use an RSA_AES wrapping algorithm or choose a longer RSA public key.

      See Also:
    • toBuilder

      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<GetParametersForImportRequest.Builder,GetParametersForImportRequest>
      Specified by:
      toBuilder in class KmsRequest
      Returns:
      a builder for type T
    • builder

      public static GetParametersForImportRequest.Builder builder()
    • serializableBuilderClass

      public static Class<? extends GetParametersForImportRequest.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class AwsRequest
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class AwsRequest
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
      Description copied from class: SdkRequest
      Used to retrieve the value of a field from any class that extends SdkRequest. The field name specified should match the member name from the corresponding service-2.json model specified in the codegen-resources folder for a given service. The class specifies what class to cast the returned value to. If the returned value is also a modeled class, the SdkRequest.getValueForField(String, Class) method will again be available.
      Overrides:
      getValueForField in class SdkRequest
      Parameters:
      fieldName - The name of the member to be retrieved.
      clazz - The class to cast the returned object to.
      Returns:
      Optional containing the casted return value
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.