Class PublicKey.Builder

  • All Implemented Interfaces:
    PublicKeyOrBuilder, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, Cloneable
    Enclosing class:
    PublicKey

    public static final class PublicKey.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
    implements PublicKeyOrBuilder
     The public key for a given
     [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion]. Obtained via
     [GetPublicKey][google.cloud.kms.v1.KeyManagementService.GetPublicKey].
     
    Protobuf type google.cloud.kms.v1.PublicKey
    • Method Detail

      • 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.Builder<PublicKey.Builder>
      • clear

        public PublicKey.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • getDefaultInstanceForType

        public PublicKey getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public PublicKey build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public PublicKey buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public PublicKey.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • setField

        public PublicKey.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                          Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • clearField

        public PublicKey.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • clearOneof

        public PublicKey.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • setRepeatedField

        public PublicKey.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  int index,
                                                  Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • addRepeatedField

        public PublicKey.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                  Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • mergeFrom

        public PublicKey.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<PublicKey.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • mergeFrom

        public PublicKey.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                           com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                    throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<PublicKey.Builder>
        Throws:
        IOException
      • getPem

        public String getPem()
         The public key, encoded in PEM format. For more information, see the
         [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
         [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
         [Textual Encoding of Subject Public Key Info]
         (https://tools.ietf.org/html/rfc7468#section-13).
         
        string pem = 1;
        Specified by:
        getPem in interface PublicKeyOrBuilder
        Returns:
        The pem.
      • getPemBytes

        public com.google.protobuf.ByteString getPemBytes()
         The public key, encoded in PEM format. For more information, see the
         [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
         [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
         [Textual Encoding of Subject Public Key Info]
         (https://tools.ietf.org/html/rfc7468#section-13).
         
        string pem = 1;
        Specified by:
        getPemBytes in interface PublicKeyOrBuilder
        Returns:
        The bytes for pem.
      • setPem

        public PublicKey.Builder setPem​(String value)
         The public key, encoded in PEM format. For more information, see the
         [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
         [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
         [Textual Encoding of Subject Public Key Info]
         (https://tools.ietf.org/html/rfc7468#section-13).
         
        string pem = 1;
        Parameters:
        value - The pem to set.
        Returns:
        This builder for chaining.
      • clearPem

        public PublicKey.Builder clearPem()
         The public key, encoded in PEM format. For more information, see the
         [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
         [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
         [Textual Encoding of Subject Public Key Info]
         (https://tools.ietf.org/html/rfc7468#section-13).
         
        string pem = 1;
        Returns:
        This builder for chaining.
      • setPemBytes

        public PublicKey.Builder setPemBytes​(com.google.protobuf.ByteString value)
         The public key, encoded in PEM format. For more information, see the
         [RFC 7468](https://tools.ietf.org/html/rfc7468) sections for
         [General Considerations](https://tools.ietf.org/html/rfc7468#section-2) and
         [Textual Encoding of Subject Public Key Info]
         (https://tools.ietf.org/html/rfc7468#section-13).
         
        string pem = 1;
        Parameters:
        value - The bytes for pem to set.
        Returns:
        This builder for chaining.
      • getAlgorithmValue

        public int getAlgorithmValue()
         The
         [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
         associated with this key.
         
        .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2;
        Specified by:
        getAlgorithmValue in interface PublicKeyOrBuilder
        Returns:
        The enum numeric value on the wire for algorithm.
      • setAlgorithmValue

        public PublicKey.Builder setAlgorithmValue​(int value)
         The
         [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
         associated with this key.
         
        .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2;
        Parameters:
        value - The enum numeric value on the wire for algorithm to set.
        Returns:
        This builder for chaining.
      • setAlgorithm

        public PublicKey.Builder setAlgorithm​(CryptoKeyVersion.CryptoKeyVersionAlgorithm value)
         The
         [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
         associated with this key.
         
        .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2;
        Parameters:
        value - The algorithm to set.
        Returns:
        This builder for chaining.
      • clearAlgorithm

        public PublicKey.Builder clearAlgorithm()
         The
         [Algorithm][google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm]
         associated with this key.
         
        .google.cloud.kms.v1.CryptoKeyVersion.CryptoKeyVersionAlgorithm algorithm = 2;
        Returns:
        This builder for chaining.
      • hasPemCrc32C

        public boolean hasPemCrc32C()
         Integrity verification field. A CRC32C checksum of the returned
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by
         computing the CRC32C checksum of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your
         results to this field. Discard the response in case of non-matching
         checksum values, and perform a limited number of retries. A persistent
         mismatch may indicate an issue in your computation of the CRC32C checksum.
         Note: This field is defined as int64 for reasons of compatibility across
         different languages. However, it is a non-negative integer, which will
         never exceed 2^32-1, and can be safely downconverted to uint32 in languages
         that support this type.
        
         NOTE: This field is in Beta.
         
        .google.protobuf.Int64Value pem_crc32c = 3;
        Specified by:
        hasPemCrc32C in interface PublicKeyOrBuilder
        Returns:
        Whether the pemCrc32c field is set.
      • getPemCrc32C

        public com.google.protobuf.Int64Value getPemCrc32C()
         Integrity verification field. A CRC32C checksum of the returned
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by
         computing the CRC32C checksum of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your
         results to this field. Discard the response in case of non-matching
         checksum values, and perform a limited number of retries. A persistent
         mismatch may indicate an issue in your computation of the CRC32C checksum.
         Note: This field is defined as int64 for reasons of compatibility across
         different languages. However, it is a non-negative integer, which will
         never exceed 2^32-1, and can be safely downconverted to uint32 in languages
         that support this type.
        
         NOTE: This field is in Beta.
         
        .google.protobuf.Int64Value pem_crc32c = 3;
        Specified by:
        getPemCrc32C in interface PublicKeyOrBuilder
        Returns:
        The pemCrc32c.
      • setPemCrc32C

        public PublicKey.Builder setPemCrc32C​(com.google.protobuf.Int64Value value)
         Integrity verification field. A CRC32C checksum of the returned
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by
         computing the CRC32C checksum of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your
         results to this field. Discard the response in case of non-matching
         checksum values, and perform a limited number of retries. A persistent
         mismatch may indicate an issue in your computation of the CRC32C checksum.
         Note: This field is defined as int64 for reasons of compatibility across
         different languages. However, it is a non-negative integer, which will
         never exceed 2^32-1, and can be safely downconverted to uint32 in languages
         that support this type.
        
         NOTE: This field is in Beta.
         
        .google.protobuf.Int64Value pem_crc32c = 3;
      • setPemCrc32C

        public PublicKey.Builder setPemCrc32C​(com.google.protobuf.Int64Value.Builder builderForValue)
         Integrity verification field. A CRC32C checksum of the returned
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by
         computing the CRC32C checksum of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your
         results to this field. Discard the response in case of non-matching
         checksum values, and perform a limited number of retries. A persistent
         mismatch may indicate an issue in your computation of the CRC32C checksum.
         Note: This field is defined as int64 for reasons of compatibility across
         different languages. However, it is a non-negative integer, which will
         never exceed 2^32-1, and can be safely downconverted to uint32 in languages
         that support this type.
        
         NOTE: This field is in Beta.
         
        .google.protobuf.Int64Value pem_crc32c = 3;
      • mergePemCrc32C

        public PublicKey.Builder mergePemCrc32C​(com.google.protobuf.Int64Value value)
         Integrity verification field. A CRC32C checksum of the returned
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by
         computing the CRC32C checksum of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your
         results to this field. Discard the response in case of non-matching
         checksum values, and perform a limited number of retries. A persistent
         mismatch may indicate an issue in your computation of the CRC32C checksum.
         Note: This field is defined as int64 for reasons of compatibility across
         different languages. However, it is a non-negative integer, which will
         never exceed 2^32-1, and can be safely downconverted to uint32 in languages
         that support this type.
        
         NOTE: This field is in Beta.
         
        .google.protobuf.Int64Value pem_crc32c = 3;
      • clearPemCrc32C

        public PublicKey.Builder clearPemCrc32C()
         Integrity verification field. A CRC32C checksum of the returned
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by
         computing the CRC32C checksum of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your
         results to this field. Discard the response in case of non-matching
         checksum values, and perform a limited number of retries. A persistent
         mismatch may indicate an issue in your computation of the CRC32C checksum.
         Note: This field is defined as int64 for reasons of compatibility across
         different languages. However, it is a non-negative integer, which will
         never exceed 2^32-1, and can be safely downconverted to uint32 in languages
         that support this type.
        
         NOTE: This field is in Beta.
         
        .google.protobuf.Int64Value pem_crc32c = 3;
      • getPemCrc32CBuilder

        public com.google.protobuf.Int64Value.Builder getPemCrc32CBuilder()
         Integrity verification field. A CRC32C checksum of the returned
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by
         computing the CRC32C checksum of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your
         results to this field. Discard the response in case of non-matching
         checksum values, and perform a limited number of retries. A persistent
         mismatch may indicate an issue in your computation of the CRC32C checksum.
         Note: This field is defined as int64 for reasons of compatibility across
         different languages. However, it is a non-negative integer, which will
         never exceed 2^32-1, and can be safely downconverted to uint32 in languages
         that support this type.
        
         NOTE: This field is in Beta.
         
        .google.protobuf.Int64Value pem_crc32c = 3;
      • getPemCrc32COrBuilder

        public com.google.protobuf.Int64ValueOrBuilder getPemCrc32COrBuilder()
         Integrity verification field. A CRC32C checksum of the returned
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem]. An integrity check of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] can be performed by
         computing the CRC32C checksum of
         [PublicKey.pem][google.cloud.kms.v1.PublicKey.pem] and comparing your
         results to this field. Discard the response in case of non-matching
         checksum values, and perform a limited number of retries. A persistent
         mismatch may indicate an issue in your computation of the CRC32C checksum.
         Note: This field is defined as int64 for reasons of compatibility across
         different languages. However, it is a non-negative integer, which will
         never exceed 2^32-1, and can be safely downconverted to uint32 in languages
         that support this type.
        
         NOTE: This field is in Beta.
         
        .google.protobuf.Int64Value pem_crc32c = 3;
        Specified by:
        getPemCrc32COrBuilder in interface PublicKeyOrBuilder
      • getName

        public String getName()
         The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         Provided here for verification.
        
         NOTE: This field is in Beta.
         
        string name = 4;
        Specified by:
        getName in interface PublicKeyOrBuilder
        Returns:
        The name.
      • getNameBytes

        public com.google.protobuf.ByteString getNameBytes()
         The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         Provided here for verification.
        
         NOTE: This field is in Beta.
         
        string name = 4;
        Specified by:
        getNameBytes in interface PublicKeyOrBuilder
        Returns:
        The bytes for name.
      • setName

        public PublicKey.Builder setName​(String value)
         The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         Provided here for verification.
        
         NOTE: This field is in Beta.
         
        string name = 4;
        Parameters:
        value - The name to set.
        Returns:
        This builder for chaining.
      • clearName

        public PublicKey.Builder clearName()
         The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         Provided here for verification.
        
         NOTE: This field is in Beta.
         
        string name = 4;
        Returns:
        This builder for chaining.
      • setNameBytes

        public PublicKey.Builder setNameBytes​(com.google.protobuf.ByteString value)
         The [name][google.cloud.kms.v1.CryptoKeyVersion.name] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         Provided here for verification.
        
         NOTE: This field is in Beta.
         
        string name = 4;
        Parameters:
        value - The bytes for name to set.
        Returns:
        This builder for chaining.
      • getProtectionLevelValue

        public int getProtectionLevelValue()
         The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         
        .google.cloud.kms.v1.ProtectionLevel protection_level = 5;
        Specified by:
        getProtectionLevelValue in interface PublicKeyOrBuilder
        Returns:
        The enum numeric value on the wire for protectionLevel.
      • setProtectionLevelValue

        public PublicKey.Builder setProtectionLevelValue​(int value)
         The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         
        .google.cloud.kms.v1.ProtectionLevel protection_level = 5;
        Parameters:
        value - The enum numeric value on the wire for protectionLevel to set.
        Returns:
        This builder for chaining.
      • getProtectionLevel

        public ProtectionLevel getProtectionLevel()
         The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         
        .google.cloud.kms.v1.ProtectionLevel protection_level = 5;
        Specified by:
        getProtectionLevel in interface PublicKeyOrBuilder
        Returns:
        The protectionLevel.
      • setProtectionLevel

        public PublicKey.Builder setProtectionLevel​(ProtectionLevel value)
         The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         
        .google.cloud.kms.v1.ProtectionLevel protection_level = 5;
        Parameters:
        value - The protectionLevel to set.
        Returns:
        This builder for chaining.
      • clearProtectionLevel

        public PublicKey.Builder clearProtectionLevel()
         The [ProtectionLevel][google.cloud.kms.v1.ProtectionLevel] of the
         [CryptoKeyVersion][google.cloud.kms.v1.CryptoKeyVersion] public key.
         
        .google.cloud.kms.v1.ProtectionLevel protection_level = 5;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final PublicKey.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>
      • mergeUnknownFields

        public final PublicKey.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<PublicKey.Builder>