我要评分
获取效率
正确性
完整性
易理解

KdcProxyIdentityRegister

Registers the identity with kdc_agent. This function must be called once after the URL and certificate configurations are complete.

Prototype

uint32_t KdcProxyIdentityRegister();

Parameters

None

Return Values

Return Value

Description

0

Success

Non-zero

Failure

Precautions

  1. This function can be called only after SetRAAgentTokenUrl, SetKdcAgentUrl, and certificate configuration APIs (SetCaFile, SetTlsCertAndKeyFile, and SetCrlFile) are all complete.
  2. This function needs to be called only once during kdc_proxy startup.
  3. Identity registration must be completed before KdcTrustedRequest is called.

Examples

  1. Configure the URLs and certificates.
    SetRAAgentTokenUrl("https://api.example.com/global-trust-authority/agent/v1/tokens");
    SetKdcAgentUrl("https://127.0.0.1:26068/rest/kdc_agent/v1/proxy");
    SetCaFile("/path/to/ca.crt");
    SetTlsCertAndKeyFile("/path/to/tls.crt", "/path/to/tls.key", NULL);
  2. Register the identity (called once at startup).
    uint32_t ret = KdcProxyIdentityRegister();
    if (ret != 0){
    // Handle the error.
    return;
    }