Class ImportJob (2.55.0)

public final class ImportJob extends GeneratedMessageV3 implements ImportJobOrBuilder

An ImportJob can be used to create CryptoKeys and CryptoKeyVersions using pre-existing key material, generated outside of Cloud KMS.

When an ImportJob is created, Cloud KMS will generate a "wrapping key", which is a public/private key pair. You use the wrapping key to encrypt (also known as wrap) the pre-existing key material to protect it during the import process. The nature of the wrapping key depends on the choice of import_method. When the wrapping key generation is complete, the state will be set to ACTIVE and the public_key can be fetched. The fetched public key can then be used to wrap your pre-existing key material.

Once the key material is wrapped, it can be imported into a new CryptoKeyVersion in an existing CryptoKey by calling ImportCryptoKeyVersion. Multiple CryptoKeyVersions can be imported with a single ImportJob. Cloud KMS uses the private key portion of the wrapping key to unwrap the key material. Only Cloud KMS has access to the private key.

An ImportJob expires 3 days after it is created. Once expired, Cloud KMS will no longer be able to import or unwrap any key material that was wrapped with the ImportJob's public key.

For more information, see Importing a key.

Protobuf type google.cloud.kms.v1.ImportJob

Implements

ImportJobOrBuilder

Static Fields

ATTESTATION_FIELD_NUMBER

public static final int ATTESTATION_FIELD_NUMBER
Field Value
Type Description
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

EXPIRE_EVENT_TIME_FIELD_NUMBER

public static final int EXPIRE_EVENT_TIME_FIELD_NUMBER
Field Value
Type Description
int

EXPIRE_TIME_FIELD_NUMBER

public static final int EXPIRE_TIME_FIELD_NUMBER
Field Value
Type Description
int

GENERATE_TIME_FIELD_NUMBER

public static final int GENERATE_TIME_FIELD_NUMBER
Field Value
Type Description
int

IMPORT_METHOD_FIELD_NUMBER

public static final int IMPORT_METHOD_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

PROTECTION_LEVEL_FIELD_NUMBER

public static final int PROTECTION_LEVEL_FIELD_NUMBER
Field Value
Type Description
int

PUBLIC_KEY_FIELD_NUMBER

public static final int PUBLIC_KEY_FIELD_NUMBER
Field Value
Type Description
int

STATE_FIELD_NUMBER

public static final int STATE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static ImportJob getDefaultInstance()
Returns
Type Description
ImportJob

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static ImportJob.Builder newBuilder()
Returns
Type Description
ImportJob.Builder

newBuilder(ImportJob prototype)

public static ImportJob.Builder newBuilder(ImportJob prototype)
Parameter
Name Description
prototype ImportJob
Returns
Type Description
ImportJob.Builder

parseDelimitedFrom(InputStream input)

public static ImportJob parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ImportJob
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImportJob
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static ImportJob parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
ImportJob
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImportJob
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ImportJob parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
ImportJob
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImportJob
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ImportJob parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
ImportJob
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImportJob
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static ImportJob parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
ImportJob
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImportJob
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static ImportJob parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
ImportJob
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
ImportJob
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<ImportJob> parser()
Returns
Type Description
Parser<ImportJob>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getAttestation()

public KeyOperationAttestation getAttestation()

Output only. Statement that was generated and signed by the key creator (for example, an HSM) at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only present if the chosen ImportMethod is one with a protection level of HSM.

.google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
KeyOperationAttestation

The attestation.

getAttestationOrBuilder()

public KeyOperationAttestationOrBuilder getAttestationOrBuilder()

Output only. Statement that was generated and signed by the key creator (for example, an HSM) at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only present if the chosen ImportMethod is one with a protection level of HSM.

.google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
KeyOperationAttestationOrBuilder

getCreateTime()

public Timestamp getCreateTime()

Output only. The time at which this ImportJob was created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The createTime.

getCreateTimeOrBuilder()

public TimestampOrBuilder getCreateTimeOrBuilder()

Output only. The time at which this ImportJob was created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getDefaultInstanceForType()

public ImportJob getDefaultInstanceForType()
Returns
Type Description
ImportJob

getExpireEventTime()

public Timestamp getExpireEventTime()

Output only. The time this ImportJob expired. Only present if state is EXPIRED.

.google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The expireEventTime.

getExpireEventTimeOrBuilder()

