3.27.0 (latest) 3.26.0 3.25.0 3.24.0 3.23.0 3.22.0 3.21.0 3.20.0 3.19.0 3.18.0 3.17.0 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0

    public sealed class ImportJob : IMessage<ImportJob>, IEquatable<ImportJob>, IDeepCloneable<ImportJob>, IBufferMessage, IMessage

Reference documentation and code samples for the Google Cloud Key Management Service v1 API class ImportJob.

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).

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> ImportJob

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ImportJob](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ImportJob](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ImportJob](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.Kms.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1)

## Assembly

Google.Cloud.Kms.V1.dll

## Constructors

### ImportJob()

    public ImportJob()

### ImportJob(ImportJob)

    public ImportJob(ImportJob other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob` |

## Properties

### Attestation

    public KeyOperationAttestation Attestation { get; set; }

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\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.KeyOperationAttestation` |   |

### CreateTime

    public Timestamp CreateTime { get; set; }

Output only. The time at which this
\[ImportJob\]\[google.cloud.kms.v1.ImportJob\] was created.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### CryptoKeyBackend

    public string CryptoKeyBackend { get; set; }

Immutable. The resource name of the backend environment where the key
material for the wrapping key resides and where all related cryptographic
operations are performed. Currently, this field is only populated for keys
stored in HSM_SINGLE_TENANT. Note, this list is non-exhaustive and may
apply to additional \[ProtectionLevels\]\[google.cloud.kms.v1.ProtectionLevel\]
in the future. Supported resources:

- `"projects/*/locations/*/singleTenantHsmInstances/*"`

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### CryptoKeyBackendAsResourceName

    public IResourceName CryptoKeyBackendAsResourceName { get; set; }

[IResourceName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IResourceName.html)-typed view over the [CryptoKeyBackend](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob#Google_Cloud_Kms_V1_ImportJob_CryptoKeyBackend) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.IResourceName.html` |   |

### ExpireEventTime

    public Timestamp ExpireEventTime { get; set; }

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\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### ExpireTime

    public Timestamp ExpireTime { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### GenerateTime

    public Timestamp GenerateTime { get; set; }

Output only. The time this \[ImportJob\]\[google.cloud.kms.v1.ImportJob\]'s key
material was generated.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.WellKnownTypes.Timestamp.html` |   |

### ImportJobName

    public ImportJobName ImportJobName { get; set; }

[ImportJobName](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJobName)-typed view over the [Name](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob#Google_Cloud_Kms_V1_ImportJob_Name) resource name property.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJobName` |   |

### ImportMethod

    public ImportJob.Types.ImportMethod ImportMethod { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJobhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob.Types.ImportMethod` |   |

### Name

    public string Name { get; set; }

Output only. The resource name for this
\[ImportJob\]\[google.cloud.kms.v1.ImportJob\] in the format
`projects/*/locations/*/keyRings/*/importJobs/*`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### ProtectionLevel

    public ProtectionLevel ProtectionLevel { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ProtectionLevel` |   |

### PublicKey

    public ImportJob.Types.WrappingPublicKey PublicKey { get; set; }

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\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJobhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob.Types.WrappingPublicKey` |   |

### PublicKeyFormat

    public PublicKey.Types.PublicKeyFormat PublicKeyFormat { get; set; }

Output only. Specifies the
\[WrappingPublicKey\]\[google.cloud.kms.v1.ImportJob.WrappingPublicKey\] format
provided by the customer in the
\[KeyManagementService.GetImportJob\]\[google.cloud.kms.v1.KeyManagementService.GetImportJob\]
request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.PublicKeyhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.PublicKey.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.PublicKey.Types.PublicKeyFormat` |   |

### State

    public ImportJob.Types.ImportJobState State { get; set; }

Output only. The current state of the
\[ImportJob\]\[google.cloud.kms.v1.ImportJob\], indicating if it can be used.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJobhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Kms.V1/latest/Google.Cloud.Kms.V1.ImportJob.Types.ImportJobState` |   |