命名空间:microsoft.graph
重要
Microsoft Graph /beta 版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
包含与应用程序或服务主体关联的密钥凭据。 在应用程序和服务主体实体的 keyCredentials 属性以及 onPremisesPublishing 的 verifiedCustomDomainKeyCredential 属性中配置为表示自定义域的密钥凭据。
若要使用 Microsoft Graph 添加 keyCredential,请参阅 使用 Microsoft Graph 将证书添加到应用。
属性
| 属性 | 类型 | 说明 |
|---|---|---|
| customKeyIdentifier | Binary | 可用于标识凭据的 40 个字符的二进制类型。 可选。 如果未在有效负载中提供,则默认为证书的指纹。 |
| displayName | String | 键的友好名称,最长 90 个字符。 接受较长的值,但会缩短。 可选。 |
| endDateTime | DateTimeOffset | 凭据过期的日期和时间。 DateTimeOffset 表示使用 ISO 8601 格式的日期和时间信息,并且始终处于 UTC 时间。 例如,2014 年 1 月 1 日午夜 UTC 为 2014-01-01T00:00:00Z。 |
| 注册表项 | Binary | 密钥凭据的值。 应为 Base64 编码值。 需要 $select 检索;仅适用于单个对象请求 (GET /applications/{applicationId}?$select=keyCredentials 或 GET /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 | 密钥凭据的类型;例如, Symmetric, AsymmetricX509Cert或 X509CertAndPassword。 |
| 用法 | String | 描述使用密钥的目的的字符串;例如 None、 DecryptVerifyDelegationSignPairwiseIdentifierEncryptHashedIdentifierSelfSignedTls或 。 如果 usage 是 Sign,则 类型 应为 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"
}