С моей точки зрения, я в точности следую документации. Мой JSON выглядит так:
{
"keyCredentials": [
{
"customKeyIdentifier": "ZWxYN1pOc21Od3NJUU4rYjduTUNxclJ5emtrPQ==",
"endDateTime": "2030-07-08T16:06:27+02:00",
"keyId": "a3892889-b097-4c36-ac69-5fb3d18d2396",
"startDateTime": "2020-07-09T16:06:27+02:00",
"type": "AsymmetricX509Cert",
"usage": "Sign",
"key": "MIIC1TCCAb2gAwIBAgIIK2yf8UkTD3swDQYJKoZIhvcNAQELBQAwETEPMA0GA1UEAxMGYXdzQVBJMB4XDTIwMDcwOTE0MDYyN1oXDTMwMDcwODE0MDYyN1owETEPMA0GA1UEAxMGYXdzQVBJMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnF4Ue9mB3nhueo+L/ZxPr1GmO/Iqx2upXdwBm7xZFwZ59rV2MSb66RZXOaUQlqERQjfmbdADwmNN4XWSk6oR7h8LFz8/+LLf2ZVVJbq6mnuTtLX11uGpKi6dpObMC0nqDLu/hwApcjSiMS8VtdP9QyJNtydE4+T0aXGDOL34ZDRlxKY+1uy1w3KI6ZFYib7c4/cJ1+PDr9YdC4hu8dus6fzVRE9v63Rg/CjiHIXaWiaOcftw5wOh9rS4qtvrI+u+muIYQrvkR+Ex1aAwKo/T5aDnj/kHRXsNV1qpZxT1cqtJNON3feYD7Il8lkXOuBPdPVccsNLvAgHfiEYUwnFE+QIDAQABozEwLzALBgNVHQ8EBAMCBaAwIAYDVR0lAQH/BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IBAQAjpVAJOwl1gN22hNm98cw0+a1o+m1W4jp9WPe2Qovhu8wvY22xPwPL53iZuPFLe+4aHGIgdO4GXPt19xGH1qZAhITLzeUillCnMvx55ufLOYB95J4V8r8cfT7IO2OYpeHe4kiUCeDNt80F62PLVopONdf7Z9ULrSG8gX6GSVDPz6kqK2t7fAre9ppjkUfQOwtY+ybwtao7Awa9+xafvVz1LGZubuUESXOozeY0SRezOlUaJd5h94vHXKMk8ZmtUZaOXnujfGcZKErkEmgNhtBoc4OtDkAZpDXfDlOrY+Tea8eOejiz9+O4WNsYOXoZ2TLS3YY6IFKDsRj+M3sm7A87",
"displayName": "CN=awsAPI",
"@odata.type": "microsoft.graph.keyCredential"
},
{
"customKeyIdentifier": "ZWxYN1pOc21Od3NJUU4rYjduTUNxclJ5emtrPQ==",
"endDateTime": "2030-07-08T16:06:27+02:00",
"keyId": "b022f959-3f36-4880-8537-265f62ba9df0",
"startDateTime": "2020-07-09T16:06:27+02:00",
"type": "AsymmetricX509Cert",
"usage": "Verify",
"key": "MIIC1TCCAb2gAwIBAgIIK2yf8UkTD3swDQYJKoZIhvcNAQELBQAwETEPMA0GA1UEAxMGYXdzQVBJMB4XDTIwMDcwOTE0MDYyN1oXDTMwMDcwODE0MDYyN1owETEPMA0GA1UEAxMGYXdzQVBJMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnF4Ue9mB3nhueo+L/ZxPr1GmO/Iqx2upXdwBm7xZFwZ59rV2MSb66RZXOaUQlqERQjfmbdADwmNN4XWSk6oR7h8LFz8/+LLf2ZVVJbq6mnuTtLX11uGpKi6dpObMC0nqDLu/hwApcjSiMS8VtdP9QyJNtydE4+T0aXGDOL34ZDRlxKY+1uy1w3KI6ZFYib7c4/cJ1+PDr9YdC4hu8dus6fzVRE9v63Rg/CjiHIXaWiaOcftw5wOh9rS4qtvrI+u+muIYQrvkR+Ex1aAwKo/T5aDnj/kHRXsNV1qpZxT1cqtJNON3feYD7Il8lkXOuBPdPVccsNLvAgHfiEYUwnFE+QIDAQABozEwLzALBgNVHQ8EBAMCBaAwIAYDVR0lAQH/BBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMA0GCSqGSIb3DQEBCwUAA4IBAQAjpVAJOwl1gN22hNm98cw0+a1o+m1W4jp9WPe2Qovhu8wvY22xPwPL53iZuPFLe+4aHGIgdO4GXPt19xGH1qZAhITLzeUillCnMvx55ufLOYB95J4V8r8cfT7IO2OYpeHe4kiUCeDNt80F62PLVopONdf7Z9ULrSG8gX6GSVDPz6kqK2t7fAre9ppjkUfQOwtY+ybwtao7Awa9+xafvVz1LGZubuUESXOozeY0SRezOlUaJd5h94vHXKMk8ZmtUZaOXnujfGcZKErkEmgNhtBoc4OtDkAZpDXfDlOrY+Tea8eOejiz9+O4WNsYOXoZ2TLS3YY6IFKDsRj+M3sm7A87",
"displayName": "CN=awsAPI",
"@odata.type": "microsoft.graph.keyCredential"
}
],
"@odata.type": "microsoft.graph.servicePrincipal"
}
Как видите, я использую значения Sign и Verify для свойства «usage»
Error: Code: Request_BadRequest
Message: The value for the property "usage" in one of your credentials is invalid. Acceptable values are Sign, Verify.
Для воспроизведения ошибки выше я оставил клавиши неукороченными