POST https://graph.microsoft.com/beta/trustFramework/keySets
Content-type: application/json
{
"id": "keyset1"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = 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 = 99L,
Nbf = 99L,
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",
},
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.TrustFramework.KeySets.PostAsync(requestBody);
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TrustFrameworkKeySet trustFrameworkKeySet = new TrustFrameworkKeySet();
trustFrameworkKeySet.setId("keyset1");
LinkedList<TrustFrameworkKey> keys = new LinkedList<TrustFrameworkKey>();
TrustFrameworkKey trustFrameworkKey = new TrustFrameworkKey();
trustFrameworkKey.setK("k-value");
LinkedList<String> x5c = new LinkedList<String>();
x5c.add("x5c-value");
trustFrameworkKey.setX5c(x5c);
trustFrameworkKey.setX5t("x5t-value");
trustFrameworkKey.setKty("kty-value");
trustFrameworkKey.setUse("use-value");
trustFrameworkKey.setExp(99L);
trustFrameworkKey.setNbf(99L);
trustFrameworkKey.setKid("kid-value");
trustFrameworkKey.setE("e-value");
trustFrameworkKey.setN("n-value");
trustFrameworkKey.setD("d-value");
trustFrameworkKey.setP("p-value");
trustFrameworkKey.setQ("q-value");
trustFrameworkKey.setDp("dp-value");
trustFrameworkKey.setDq("dq-value");
trustFrameworkKey.setQi("qi-value");
keys.add(trustFrameworkKey);
trustFrameworkKeySet.setKeys(keys);
TrustFrameworkKeySet result = graphClient.trustFramework().keySets().post(trustFrameworkKeySet);
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.models.trust_framework_key_set import TrustFrameworkKeySet
from msgraph_beta.generated.models.trust_framework_key import TrustFrameworkKey
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TrustFrameworkKeySet(
id = "keyset1",
keys = [
TrustFrameworkKey(
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",
),
],
)
result = await graph_client.trust_framework.key_sets.post(request_body)