Package com.microsoft.graph.models
Class KeyCredential
java.lang.Object
com.microsoft.graph.models.KeyCredential
- All Implemented Interfaces:
com.microsoft.kiota.serialization.AdditionalDataHolder,com.microsoft.kiota.serialization.Parsable,com.microsoft.kiota.store.BackedModel
@Generated("com.microsoft.kiota")
public class KeyCredential
extends Object
implements com.microsoft.kiota.serialization.AdditionalDataHolder, com.microsoft.kiota.store.BackedModel, com.microsoft.kiota.serialization.Parsable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.microsoft.kiota.store.BackingStoreStores model information. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic KeyCredentialcreateFromDiscriminatorValue(com.microsoft.kiota.serialization.ParseNode parseNode) Creates a new instance of the appropriate class based on discriminator valueGets the AdditionalData property value.com.microsoft.kiota.store.BackingStoreGets the backingStore property value.byte[]Gets the customKeyIdentifier property value.Gets the displayName property value.Gets the endDateTime property value.The deserialization information for the current modelbyte[]getKey()Gets the key property value.getKeyId()Gets the keyId property value.Gets the @odata.type property value.Gets the startDateTime property value.getType()Gets the type property value.getUsage()Gets the usage property value.voidserialize(com.microsoft.kiota.serialization.SerializationWriter writer) Serializes information the current objectvoidsetAdditionalData(Map<String, Object> value) Sets the AdditionalData property value.voidsetBackingStore(com.microsoft.kiota.store.BackingStore value) Sets the backingStore property value.voidsetCustomKeyIdentifier(byte[] value) Sets the customKeyIdentifier property value.voidsetDisplayName(String value) Sets the displayName property value.voidsetEndDateTime(OffsetDateTime value) Sets the endDateTime property value.voidsetKey(byte[] value) Sets the key property value.voidSets the keyId property value.voidsetOdataType(String value) Sets the @odata.type property value.voidsetStartDateTime(OffsetDateTime value) Sets the startDateTime property value.voidSets the type property value.voidSets the usage property value.
-
Field Details
-
backingStore
@Nonnull protected com.microsoft.kiota.store.BackingStore backingStoreStores model information.
-
-
Constructor Details
-
KeyCredential
public KeyCredential()Instantiates a newKeyCredentialand sets the default values.
-
-
Method Details
-
createFromDiscriminatorValue
@Nonnull public static KeyCredential createFromDiscriminatorValue(@Nonnull com.microsoft.kiota.serialization.ParseNode parseNode) Creates a new instance of the appropriate class based on discriminator value- Parameters:
parseNode- The parse node to use to read the discriminator value and create the object- Returns:
- a
KeyCredential
-
getAdditionalData
Gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. -
getBackingStore
@Nonnull public com.microsoft.kiota.store.BackingStore getBackingStore()Gets the backingStore property value. Stores model information.- Specified by:
getBackingStorein interfacecom.microsoft.kiota.store.BackedModel- Returns:
- a
BackingStore
-
getCustomKeyIdentifier
@Nullable public byte[] getCustomKeyIdentifier()Gets the customKeyIdentifier property value. A 40-character binary type that can be used to identify the credential. Optional. When not provided in the payload, defaults to the thumbprint of the certificate.- Returns:
- a
invalid reference
byte[]
-
getDisplayName
Gets the displayName property value. The friendly name for the key, with a maximum length of 90 characters. Longer values are accepted but shortened. Optional.- Returns:
- a
String
-
getEndDateTime
Gets the endDateTime property value. The date and time at which the credential expires. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.- Returns:
- a
OffsetDateTime
-
getFieldDeserializers
@Nonnull public Map<String,Consumer<com.microsoft.kiota.serialization.ParseNode>> getFieldDeserializers()The deserialization information for the current model -
getKey
@Nullable public byte[] getKey()Gets the key property value. The certificate's raw data in byte array converted to Base64 string. Returned only on $select for a single object, that is, GET applications/{applicationId}?$select=keyCredentials or GET servicePrincipals/{servicePrincipalId}?$select=keyCredentials; otherwise, it's always null. From a .cer certificate, you can read the key using the Convert.ToBase64String() method. For more information, see Get the certificate key.- Returns:
- a
invalid reference
byte[]
-
getKeyId
Gets the keyId property value. The unique identifier (GUID) for the key.- Returns:
- a
UUID
-
getOdataType
Gets the @odata.type property value. The OdataType property- Returns:
- a
String
-
getStartDateTime
Gets the startDateTime property value. The date and time at which the credential becomes valid.The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.- Returns:
- a
OffsetDateTime
-
getType
Gets the type property value. The type of key credential; for example, Symmetric, AsymmetricX509Cert.- Returns:
- a
String
-
getUsage
Gets the usage property value. A string that describes the purpose for which the key can be used; for example, Verify.- Returns:
- a
String
-
serialize
public void serialize(@Nonnull com.microsoft.kiota.serialization.SerializationWriter writer) Serializes information the current object- Specified by:
serializein interfacecom.microsoft.kiota.serialization.Parsable- Parameters:
writer- Serialization writer to use to serialize this model
-
setAdditionalData
Sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.- Parameters:
value- Value to set for the AdditionalData property.
-
setBackingStore
public void setBackingStore(@Nonnull com.microsoft.kiota.store.BackingStore value) Sets the backingStore property value. Stores model information.- Parameters:
value- Value to set for the backingStore property.
-
setCustomKeyIdentifier
public void setCustomKeyIdentifier(@Nullable byte[] value) Sets the customKeyIdentifier property value. A 40-character binary type that can be used to identify the credential. Optional. When not provided in the payload, defaults to the thumbprint of the certificate.- Parameters:
value- Value to set for the customKeyIdentifier property.
-
setDisplayName
Sets the displayName property value. The friendly name for the key, with a maximum length of 90 characters. Longer values are accepted but shortened. Optional.- Parameters:
value- Value to set for the displayName property.
-
setEndDateTime
Sets the endDateTime property value. The date and time at which the credential expires. The DateTimeOffset type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.- Parameters:
value- Value to set for the endDateTime property.
-
setKey
public void setKey(@Nullable byte[] value) Sets the key property value. The certificate's raw data in byte array converted to Base64 string. Returned only on $select for a single object, that is, GET applications/{applicationId}?$select=keyCredentials or GET servicePrincipals/{servicePrincipalId}?$select=keyCredentials; otherwise, it's always null. From a .cer certificate, you can read the key using the Convert.ToBase64String() method. For more information, see Get the certificate key.- Parameters:
value- Value to set for the key property.
-
setKeyId
Sets the keyId property value. The unique identifier (GUID) for the key.- Parameters:
value- Value to set for the keyId property.
-
setOdataType
Sets the @odata.type property value. The OdataType property- Parameters:
value- Value to set for the @odata.type property.
-
setStartDateTime
Sets the startDateTime property value. The date and time at which the credential becomes valid.The Timestamp type represents date and time information using ISO 8601 format and is always in UTC time. For example, midnight UTC on Jan 1, 2014 is 2014-01-01T00:00:00Z.- Parameters:
value- Value to set for the startDateTime property.
-
setType
Sets the type property value. The type of key credential; for example, Symmetric, AsymmetricX509Cert.- Parameters:
value- Value to set for the type property.
-
setUsage
Sets the usage property value. A string that describes the purpose for which the key can be used; for example, Verify.- Parameters:
value- Value to set for the usage property.
-