Package com.google.iam.admin.v1
Class ServiceAccountKey
- java.lang.Object
-
- com.google.protobuf.AbstractMessageLite
-
- com.google.protobuf.AbstractMessage
-
- com.google.protobuf.GeneratedMessageV3
-
- com.google.iam.admin.v1.ServiceAccountKey
-
- All Implemented Interfaces:
ServiceAccountKeyOrBuilder
,com.google.protobuf.Message
,com.google.protobuf.MessageLite
,com.google.protobuf.MessageLiteOrBuilder
,com.google.protobuf.MessageOrBuilder
,Serializable
public final class ServiceAccountKey extends com.google.protobuf.GeneratedMessageV3 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 typegoogle.iam.admin.v1.ServiceAccountKey
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServiceAccountKey.Builder
Represents a service account key.-
Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
-
-
Field Summary
Fields Modifier and Type Field Description static int
DISABLED_FIELD_NUMBER
static int
KEY_ALGORITHM_FIELD_NUMBER
static int
KEY_ORIGIN_FIELD_NUMBER
static int
KEY_TYPE_FIELD_NUMBER
static int
NAME_FIELD_NUMBER
static int
PRIVATE_KEY_DATA_FIELD_NUMBER
static int
PRIVATE_KEY_TYPE_FIELD_NUMBER
static int
PUBLIC_KEY_DATA_FIELD_NUMBER
static int
VALID_AFTER_TIME_FIELD_NUMBER
static int
VALID_BEFORE_TIME_FIELD_NUMBER
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
static ServiceAccountKey
getDefaultInstance()
ServiceAccountKey
getDefaultInstanceForType()
static com.google.protobuf.Descriptors.Descriptor
getDescriptor()
boolean
getDisabled()
The key status.ServiceAccountKeyAlgorithm
getKeyAlgorithm()
Specifies the algorithm (and possibly key size) for the key.int
getKeyAlgorithmValue()
Specifies the algorithm (and possibly key size) for the key.ServiceAccountKeyOrigin
getKeyOrigin()
The key origin.int
getKeyOriginValue()
The key origin.ListServiceAccountKeysRequest.KeyType
getKeyType()
The key type.int
getKeyTypeValue()
The key type.String
getName()
The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.com.google.protobuf.ByteString
getNameBytes()
The resource name of the service account key in the following format `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}/keys/{key}`.com.google.protobuf.Parser<ServiceAccountKey>
getParserForType()
com.google.protobuf.ByteString
getPrivateKeyData()
The private key data.ServiceAccountPrivateKeyType
getPrivateKeyType()
The output format for the private key.int
getPrivateKeyTypeValue()
The output format for the private key.com.google.protobuf.ByteString
getPublicKeyData()
The public key data.int
getSerializedSize()
com.google.protobuf.Timestamp
getValidAfterTime()
The key can be used after this timestamp.com.google.protobuf.TimestampOrBuilder
getValidAfterTimeOrBuilder()
The key can be used after this timestamp.com.google.protobuf.Timestamp
getValidBeforeTime()
The key can be used before this timestamp.com.google.protobuf.TimestampOrBuilder
getValidBeforeTimeOrBuilder()
The key can be used before this timestamp.int
hashCode()
boolean
hasValidAfterTime()
The key can be used after this timestamp.boolean
hasValidBeforeTime()
The key can be used before this timestamp.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable()
boolean
isInitialized()
static ServiceAccountKey.Builder
newBuilder()
static ServiceAccountKey.Builder
newBuilder(ServiceAccountKey prototype)
ServiceAccountKey.Builder
newBuilderForType()
protected ServiceAccountKey.Builder
newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
protected Object
newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
static ServiceAccountKey
parseDelimitedFrom(InputStream input)
static ServiceAccountKey
parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static ServiceAccountKey
parseFrom(byte[] data)
static ServiceAccountKey
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static ServiceAccountKey
parseFrom(com.google.protobuf.ByteString data)
static ServiceAccountKey
parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static ServiceAccountKey
parseFrom(com.google.protobuf.CodedInputStream input)
static ServiceAccountKey
parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static ServiceAccountKey
parseFrom(InputStream input)
static ServiceAccountKey
parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static ServiceAccountKey
parseFrom(ByteBuffer data)
static ServiceAccountKey
parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
static com.google.protobuf.Parser<ServiceAccountKey>
parser()
ServiceAccountKey.Builder
toBuilder()
void
writeTo(com.google.protobuf.CodedOutputStream output)
-
Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
-
Methods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toString
-
Methods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
PRIVATE_KEY_TYPE_FIELD_NUMBER
public static final int PRIVATE_KEY_TYPE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
KEY_ALGORITHM_FIELD_NUMBER
public static final int KEY_ALGORITHM_FIELD_NUMBER
- See Also:
- Constant Field Values
-
PRIVATE_KEY_DATA_FIELD_NUMBER
public static final int PRIVATE_KEY_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
PUBLIC_KEY_DATA_FIELD_NUMBER
public static final int PUBLIC_KEY_DATA_FIELD_NUMBER
- See Also:
- Constant Field Values
-
VALID_AFTER_TIME_FIELD_NUMBER
public static final int VALID_AFTER_TIME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
VALID_BEFORE_TIME_FIELD_NUMBER
public static final int VALID_BEFORE_TIME_FIELD_NUMBER
- See Also:
- Constant Field Values
-
KEY_ORIGIN_FIELD_NUMBER
public static final int KEY_ORIGIN_FIELD_NUMBER
- See Also:
- Constant Field Values
-
KEY_TYPE_FIELD_NUMBER
public static final int KEY_TYPE_FIELD_NUMBER
- See Also:
- Constant Field Values
-
DISABLED_FIELD_NUMBER
public static final int DISABLED_FIELD_NUMBER
- See Also:
- Constant Field Values
-
-
Method Detail
-
newInstance
protected Object newInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
- Overrides:
newInstance
in classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
-
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
- Specified by:
internalGetFieldAccessorTable
in classcom.google.protobuf.GeneratedMessageV3
-
getName
public String 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:
getName
in 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:
getNameBytes
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The bytes for name.
-
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:
getPrivateKeyTypeValue
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The enum numeric value on the wire for privateKeyType.
-
getPrivateKeyType
public ServiceAccountPrivateKeyType 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:
getPrivateKeyType
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The privateKeyType.
-
getKeyAlgorithmValue
public int getKeyAlgorithmValue()
Specifies the algorithm (and possibly key size) for the key.
.google.iam.admin.v1.ServiceAccountKeyAlgorithm key_algorithm = 8;
- Specified by:
getKeyAlgorithmValue
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The enum numeric value on the wire for keyAlgorithm.
-
getKeyAlgorithm
public ServiceAccountKeyAlgorithm getKeyAlgorithm()
Specifies the algorithm (and possibly key size) for the key.
.google.iam.admin.v1.ServiceAccountKeyAlgorithm key_algorithm = 8;
- Specified by:
getKeyAlgorithm
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The keyAlgorithm.
-
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:
getPrivateKeyData
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The privateKeyData.
-
getPublicKeyData
public com.google.protobuf.ByteString getPublicKeyData()
The public key data. Only provided in `GetServiceAccountKey` responses.
bytes public_key_data = 7;
- Specified by:
getPublicKeyData
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The publicKeyData.
-
hasValidAfterTime
public boolean hasValidAfterTime()
The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4;
- Specified by:
hasValidAfterTime
in 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:
getValidAfterTime
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The validAfterTime.
-
getValidAfterTimeOrBuilder
public com.google.protobuf.TimestampOrBuilder getValidAfterTimeOrBuilder()
The key can be used after this timestamp.
.google.protobuf.Timestamp valid_after_time = 4;
- Specified by:
getValidAfterTimeOrBuilder
in 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:
hasValidBeforeTime
in 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:
getValidBeforeTime
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The validBeforeTime.
-
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:
getValidBeforeTimeOrBuilder
in interfaceServiceAccountKeyOrBuilder
-
getKeyOriginValue
public int getKeyOriginValue()
The key origin.
.google.iam.admin.v1.ServiceAccountKeyOrigin key_origin = 9;
- Specified by:
getKeyOriginValue
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The enum numeric value on the wire for keyOrigin.
-
getKeyOrigin
public ServiceAccountKeyOrigin getKeyOrigin()
The key origin.
.google.iam.admin.v1.ServiceAccountKeyOrigin key_origin = 9;
- Specified by:
getKeyOrigin
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The keyOrigin.
-
getKeyTypeValue
public int getKeyTypeValue()
The key type.
.google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType key_type = 10;
- Specified by:
getKeyTypeValue
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The enum numeric value on the wire for keyType.
-
getKeyType
public ListServiceAccountKeysRequest.KeyType getKeyType()
The key type.
.google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType key_type = 10;
- Specified by:
getKeyType
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The keyType.
-
getDisabled
public boolean getDisabled()
The key status.
bool disabled = 11;
- Specified by:
getDisabled
in interfaceServiceAccountKeyOrBuilder
- Returns:
- The disabled.
-
isInitialized
public final boolean isInitialized()
- Specified by:
isInitialized
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Overrides:
isInitialized
in classcom.google.protobuf.GeneratedMessageV3
-
writeTo
public void writeTo(com.google.protobuf.CodedOutputStream output) throws IOException
- Specified by:
writeTo
in interfacecom.google.protobuf.MessageLite
- Overrides:
writeTo
in classcom.google.protobuf.GeneratedMessageV3
- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()
- Specified by:
getSerializedSize
in interfacecom.google.protobuf.MessageLite
- Overrides:
getSerializedSize
in classcom.google.protobuf.GeneratedMessageV3
-
equals
public boolean equals(Object obj)
- Specified by:
equals
in interfacecom.google.protobuf.Message
- Overrides:
equals
in classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacecom.google.protobuf.Message
- Overrides:
hashCode
in classcom.google.protobuf.AbstractMessage
-
parseFrom
public static ServiceAccountKey parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static ServiceAccountKey parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static ServiceAccountKey parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static ServiceAccountKey parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static ServiceAccountKey parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static ServiceAccountKey parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static ServiceAccountKey parseFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static ServiceAccountKey parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static ServiceAccountKey parseDelimitedFrom(InputStream input) throws IOException
- Throws:
IOException
-
parseDelimitedFrom
public static ServiceAccountKey parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
parseFrom
public static ServiceAccountKey parseFrom(com.google.protobuf.CodedInputStream input) throws IOException
- Throws:
IOException
-
parseFrom
public static ServiceAccountKey parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException
- Throws:
IOException
-
newBuilderForType
public ServiceAccountKey.Builder newBuilderForType()
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.Message
- Specified by:
newBuilderForType
in interfacecom.google.protobuf.MessageLite
-
newBuilder
public static ServiceAccountKey.Builder newBuilder()
-
newBuilder
public static ServiceAccountKey.Builder newBuilder(ServiceAccountKey prototype)
-
toBuilder
public ServiceAccountKey.Builder toBuilder()
- Specified by:
toBuilder
in interfacecom.google.protobuf.Message
- Specified by:
toBuilder
in interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected ServiceAccountKey.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
- Specified by:
newBuilderForType
in classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
public static ServiceAccountKey getDefaultInstance()
-
parser
public static com.google.protobuf.Parser<ServiceAccountKey> parser()
-
getParserForType
public com.google.protobuf.Parser<ServiceAccountKey> getParserForType()
- Specified by:
getParserForType
in interfacecom.google.protobuf.Message
- Specified by:
getParserForType
in interfacecom.google.protobuf.MessageLite
- Overrides:
getParserForType
in classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
public ServiceAccountKey getDefaultInstanceForType()
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageLiteOrBuilder
- Specified by:
getDefaultInstanceForType
in interfacecom.google.protobuf.MessageOrBuilder
-
-