Package com.google.iam.admin.v1
Class ServiceAccountKey.Builder
java.lang.Object
com.google.protobuf.AbstractMessageLite.Builder
com.google.protobuf.AbstractMessage.Builder<BuilderT>
com.google.protobuf.GeneratedMessage.Builder<ServiceAccountKey.Builder>
com.google.iam.admin.v1.ServiceAccountKey.Builder
- All Implemented Interfaces:
ServiceAccountKeyOrBuilder,com.google.protobuf.Message.Builder,com.google.protobuf.MessageLite.Builder,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Cloneable
- Enclosing class:
- ServiceAccountKey
public static final class ServiceAccountKey.Builder
extends com.google.protobuf.GeneratedMessage.Builder<ServiceAccountKey.Builder>
implements ServiceAccountKeyOrBuilder
Represents a service account key. A service account has two sets of key-pairs: user-managed, and system-managed. User-managed key-pairs can be created and deleted by users. Users are responsible for rotating these keys periodically to ensure security of their service accounts. Users retain the private key of these key-pairs, and Google retains ONLY the public key. System-managed keys are automatically rotated by Google, and are used for signing for a maximum of two weeks. The rotation process is probabilistic, and usage of the new key will gradually ramp up and down over the key's lifetime. If you cache the public key set for a service account, we recommend that you update the cache every 15 minutes. User-managed keys can be added and removed at any time, so it is important to update the cache frequently. For Google-managed keys, Google will publish a key at least 6 hours before it is first used for signing and will keep publishing it for at least 6 hours after it was last used for signing. Public keys for all service accounts are also published at the OAuth2 Service Account API.Protobuf type
google.iam.admin.v1.ServiceAccountKey-
Method Summary
Modifier and TypeMethodDescriptionbuild()clear()The key status.Specifies the algorithm (and possibly key size) for the key.The key origin.The key type.The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.The private key data.The output format for the private key.The public key data.The key can be used after this timestamp.The key can be used before this timestamp.static final com.google.protobuf.Descriptors.Descriptorcom.google.protobuf.Descriptors.DescriptorbooleanThe key status.Specifies the algorithm (and possibly key size) for the key.intSpecifies the algorithm (and possibly key size) for the key.The key origin.intThe key origin.The key type.intThe key type.getName()The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.com.google.protobuf.ByteStringThe resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.com.google.protobuf.ByteStringThe private key data.The output format for the private key.intThe output format for the private key.com.google.protobuf.ByteStringThe public key data.com.google.protobuf.TimestampThe key can be used after this timestamp.com.google.protobuf.Timestamp.BuilderThe key can be used after this timestamp.com.google.protobuf.TimestampOrBuilderThe key can be used after this timestamp.com.google.protobuf.TimestampThe key can be used before this timestamp.com.google.protobuf.Timestamp.BuilderThe key can be used before this timestamp.com.google.protobuf.TimestampOrBuilderThe key can be used before this timestamp.booleanThe key can be used after this timestamp.booleanThe key can be used before this timestamp.protected com.google.protobuf.GeneratedMessage.FieldAccessorTablefinal booleanmergeFrom(ServiceAccountKey other) mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) mergeFrom(com.google.protobuf.Message other) mergeValidAfterTime(com.google.protobuf.Timestamp value) The key can be used after this timestamp.mergeValidBeforeTime(com.google.protobuf.Timestamp value) The key can be used before this timestamp.setDisabled(boolean value) The key status.Specifies the algorithm (and possibly key size) for the key.setKeyAlgorithmValue(int value) Specifies the algorithm (and possibly key size) for the key.The key origin.setKeyOriginValue(int value) The key origin.The key type.setKeyTypeValue(int value) The key type.The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.setNameBytes(com.google.protobuf.ByteString value) The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.setPrivateKeyData(com.google.protobuf.ByteString value) The private key data.The output format for the private key.setPrivateKeyTypeValue(int value) The output format for the private key.setPublicKeyData(com.google.protobuf.ByteString value) The public key data.setValidAfterTime(com.google.protobuf.Timestamp value) The key can be used after this timestamp.setValidAfterTime(com.google.protobuf.Timestamp.Builder builderForValue) The key can be used after this timestamp.setValidBeforeTime(com.google.protobuf.Timestamp value) The key can be used before this timestamp.setValidBeforeTime(com.google.protobuf.Timestamp.Builder builderForValue) The key can be used before this timestamp.Methods inherited from class com.google.protobuf.GeneratedMessage.Builder
addRepeatedField, clearField, clearOneof, clone, getAllFields, getField, getFieldBuilder, getOneofFieldDescriptor, getParentForChildren, getRepeatedField, getRepeatedFieldBuilder, getRepeatedFieldCount, getUnknownFields, getUnknownFieldSetBuilder, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, internalGetMutableMapField, internalGetMutableMapFieldReflection, isClean, markClean, mergeUnknownFields, mergeUnknownLengthDelimitedField, mergeUnknownVarintField, newBuilderForField, onBuilt, onChanged, parseUnknownField, setField, setRepeatedField, setUnknownFields, setUnknownFieldSetBuilder, setUnknownFieldsProto3Methods inherited from class com.google.protobuf.AbstractMessage.Builder
findInitializationErrors, getInitializationErrorString, internalMergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, mergeFrom, newUninitializedMessageException, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite.Builder
addAll, addAll, mergeDelimitedFrom, mergeDelimitedFrom, mergeFrom, newUninitializedMessageExceptionMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.Message.Builder
mergeDelimitedFrom, mergeDelimitedFromMethods inherited from interface com.google.protobuf.MessageLite.Builder
mergeFromMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Method Details
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessage.Builder<ServiceAccountKey.Builder>
-
clear
- Specified by:
clearin interfacecom.google.protobuf.Message.Builder- Specified by:
clearin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
clearin classcom.google.protobuf.GeneratedMessage.Builder<ServiceAccountKey.Builder>
-
getDescriptorForType
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.Message.Builder- Specified by:
getDescriptorForTypein interfacecom.google.protobuf.MessageOrBuilder- Overrides:
getDescriptorForTypein classcom.google.protobuf.GeneratedMessage.Builder<ServiceAccountKey.Builder>
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-
build
- Specified by:
buildin interfacecom.google.protobuf.Message.Builder- Specified by:
buildin interfacecom.google.protobuf.MessageLite.Builder
-
buildPartial
- Specified by:
buildPartialin interfacecom.google.protobuf.Message.Builder- Specified by:
buildPartialin interfacecom.google.protobuf.MessageLite.Builder
-
mergeFrom
- Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<ServiceAccountKey.Builder>
-
mergeFrom
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessage.Builder<ServiceAccountKey.Builder>
-
mergeFrom
public ServiceAccountKey.Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Specified by:
mergeFromin interfacecom.google.protobuf.Message.Builder- Specified by:
mergeFromin interfacecom.google.protobuf.MessageLite.Builder- Overrides:
mergeFromin classcom.google.protobuf.AbstractMessage.Builder<ServiceAccountKey.Builder>- Throws:
IOException
-
getName
The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.string name = 1;- Specified by:
getNamein interfaceServiceAccountKeyOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.string name = 1;- Specified by:
getNameBytesin interfaceServiceAccountKeyOrBuilder- Returns:
- The bytes for name.
-
setName
The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.string name = 1;- Parameters:
value- The name to set.- Returns:
- This builder for chaining.
-
clearName
The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.string name = 1;- Returns:
- This builder for chaining.
-
setNameBytes
The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.string name = 1;- Parameters:
value- The bytes for name to set.- Returns:
- This builder for chaining.
-
getPrivateKeyTypeValue
public int getPrivateKeyTypeValue()The output format for the private key. Only provided in `CreateServiceAccountKey` responses, not in `GetServiceAccountKey` or `ListServiceAccountKey` responses. Google never exposes system-managed private keys, and never retains user-managed private keys.
.google.iam.admin.v1.ServiceAccountPrivateKeyType private_key_type = 2;- Specified by:
getPrivateKeyTypeValuein interfaceServiceAccountKeyOrBuilder- Returns:
- The enum numeric value on the wire for privateKeyType.
-
setPrivateKeyTypeValue
The output format for the private key. Only provided in `CreateServiceAccountKey` responses, not in `GetServiceAccountKey` or `ListServiceAccountKey` responses. Google never exposes system-managed private keys, and never retains user-managed private keys.
.google.iam.admin.v1.ServiceAccountPrivateKeyType private_key_type = 2;- Parameters:
value- The enum numeric value on the wire for privateKeyType to set.- Returns:
- This builder for chaining.
-
getPrivateKeyType
The output format for the private key. Only provided in `CreateServiceAccountKey` responses, not in `GetServiceAccountKey` or `ListServiceAccountKey` responses. Google never exposes system-managed private keys, and never retains user-managed private keys.
.google.iam.admin.v1.ServiceAccountPrivateKeyType private_key_type = 2;- Specified by:
getPrivateKeyTypein interfaceServiceAccountKeyOrBuilder- Returns:
- The privateKeyType.
-
setPrivateKeyType
The output format for the private key. Only provided in `CreateServiceAccountKey` responses, not in `GetServiceAccountKey` or `ListServiceAccountKey` responses. Google never exposes system-managed private keys, and never retains user-managed private keys.
.google.iam.admin.v1.ServiceAccountPrivateKeyType private_key_type = 2;- Parameters:
value- The privateKeyType to set.- Returns:
- This builder for chaining.
-
clearPrivateKeyType
The output format for the private key. Only provided in `CreateServiceAccountKey` responses, not in `GetServiceAccountKey` or `ListServiceAccountKey` responses. Google never exposes system-managed private keys, and never retains user-managed private keys.
.google.iam.admin.v1.ServiceAccountPrivateKeyType private_key_type = 2;- Returns:
- This builder for chaining.
-
getKeyAlgorithmValue
public int getKeyAlgorithmValue()Specifies the algorithm (and possibly key size) for the key.
.google.iam.admin.v1.ServiceAccountKeyAlgorithm key_algorithm = 8;- Specified by:
getKeyAlgorithmValuein interfaceServiceAccountKeyOrBuilder- Returns:
- The enum numeric value on the wire for keyAlgorithm.
-
setKeyAlgorithmValue
Specifies the algorithm (and possibly key size) for the key.
.google.iam.admin.v1.ServiceAccountKeyAlgorithm key_algorithm = 8;- Parameters:
value- The enum numeric value on the wire for keyAlgorithm to set.- Returns:
- This builder for chaining.
-
getKeyAlgorithm
Specifies the algorithm (and possibly key size) for the key.
.google.iam.admin.v1.ServiceAccountKeyAlgorithm key_algorithm = 8;- Specified by:
getKeyAlgorithmin interfaceServiceAccountKeyOrBuilder- Returns:
- The keyAlgorithm.
-
setKeyAlgorithm
Specifies the algorithm (and possibly key size) for the key.
.google.iam.admin.v1.ServiceAccountKeyAlgorithm key_algorithm = 8;- Parameters:
value- The keyAlgorithm to set.- Returns:
- This builder for chaining.
-
clearKeyAlgorithm
Specifies the algorithm (and possibly key size) for the key.
.google.iam.admin.v1.ServiceAccountKeyAlgorithm key_algorithm = 8;- Returns:
- This builder for chaining.
-
getPrivateKeyData
public com.google.protobuf.ByteString getPrivateKeyData()The private key data. Only provided in `CreateServiceAccountKey` responses. Make sure to keep the private key data secure because it allows for the assertion of the service account identity. When base64 decoded, the private key data can be used to authenticate with Google API client libraries and with <a href="/sdk/gcloud/reference/auth/activate-service-account">gcloud auth activate-service-account</a>.
bytes private_key_data = 3;- Specified by:
getPrivateKeyDatain interfaceServiceAccountKeyOrBuilder- Returns:
- The privateKeyData.
-
setPrivateKeyData
The private key data. Only provided in `CreateServiceAccountKey` responses. Make sure to keep the private key data secure because it allows for the assertion of the service account identity. When base64 decoded, the private key data can be used to authenticate with Google API client libraries and with <a href="/sdk/gcloud/reference/auth/activate-service-account">gcloud auth activate-service-account</a>.
bytes private_key_data = 3;- Parameters:
value- The privateKeyData to set.- Returns:
- This builder for chaining.
-
clearPrivateKeyData
The private key data. Only provided in `CreateServiceAccountKey` responses. Make sure to keep the private key data secure because it allows for the assertion of the service account identity. When base64 decoded, the private key data can be used to authenticate with Google API client libraries and with <a href="/sdk/gcloud/reference/auth/activate-service-account">gcloud auth activate-service-account</a>.
bytes private_key_data = 3;- Returns:
- This builder for chaining.
-
getPublicKeyData
public com.google.protobuf.ByteString getPublicKeyData()The public key data. Only provided in `GetServiceAccountKey` responses.
bytes public_key_data = 7;- Specified by:
getPublicKeyDatain interfaceServiceAccountKeyOrBuilder- Returns:
- The publicKeyData.
-
setPublicKeyData
The public key data. Only provided in `GetServiceAccountKey` responses.
bytes public_key_data = 7;- Parameters:
value- The publicKeyData to set.- Returns:
- This builder for chaining.
-
clearPublicKeyData
The public key data. Only provided in `GetServiceAccountKey` responses.
bytes public_key_data = 7;- Returns:
- This builder for chaining.
-
hasValidAfterTime
public boolean hasValidAfterTime()The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4;- Specified by:
hasValidAfterTimein interfaceServiceAccountKeyOrBuilder- Returns:
- Whether the validAfterTime field is set.
-
getValidAfterTime
public com.google.protobuf.Timestamp getValidAfterTime()The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4;- Specified by:
getValidAfterTimein interfaceServiceAccountKeyOrBuilder- Returns:
- The validAfterTime.
-
setValidAfterTime
The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4; -
setValidAfterTime
public ServiceAccountKey.Builder setValidAfterTime(com.google.protobuf.Timestamp.Builder builderForValue) The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4; -
mergeValidAfterTime
The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4; -
clearValidAfterTime
The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4; -
getValidAfterTimeBuilder
public com.google.protobuf.Timestamp.Builder getValidAfterTimeBuilder()The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4; -
getValidAfterTimeOrBuilder
public com.google.protobuf.TimestampOrBuilder getValidAfterTimeOrBuilder()The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4;- Specified by:
getValidAfterTimeOrBuilderin interfaceServiceAccountKeyOrBuilder
-
hasValidBeforeTime
public boolean hasValidBeforeTime()The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
.google.protobuf.Timestamp valid_before_time = 5;- Specified by:
hasValidBeforeTimein interfaceServiceAccountKeyOrBuilder- Returns:
- Whether the validBeforeTime field is set.
-
getValidBeforeTime
public com.google.protobuf.Timestamp getValidBeforeTime()The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
.google.protobuf.Timestamp valid_before_time = 5;- Specified by:
getValidBeforeTimein interfaceServiceAccountKeyOrBuilder- Returns:
- The validBeforeTime.
-
setValidBeforeTime
The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
.google.protobuf.Timestamp valid_before_time = 5; -
setValidBeforeTime
public ServiceAccountKey.Builder setValidBeforeTime(com.google.protobuf.Timestamp.Builder builderForValue) The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
.google.protobuf.Timestamp valid_before_time = 5; -
mergeValidBeforeTime
The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
.google.protobuf.Timestamp valid_before_time = 5; -
clearValidBeforeTime
The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
.google.protobuf.Timestamp valid_before_time = 5; -
getValidBeforeTimeBuilder
public com.google.protobuf.Timestamp.Builder getValidBeforeTimeBuilder()The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
.google.protobuf.Timestamp valid_before_time = 5; -
getValidBeforeTimeOrBuilder
public com.google.protobuf.TimestampOrBuilder getValidBeforeTimeOrBuilder()The key can be used before this timestamp. For system-managed key pairs, this timestamp is the end time for the private key signing operation. The public key could still be used for verification for a few hours after this time.
.google.protobuf.Timestamp valid_before_time = 5;- Specified by:
getValidBeforeTimeOrBuilderin interfaceServiceAccountKeyOrBuilder
-
getKeyOriginValue
public int getKeyOriginValue()The key origin.
.google.iam.admin.v1.ServiceAccountKeyOrigin key_origin = 9;- Specified by:
getKeyOriginValuein interfaceServiceAccountKeyOrBuilder- Returns:
- The enum numeric value on the wire for keyOrigin.
-
setKeyOriginValue
The key origin.
.google.iam.admin.v1.ServiceAccountKeyOrigin key_origin = 9;- Parameters:
value- The enum numeric value on the wire for keyOrigin to set.- Returns:
- This builder for chaining.
-
getKeyOrigin
The key origin.
.google.iam.admin.v1.ServiceAccountKeyOrigin key_origin = 9;- Specified by:
getKeyOriginin interfaceServiceAccountKeyOrBuilder- Returns:
- The keyOrigin.
-
setKeyOrigin
The key origin.
.google.iam.admin.v1.ServiceAccountKeyOrigin key_origin = 9;- Parameters:
value- The keyOrigin to set.- Returns:
- This builder for chaining.
-
clearKeyOrigin
The key origin.
.google.iam.admin.v1.ServiceAccountKeyOrigin key_origin = 9;- Returns:
- This builder for chaining.
-
getKeyTypeValue
public int getKeyTypeValue()The key type.
.google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType key_type = 10;- Specified by:
getKeyTypeValuein interfaceServiceAccountKeyOrBuilder- Returns:
- The enum numeric value on the wire for keyType.
-
setKeyTypeValue
The key type.
.google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType key_type = 10;- Parameters:
value- The enum numeric value on the wire for keyType to set.- Returns:
- This builder for chaining.
-
getKeyType
The key type.
.google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType key_type = 10;- Specified by:
getKeyTypein interfaceServiceAccountKeyOrBuilder- Returns:
- The keyType.
-
setKeyType
The key type.
.google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType key_type = 10;- Parameters:
value- The keyType to set.- Returns:
- This builder for chaining.
-
clearKeyType
The key type.
.google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType key_type = 10;- Returns:
- This builder for chaining.
-
getDisabled
public boolean getDisabled()The key status.
bool disabled = 11;- Specified by:
getDisabledin interfaceServiceAccountKeyOrBuilder- Returns:
- The disabled.
-
setDisabled
The key status.
bool disabled = 11;- Parameters:
value- The disabled to set.- Returns:
- This builder for chaining.
-
clearDisabled
The key status.
bool disabled = 11;- Returns:
- This builder for chaining.
-