Claude Platform Docs

외부 키 검증

client.Organization.ExternalKeys.Validate(ctx, externalKeyID) (*OrganizationExternalKeyValidateResponse, error)
POST/v1/organizations/external_keys/{external_key_id}/validate

고객의 KMS를 대상으로 외부 키 구성을 검증합니다.

Anthropic은 구성된 KMS 키로 암호화/복호화 왕복을 수행하고 결과를 최대 30초 동안 기다립니다. 왕복이 성공하면 응답 상태는 success이고, 실패하거나 시간 초과되면 오류 메시지와 함께 failure입니다.

Parameters
externalKeyID string⁠Path parameter

ID of the External Key.

maxLength2048
Returns
type OrganizationExternalKeyValidateResponse struct { Type: "external_key_validation"; Error; Status }

Result of a validation roundtrip against the customer's KMS.

HTTP 200 for both outcomes — the operation completed; status says whether the key works.

Type ExternalKeyValidation
defaultexternal_key_validation
Error string

Error message when status is failure. Null otherwise.

Status OrganizationExternalKeyValidateResponseStatus

success — encrypt/decrypt roundtrip succeeded. failure — the roundtrip failed or timed out; see error.

One of the following:
const OrganizationExternalKeyValidateResponseStatusFailure OrganizationExternalKeyValidateResponseStatus = "failure"
const OrganizationExternalKeyValidateResponseStatusSuccess OrganizationExternalKeyValidateResponseStatus = "success"
외부 키 검증
package main

import (
	"context"
	"fmt"

	"github.com/anthropics/anthropic-sdk-go"
	"github.com/anthropics/anthropic-sdk-go/option"
)

func main() {
	client := anthropic.NewClient(
		option.WithAPIKey("my-anthropic-api-key"),
	)
	response, err := client.Organization.ExternalKeys.Validate(context.TODO(), "external_key_id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", response.Error)
}
Returns Examples
Response 200
{
  "error": "error",
  "status": "failure",
  "type": "external_key_validation"
}