Class KmsWrappedCryptoKey (3.27.0)

public final class KmsWrappedCryptoKey extends GeneratedMessageV3 implements KmsWrappedCryptoKeyOrBuilder

Include to use an existing data crypto key wrapped by KMS. The wrapped key must be a 128-, 192-, or 256-bit key. Authorization requires the following IAM permissions when sending a request to perform a crypto transformation using a KMS-wrapped crypto key: dlp.kms.encrypt

For more information, see Creating a wrapped key.

Note: When you use Cloud KMS for cryptographic operations, charges apply.

Protobuf type google.privacy.dlp.v2.KmsWrappedCryptoKey

Static Fields

CRYPTO_KEY_NAME_FIELD_NUMBER

public static final int CRYPTO_KEY_NAME_FIELD_NUMBER
Field Value
TypeDescription
int

WRAPPED_KEY_FIELD_NUMBER

public static final int WRAPPED_KEY_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static KmsWrappedCryptoKey getDefaultInstance()
Returns
TypeDescription
KmsWrappedCryptoKey

getDescriptor()

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

newBuilder()

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

newBuilder(KmsWrappedCryptoKey prototype)

public static KmsWrappedCryptoKey.Builder newBuilder(KmsWrappedCryptoKey prototype)
Parameter
NameDescription
prototypeKmsWrappedCryptoKey
Returns
TypeDescription
KmsWrappedCryptoKey.Builder

parseDelimitedFrom(InputStream input)

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

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(byte[] data)

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

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteString data)

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

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

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

parseFrom(CodedInputStream input)

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

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(InputStream input)

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

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

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

parseFrom(ByteBuffer data)

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

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

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

parser()

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

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getCryptoKeyName()

public String getCryptoKeyName()

Required. The resource name of the KMS CryptoKey to use for unwrapping.

string crypto_key_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
String

The cryptoKeyName.

getCryptoKeyNameBytes()

public ByteString getCryptoKeyNameBytes()

Required. The resource name of the KMS CryptoKey to use for unwrapping.

string crypto_key_name = 2 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The bytes for cryptoKeyName.

getDefaultInstanceForType()

public KmsWrappedCryptoKey getDefaultInstanceForType()
Returns
TypeDescription
KmsWrappedCryptoKey

getParserForType()

public Parser<KmsWrappedCryptoKey> getParserForType()
Returns
TypeDescription
Parser<KmsWrappedCryptoKey>
Overrides

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

getWrappedKey()

public ByteString getWrappedKey()

Required. The wrapped data crypto key.

bytes wrapped_key = 1 [(.google.api.field_behavior) = REQUIRED];

Returns
TypeDescription
ByteString

The wrappedKey.

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 KmsWrappedCryptoKey.Builder newBuilderForType()
Returns
TypeDescription
KmsWrappedCryptoKey.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

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

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

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

toBuilder()

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

writeTo(CodedOutputStream output)

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