keyCredential 资源类型

命名空间:microsoft.graph

重要

Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。

包含与应用程序或服务主体关联的密钥凭据。 应用程序和servicePrincipal 实体的 keyCredentials 属性是 keyCredential 的集合。

若要使用 Microsoft Graph 添加 keyCredential,请参阅 使用 Microsoft Graph 向应用添加证书

属性

属性 类型 说明
customKeyIdentifier 二进制 可用于标识凭据的 40 个字符的二进制类型。 可选。 如果未在有效负载中提供,则默认为证书的指纹。
displayName String 键的友好名称。 可选。
endDateTime DateTimeOffset 凭据过期的日期和时间。 DateTimeOffset 表示使用 ISO 8601 格式的日期和时间信息,并且始终处于 UTC 时间。 例如,2014 年 1 月 1 日午夜 UTC 为 2014-01-01T00:00:00Z
注册表项 二进制 密钥凭据的值。 应为 Base64 编码值。 仅 $select 针对单个 对象返回 ,即 GET applications/{applicationId}?$select=keyCredentialsGET servicePrincipals/{servicePrincipalId}?$select=keyCredentials;否则,它始终 null为 。

.cer 证书中,可以使用 Convert.ToBase64String () 方法读取密钥。 有关详细信息,请参阅 获取证书密钥
keyId Guid 密钥的唯一标识符。
startDateTime DateTimeOffset 凭据生效的日期和时间。时间戳类型使用 ISO 8601 格式表示日期和时间信息,并且始终采用 UTC 时间。 例如,2014 年 1 月 1 日午夜 UTC 为 2014-01-01T00:00:00Z
type String 密钥凭据的类型;例如 、 SymmetricAsymmetricX509CertX509CertAndPassword
使用 String 描述密钥的用途的字符串;例如、NoneVerifyPairwiseIdentifierDelegationDecryptEncryptHashedIdentifierSelfSignedTls、 或 Sign

如果 usageSign,则 类型 应为 X509CertAndPassword,并且应定义用于签名的 passwordCredentials

JSON 表示形式

下面是资源的 JSON 表示形式。

{
  "@odata.type": "#microsoft.graph.keyCredential",
  "customKeyIdentifier": "Binary",
  "displayName": "String",
  "endDateTime": "String (timestamp)",
  "key": "Binary",
  "keyId": "Guid",
  "startDateTime": "String (timestamp)",
  "type": "String",
  "usage": "String"
}