public TimestampOrBuilder getExpireEventTimeOrBuilder()

Output only. The time this ImportJob expired. Only present if state is EXPIRED.

.google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getExpireTime()

public Timestamp getExpireTime()

Output only. The time at which this ImportJob is scheduled for expiration and can no longer be used to import key material.

.google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The expireTime.

getExpireTimeOrBuilder()

public TimestampOrBuilder getExpireTimeOrBuilder()

Output only. The time at which this ImportJob is scheduled for expiration and can no longer be used to import key material.

.google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getGenerateTime()

public Timestamp getGenerateTime()

Output only. The time this ImportJob's key material was generated.

.google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
Timestamp

The generateTime.

getGenerateTimeOrBuilder()

public TimestampOrBuilder getGenerateTimeOrBuilder()

Output only. The time this ImportJob's key material was generated.

.google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
TimestampOrBuilder

getImportMethod()

public ImportJob.ImportMethod getImportMethod()

Required. Immutable. The wrapping method to be used for incoming key material.

.google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
ImportJob.ImportMethod

The importMethod.

getImportMethodValue()

public int getImportMethodValue()

Required. Immutable. The wrapping method to be used for incoming key material.

.google.cloud.kms.v1.ImportJob.ImportMethod import_method = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
int

The enum numeric value on the wire for importMethod.

getName()

public String getName()

Output only. The resource name for this ImportJob in the format projects/*/locations/*/keyRings/*/importJobs/*.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. The resource name for this ImportJob in the format projects/*/locations/*/keyRings/*/importJobs/*.

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<ImportJob> getParserForType()
Returns
Type Description
Parser<ImportJob>
Overrides

getProtectionLevel()

public ProtectionLevel getProtectionLevel()

Required. Immutable. The protection level of the ImportJob. This must match the protection_level of the version_template on the CryptoKey you attempt to import into.

.google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
ProtectionLevel

The protectionLevel.

getProtectionLevelValue()

public int getProtectionLevelValue()

Required. Immutable. The protection level of the ImportJob. This must match the protection_level of the version_template on the CryptoKey you attempt to import into.

.google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];

Returns
Type Description
int

The enum numeric value on the wire for protectionLevel.

getPublicKey()

public ImportJob.WrappingPublicKey getPublicKey()

Output only. The public key with which to wrap key material prior to import. Only returned if state is ACTIVE.

.google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ImportJob.WrappingPublicKey

The publicKey.

getPublicKeyOrBuilder()

public ImportJob.WrappingPublicKeyOrBuilder getPublicKeyOrBuilder()

Output only. The public key with which to wrap key material prior to import. Only returned if state is ACTIVE.

.google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ImportJob.WrappingPublicKeyOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

getState()

public ImportJob.ImportJobState getState()

Output only. The current state of the ImportJob, indicating if it can be used.

.google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ImportJob.ImportJobState

The state.

getStateValue()

public int getStateValue()

Output only. The current state of the ImportJob, indicating if it can be used.

.google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The enum numeric value on the wire for state.

hasAttestation()

public boolean hasAttestation()

Output only. Statement that was generated and signed by the key creator (for example, an HSM) at key creation time. Use this statement to verify attributes of the key as stored on the HSM, independently of Google. Only present if the chosen ImportMethod is one with a protection level of HSM.

.google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the attestation field is set.

hasCreateTime()

public boolean hasCreateTime()

Output only. The time at which this ImportJob was created.

.google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the createTime field is set.

hasExpireEventTime()

public boolean hasExpireEventTime()

Output only. The time this ImportJob expired. Only present if state is EXPIRED.

.google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the expireEventTime field is set.

hasExpireTime()

public boolean hasExpireTime()

Output only. The time at which this ImportJob is scheduled for expiration and can no longer be used to import key material.

.google.protobuf.Timestamp expire_time = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the expireTime field is set.

hasGenerateTime()

public boolean hasGenerateTime()

Output only. The time this ImportJob's key material was generated.

.google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the generateTime field is set.

hasPublicKey()

public boolean hasPublicKey()

Output only. The public key with which to wrap key material prior to import. Only returned if state is ACTIVE.

.google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

Whether the publicKey field is set.

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public ImportJob.Builder newBuilderForType()
Returns
Type Description
ImportJob.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ImportJob.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
ImportJob.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public ImportJob.Builder toBuilder()
Returns
Type Description
ImportJob.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException