APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Create a new trustFrameworkKeySet. The ID of the trustFrameworkKeySet is expected in the create request; however, it can be modified by the service. The modified ID will be available in the response and in the location header.
Permissions
One of the following permissions is required to call this API. To learn more, including how to choose permissions, see Permissions.
Permission type
Permissions (from least to most privileged)
Delegated (work or school account)
TrustFrameworkKeySet.ReadWrite.All
Delegated (personal Microsoft account)
Not supported.
Application
TrustFrameworkKeySet.ReadWrite.All
HTTP request
POST /trustFramework/keySets
Request headers
Name
Description
Authorization
Bearer {token}. Required.
Content-type
application/json. Required.
Request body
In the request body, supply a JSON representation of a trustFrameworkKeySet object.
Response
If successful, this method returns a 201 Created response code, a location header for the newly created object, and a new trustFrameworkKeySet object in the response body.
Examples
Example 1: Create an empty keyset
This is one of the most useful operations. First, you create an empty keyset. Then, in the new keyset, you can generate a key, upload a manual secret, and upload a certificate or a PKCS12 key.
POST https://graph.microsoft.com/beta/trustFramework/keySets
Content-type: application/json
{
"id": "keyset1"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var trustFrameworkKeySet = new TrustFrameworkKeySet
{
Id = "keyset1",
Keys = new List<TrustFrameworkKey>()
{
new TrustFrameworkKey
{
K = "k-value",
X5c = new List<String>()
{
"x5c-value"
},
X5t = "x5t-value",
Kty = "kty-value",
Use = "use-value",
Exp = 99,
Nbf = 99,
Kid = "kid-value",
E = "e-value",
N = "n-value",
D = "d-value",
P = "p-value",
Q = "q-value",
Dp = "dp-value",
Dq = "dq-value",
Qi = "qi-value"
}
}
};
await graphClient.TrustFramework.KeySets
.Request()
.AddAsync(trustFrameworkKeySet);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := graphmodels.NewTrustFrameworkKeySet()
id := "keyset1"
requestBody.SetId(&id)
trustFrameworkKey := graphmodels.NewTrustFrameworkKey()
k := "k-value"
trustFrameworkKey.SetK(&k)
x5c := []String {
"x5c-value",
}
trustFrameworkKey.SetX5c(x5c)
x5t := "x5t-value"
trustFrameworkKey.SetX5t(&x5t)
kty := "kty-value"
trustFrameworkKey.SetKty(&kty)
use := "use-value"
trustFrameworkKey.SetUse(&use)
exp := int64(99)
trustFrameworkKey.SetExp(&exp)
nbf := int64(99)
trustFrameworkKey.SetNbf(&nbf)
kid := "kid-value"
trustFrameworkKey.SetKid(&kid)
e := "e-value"
trustFrameworkKey.SetE(&e)
n := "n-value"
trustFrameworkKey.SetN(&n)
d := "d-value"
trustFrameworkKey.SetD(&d)
p := "p-value"
trustFrameworkKey.SetP(&p)
q := "q-value"
trustFrameworkKey.SetQ(&q)
dp := "dp-value"
trustFrameworkKey.SetDp(&dp)
dq := "dq-value"
trustFrameworkKey.SetDq(&dq)
qi := "qi-value"
trustFrameworkKey.SetQi(&qi)
keys := []graphmodels.TrustFrameworkKeyable {
trustFrameworkKey,
}
requestBody.SetKeys(keys)
result, err := graphClient.TrustFramework().KeySets().Post(requestBody)
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
Import-Module Microsoft.Graph.Identity.SignIns
$params = @{
Id = "keyset1"
Keys = @(
@{
K = "k-value"
X5c = @(
"x5c-value"
)
X5t = "x5t-value"
Kty = "kty-value"
Use = "use-value"
Exp = 99
Nbf = 99
Kid = "kid-value"
E = "e-value"
N = "n-value"
D = "d-value"
P = "p-value"
Q = "q-value"
Dp = "dp-value"
Dq = "dq-value"
Qi = "qi-value"
}
)
}
New-MgTrustFrameworkKeySet -BodyParameter $params
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.
<?php
// THIS SNIPPET IS A PREVIEW FOR THE KIOTA BASED SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($requestAdapter);
$requestBody = new TrustFrameworkKeySet();
$requestBody->setId('keyset1');
$keysTrustFrameworkKey1 = new TrustFrameworkKey();
$keysTrustFrameworkKey1->setK('k-value');
$keysTrustFrameworkKey1->setX5c(['x5c-value', ]);
$keysTrustFrameworkKey1->setX5t('x5t-value');
$keysTrustFrameworkKey1->setKty('kty-value');
$keysTrustFrameworkKey1->setUse('use-value');
$keysTrustFrameworkKey1->setExp(exp);
$keysTrustFrameworkKey1->setNbf(nbf);
$keysTrustFrameworkKey1->setKid('kid-value');
$keysTrustFrameworkKey1->setE('e-value');
$keysTrustFrameworkKey1->setN('n-value');
$keysTrustFrameworkKey1->setD('d-value');
$keysTrustFrameworkKey1->setP('p-value');
$keysTrustFrameworkKey1->setQ('q-value');
$keysTrustFrameworkKey1->setDp('dp-value');
$keysTrustFrameworkKey1->setDq('dq-value');
$keysTrustFrameworkKey1->setQi('qi-value');
$keysArray []= $keysTrustFrameworkKey1;
$requestBody->setKeys($keysArray);
$requestResult = $graphServiceClient->trustFramework()->keySets()->post($requestBody);
Important
Microsoft Graph SDKs use the v1.0 version of the API by default, and do not support all the types, properties, and APIs available in the beta version. For details about accessing the beta API with the SDK, see Use the Microsoft Graph SDKs with the beta API.