Class ImportJob

  • All Implemented Interfaces:
    ImportJobOrBuilder, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Serializable

    public final class ImportJob
    extends com.google.protobuf.GeneratedMessageV3
    implements ImportJobOrBuilder
     An [ImportJob][google.cloud.kms.v1.ImportJob] can be used to create
     [CryptoKeys][google.cloud.kms.v1.CryptoKey] and
     [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] using pre-existing
     key material, generated outside of Cloud KMS.
    
     When an [ImportJob][google.cloud.kms.v1.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][google.cloud.kms.v1.ImportJob.import_method]. When the
     wrapping key generation is complete, the
     [state][google.cloud.kms.v1.ImportJob.state] will be set to
     [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE] and the
     [public_key][google.cloud.kms.v1.ImportJob.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][google.cloud.kms.v1.CryptoKeyVersion] in an existing
     [CryptoKey][google.cloud.kms.v1.CryptoKey] by calling
     [ImportCryptoKeyVersion][google.cloud.kms.v1.KeyManagementService.ImportCryptoKeyVersion].
     Multiple [CryptoKeyVersions][google.cloud.kms.v1.CryptoKeyVersion] can be
     imported with a single [ImportJob][google.cloud.kms.v1.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][google.cloud.kms.v1.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][google.cloud.kms.v1.ImportJob]'s public key.
    
     For more information, see
     [Importing a key](https://cloud.google.com/kms/docs/importing-a-key).
     
    Protobuf type google.cloud.kms.v1.ImportJob
    See Also:
    Serialized Form
    • Method Detail

      • newInstance

        protected Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getName

        public String getName()
         Output only. The resource name for this
         [ImportJob][google.cloud.kms.v1.ImportJob] in the format
         `projects/*/locations/*/keyRings/*/importJobs/*`.
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getName in interface ImportJobOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         Output only. The resource name for this
         [ImportJob][google.cloud.kms.v1.ImportJob] in the format
         `projects/*/locations/*/keyRings/*/importJobs/*`.
         
        string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getNameBytes in interface ImportJobOrBuilder
        Returns:
        The bytes for name.
      • 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];
        Specified by:
        getImportMethodValue in interface ImportJobOrBuilder
        Returns:
        The enum numeric value on the wire for importMethod.
      • 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];
        Specified by:
        getImportMethod in interface ImportJobOrBuilder
        Returns:
        The importMethod.
      • getProtectionLevelValue

        public int getProtectionLevelValue()
         Required. Immutable. The protection level of the
         [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the
         [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
         of the [version_template][google.cloud.kms.v1.CryptoKey.version_template]
         on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import
         into.
         
        .google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
        Specified by:
        getProtectionLevelValue in interface ImportJobOrBuilder
        Returns:
        The enum numeric value on the wire for protectionLevel.
      • getProtectionLevel

        public ProtectionLevel getProtectionLevel()
         Required. Immutable. The protection level of the
         [ImportJob][google.cloud.kms.v1.ImportJob]. This must match the
         [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level]
         of the [version_template][google.cloud.kms.v1.CryptoKey.version_template]
         on the [CryptoKey][google.cloud.kms.v1.CryptoKey] you attempt to import
         into.
         
        .google.cloud.kms.v1.ProtectionLevel protection_level = 9 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];
        Specified by:
        getProtectionLevel in interface ImportJobOrBuilder
        Returns:
        The protectionLevel.
      • hasCreateTime

        public boolean hasCreateTime()
         Output only. The time at which this
         [ImportJob][google.cloud.kms.v1.ImportJob] was created.
         
        .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasCreateTime in interface ImportJobOrBuilder
        Returns:
        Whether the createTime field is set.
      • getCreateTime

        public com.google.protobuf.Timestamp getCreateTime()
         Output only. The time at which this
         [ImportJob][google.cloud.kms.v1.ImportJob] was created.
         
        .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getCreateTime in interface ImportJobOrBuilder
        Returns:
        The createTime.
      • getCreateTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder()
         Output only. The time at which this
         [ImportJob][google.cloud.kms.v1.ImportJob] was created.
         
        .google.protobuf.Timestamp create_time = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getCreateTimeOrBuilder in interface ImportJobOrBuilder
      • hasGenerateTime

        public boolean hasGenerateTime()
         Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key
         material was generated.
         
        .google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasGenerateTime in interface ImportJobOrBuilder
        Returns:
        Whether the generateTime field is set.
      • getGenerateTime

        public com.google.protobuf.Timestamp getGenerateTime()
         Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key
         material was generated.
         
        .google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getGenerateTime in interface ImportJobOrBuilder
        Returns:
        The generateTime.
      • getGenerateTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getGenerateTimeOrBuilder()
         Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]'s key
         material was generated.
         
        .google.protobuf.Timestamp generate_time = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getGenerateTimeOrBuilder in interface ImportJobOrBuilder
      • hasExpireTime

        public boolean hasExpireTime()
         Output only. The time at which this
         [ImportJob][google.cloud.kms.v1.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];
        Specified by:
        hasExpireTime in interface ImportJobOrBuilder
        Returns:
        Whether the expireTime field is set.
      • getExpireTime

        public com.google.protobuf.Timestamp getExpireTime()
         Output only. The time at which this
         [ImportJob][google.cloud.kms.v1.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];
        Specified by:
        getExpireTime in interface ImportJobOrBuilder
        Returns:
        The expireTime.
      • getExpireTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getExpireTimeOrBuilder()
         Output only. The time at which this
         [ImportJob][google.cloud.kms.v1.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];
        Specified by:
        getExpireTimeOrBuilder in interface ImportJobOrBuilder
      • hasExpireEventTime

        public boolean hasExpireEventTime()
         Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]
         expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is
         [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED].
         
        .google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasExpireEventTime in interface ImportJobOrBuilder
        Returns:
        Whether the expireEventTime field is set.
      • getExpireEventTime

        public com.google.protobuf.Timestamp getExpireEventTime()
         Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]
         expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is
         [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED].
         
        .google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getExpireEventTime in interface ImportJobOrBuilder
        Returns:
        The expireEventTime.
      • getExpireEventTimeOrBuilder

        public com.google.protobuf.TimestampOrBuilder getExpireEventTimeOrBuilder()
         Output only. The time this [ImportJob][google.cloud.kms.v1.ImportJob]
         expired. Only present if [state][google.cloud.kms.v1.ImportJob.state] is
         [EXPIRED][google.cloud.kms.v1.ImportJob.ImportJobState.EXPIRED].
         
        .google.protobuf.Timestamp expire_event_time = 10 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getExpireEventTimeOrBuilder in interface ImportJobOrBuilder
      • getStateValue

        public int getStateValue()
         Output only. The current state of the
         [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used.
         
        .google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getStateValue in interface ImportJobOrBuilder
        Returns:
        The enum numeric value on the wire for state.
      • getState

        public ImportJob.ImportJobState getState()
         Output only. The current state of the
         [ImportJob][google.cloud.kms.v1.ImportJob], indicating if it can be used.
         
        .google.cloud.kms.v1.ImportJob.ImportJobState state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getState in interface ImportJobOrBuilder
        Returns:
        The state.
      • hasPublicKey

        public boolean hasPublicKey()
         Output only. The public key with which to wrap key material prior to
         import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is
         [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE].
         
        .google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasPublicKey in interface ImportJobOrBuilder
        Returns:
        Whether the publicKey field is set.
      • getPublicKey

        public ImportJob.WrappingPublicKey getPublicKey()
         Output only. The public key with which to wrap key material prior to
         import. Only returned if [state][google.cloud.kms.v1.ImportJob.state] is
         [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE].
         
        .google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getPublicKey in interface ImportJobOrBuilder
        Returns:
        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][google.cloud.kms.v1.ImportJob.state] is
         [ACTIVE][google.cloud.kms.v1.ImportJob.ImportJobState.ACTIVE].
         
        .google.cloud.kms.v1.ImportJob.WrappingPublicKey public_key = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getPublicKeyOrBuilder in interface ImportJobOrBuilder
      • 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][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a
         protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
         
        .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        hasAttestation in interface ImportJobOrBuilder
        Returns:
        Whether the attestation field is set.
      • 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][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a
         protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
         
        .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getAttestation in interface ImportJobOrBuilder
        Returns:
        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][google.cloud.kms.v1.ImportJob.ImportMethod] is one with a
         protection level of [HSM][google.cloud.kms.v1.ProtectionLevel.HSM].
         
        .google.cloud.kms.v1.KeyOperationAttestation attestation = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];
        Specified by:
        getAttestationOrBuilder in interface ImportJobOrBuilder
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessageV3
        Throws:
        IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessageV3
      • equals

        public boolean equals​(Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static ImportJob parseFrom​(ByteBuffer data)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ImportJob parseFrom​(ByteBuffer data,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ImportJob parseFrom​(com.google.protobuf.ByteString data)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ImportJob parseFrom​(com.google.protobuf.ByteString data,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ImportJob parseFrom​(byte[] data)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ImportJob parseFrom​(byte[] data,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static ImportJob parseFrom​(com.google.protobuf.CodedInputStream input,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws IOException
        Throws:
        IOException
      • newBuilderForType

        public ImportJob.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public ImportJob.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected ImportJob.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static ImportJob getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<ImportJob> parser()
      • getParserForType

        public com.google.protobuf.Parser<ImportJob> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstanceForType

        public ImportJob getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder