1
- // Copyright 2021 Google LLC
1
+ // Copyright 2022 Google LLC
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
@@ -797,33 +797,56 @@ message ImportCryptoKeyVersionRequest {
797
797
// material.
798
798
string import_job = 4 [(google.api.field_behavior ) = REQUIRED ];
799
799
800
- // Required. The incoming wrapped key material that is to be imported.
800
+ // Optional. The wrapped key material to import.
801
+ //
802
+ // Before wrapping, key material must be formatted. If importing symmetric key
803
+ // material, the expected key material format is plain bytes. If importing
804
+ // asymmetric key material, the expected key material format is PKCS#8-encoded
805
+ // DER (the PrivateKeyInfo structure from RFC 5208).
806
+ //
807
+ // When wrapping with import methods
808
+ // ([RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256]
809
+ // or
810
+ // [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256]
811
+ // or
812
+ // [RSA_OAEP_3072_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256_AES_256]
813
+ // or
814
+ // [RSA_OAEP_4096_SHA256_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256_AES_256]),
815
+ //
816
+ // this field must contain the concatenation of:
817
+ // <ol>
818
+ // <li>An ephemeral AES-256 wrapping key wrapped with the
819
+ // [public_key][google.cloud.kms.v1.ImportJob.public_key] using
820
+ // RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an empty
821
+ // label.
822
+ // </li>
823
+ // <li>The formatted key to be imported, wrapped with the ephemeral AES-256
824
+ // key using AES-KWP (RFC 5649).
825
+ // </li>
826
+ // </ol>
827
+ //
828
+ // This format is the same as the format produced by PKCS#11 mechanism
829
+ // CKM_RSA_AES_KEY_WRAP.
830
+ //
831
+ // When wrapping with import methods
832
+ // ([RSA_OAEP_3072_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA256]
833
+ // or
834
+ // [RSA_OAEP_4096_SHA256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA256]),
835
+ //
836
+ // this field must contain the formatted key to be imported, wrapped with the
837
+ // [public_key][google.cloud.kms.v1.ImportJob.public_key] using RSAES-OAEP
838
+ // with SHA-256, MGF1 with SHA-256, and an empty label.
839
+ bytes wrapped_key = 8 [(google.api.field_behavior ) = OPTIONAL ];
840
+
841
+ // This field is legacy. Use the field
842
+ // [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key]
843
+ // instead.
801
844
oneof wrapped_key_material {
802
- // Wrapped key material produced with
803
- // [RSA_OAEP_3072_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_3072_SHA1_AES_256]
804
- // or
805
- // [RSA_OAEP_4096_SHA1_AES_256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256].
806
- //
807
- // This field contains the concatenation of two wrapped keys:
808
- // <ol>
809
- // <li>An ephemeral AES-256 wrapping key wrapped with the
810
- // [public_key][google.cloud.kms.v1.ImportJob.public_key] using
811
- // RSAES-OAEP with SHA-1/SHA-256, MGF1 with SHA-1/SHA-256, and an
812
- // empty label.
813
- // </li>
814
- // <li>The key to be imported, wrapped with the ephemeral AES-256 key
815
- // using AES-KWP (RFC 5649).
816
- // </li>
817
- // </ol>
818
- //
819
- // If importing symmetric key material, it is expected that the unwrapped
820
- // key contains plain bytes. If importing asymmetric key material, it is
821
- // expected that the unwrapped key is in PKCS#8-encoded DER format (the
822
- // PrivateKeyInfo structure from RFC 5208).
823
- //
824
- // This format is the same as the format produced by PKCS#11 mechanism
825
- // CKM_RSA_AES_KEY_WRAP.
826
- bytes rsa_aes_wrapped_key = 5 ;
845
+ // Optional. This field has the same meaning as
846
+ // [wrapped_key][google.cloud.kms.v1.ImportCryptoKeyVersionRequest.wrapped_key].
847
+ // Prefer to use that field in new work. Either that field or this field
848
+ // (but not both) must be specified.
849
+ bytes rsa_aes_wrapped_key = 5 [(google.api.field_behavior ) = OPTIONAL ];
827
850
}
828
851
}
829
852
@@ -935,7 +958,9 @@ message EncryptRequest {
935
958
//
936
959
// The maximum size depends on the key version's
937
960
// [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
938
- // For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the
961
+ // For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
962
+ // [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
963
+ // [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys, the
939
964
// plaintext must be no larger than 64KiB. For
940
965
// [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
941
966
// the plaintext and additional_authenticated_data fields must be no larger
@@ -948,8 +973,10 @@ message EncryptRequest {
948
973
//
949
974
// The maximum size depends on the key version's
950
975
// [protection_level][google.cloud.kms.v1.CryptoKeyVersionTemplate.protection_level].
951
- // For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE] keys, the AAD
952
- // must be no larger than 64KiB. For
976
+ // For [SOFTWARE][google.cloud.kms.v1.ProtectionLevel.SOFTWARE],
977
+ // [EXTERNAL][google.cloud.kms.v1.ProtectionLevel.EXTERNAL], and
978
+ // [EXTERNAL_VPC][google.cloud.kms.v1.ProtectionLevel.EXTERNAL_VPC] keys the
979
+ // AAD must be no larger than 64KiB. For
953
980
// [HSM][google.cloud.kms.v1.ProtectionLevel.HSM] keys, the combined length of
954
981
// the plaintext and additional_authenticated_data fields must be no larger
955
982
// than 8KiB.
0 commit comments