Class ImportJob (2.11.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
TypeDescription
int

CREATE_TIME_FIELD_NUMBER

public static final int CREATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

EXPIRE_EVENT_TIME_FIELD_NUMBER

public static final int EXPIRE_EVENT_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

EXPIRE_TIME_FIELD_NUMBER

public static final int EXPIRE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

GENERATE_TIME_FIELD_NUMBER

public static final int GENERATE_TIME_FIELD_NUMBER
Field Value
TypeDescription
int

IMPORT_METHOD_FIELD_NUMBER

public static final int IMPORT_METHOD_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

PROTECTION_LEVEL_FIELD_NUMBER

public static final int PROTECTION_LEVEL_FIELD_NUMBER
Field Value
TypeDescription
int

PUBLIC_KEY_FIELD_NUMBER

public static final int PUBLIC_KEY_FIELD_NUMBER
Field Value
TypeDescription
int

STATE_FIELD_NUMBER

public static final int STATE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static ImportJob getDefaultInstance()
Returns
TypeDescription
ImportJob

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static ImportJob.Builder newBuilder()
Returns
TypeDescription
ImportJob.Builder

newBuilder(ImportJob prototype)

public static ImportJob.Builder newBuilder(ImportJob prototype)
Parameter
NameDescription
prototypeImportJob
Returns
TypeDescription
ImportJob.Builder

parseDelimitedFrom(InputStream input)

public static ImportJob parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static ImportJob parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static ImportJob parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static ImportJob parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static ImportJob parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static ImportJob parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static ImportJob parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
ImportJob
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<ImportJob> parser()
Returns
TypeDescription
Parser<ImportJob>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
TimestampOrBuilder

getDefaultInstanceForType()

public ImportJob getDefaultInstanceForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for name.

getParserForType()

public Parser<ImportJob> getParserForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ImportJob.WrappingPublicKeyOrBuilder

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
int

The enum numeric value on the wire for state.

getUnknownFields()

public final UnknownFieldSet getUnknownFields()
Returns
TypeDescription
UnknownFieldSet
Overrides

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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
boolean

Whether the publicKey field is set.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public ImportJob.Builder newBuilderForType()
Returns
TypeDescription
ImportJob.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected ImportJob.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
ImportJob.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public ImportJob.Builder toBuilder()
Returns
TypeDescription
ImportJob.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides Exceptions
TypeDescription
IOException