Go
package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
keys "github.com/auth0/go-auth0/management/management/keys"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &keys.ImportEncryptionKeyRequestContent{
WrappedKey: "wrapped_key",
}
client.Keys.Encryption.Import(
context.TODO(),
"kid",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.keys.encryption.import("kid", {
wrappedKey: "wrapped_key",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.keys.encryption.import("kid", {
wrappedKey: "wrapped_key",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/keys/encryption/{kid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wrapped_key": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/keys/encryption/{kid}"
payload = { "wrapped_key": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/keys/encryption/{kid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wrapped_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/keys/encryption/{kid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wrapped_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/keys/encryption/{kid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wrapped_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"kid": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"parent_kid": "<string>",
"public_key": "<string>"
}Import the encryption key
Import wrapped key material and activate encryption key.
POST
https://{tenantDomain}/api/v2
/
keys
/
encryption
/
{kid}
Go
package example
import (
context "context"
client "github.com/auth0/go-auth0/management/management/client"
keys "github.com/auth0/go-auth0/management/management/keys"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := &keys.ImportEncryptionKeyRequestContent{
WrappedKey: "wrapped_key",
}
client.Keys.Encryption.Import(
context.TODO(),
"kid",
request,
)
}import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.keys.encryption.import("kid", {
wrappedKey: "wrapped_key",
});
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.keys.encryption.import("kid", {
wrappedKey: "wrapped_key",
});
}
main();curl --request POST \
--url https://{tenantDomain}/api/v2/keys/encryption/{kid} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"wrapped_key": "<string>"
}
'import requests
url = "https://{tenantDomain}/api/v2/keys/encryption/{kid}"
payload = { "wrapped_key": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{tenantDomain}/api/v2/keys/encryption/{kid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'wrapped_key' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://{tenantDomain}/api/v2/keys/encryption/{kid}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"wrapped_key\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{tenantDomain}/api/v2/keys/encryption/{kid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"wrapped_key\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"kid": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"parent_kid": "<string>",
"public_key": "<string>"
}Autorisations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Paramètres de chemin
Encryption key ID
Corps
application/jsonapplication/x-www-form-urlencoded
Base64 encoded ciphertext of key material wrapped by public wrapping key.
Réponse
The key was successfully imported.
Encryption key
Key ID
Key type
Options disponibles:
customer-provided-root-key, environment-root-key, tenant-master-key, tenant-encryption-key Key state
Options disponibles:
pre-activation, active, deactivated, destroyed Key creation timestamp
Key update timestamp
ID of parent wrapping key
Public key in PEM format
⌘I