keyCredential 资源类型

命名空间:microsoft.graph

包含与应用程序或服务主体关联的密钥凭据。 应用程序和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 密钥的唯一标识符 (GUID) 。
startDateTime DateTimeOffset 凭据生效的日期和时间。时间戳类型使用 ISO 8601 格式表示日期和时间信息,并且始终采用 UTC 时间。 例如,2014 年 1 月 1 日午夜 UTC 为 2014-01-01T00:00:00Z
type String 密钥凭据的类型;例如 、 SymmetricAsymmetricX509Cert
使用 String 描述密钥的用途的字符串;例如 。 Verify

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"
}