Share via


ICertServerPolicy::GetRequestAttribute 메서드(certif.h)

GetRequestAttribute 메서드는 요청에서 명명된 특성을 반환합니다.

구문

HRESULT GetRequestAttribute(
  [in]  const BSTR strAttributeName,
  [out] BSTR       *pstrAttributeValue
);

매개 변수

[in] strAttributeName

검색할 특성의 이름입니다.

[out] pstrAttributeValue

특성 값을 포함할 BSTR 값에 대한 포인터입니다.

반환 값

C++

메서드가 성공하면 메서드는 S_OK 반환하고 *pstrAttributeValue 는 특성 값이 포함된 BSTR 로 설정됩니다.

이 메서드를 사용하려면 BSTR 형식의 변수를 만들고, 변수를 NULL로 설정하고, 이 변수의 주소를 pstrAttributeValue로 전달합니다.

BSTR 사용을 마쳤으면 SysFreeString 함수를 호출하여 해제합니다.

메서드가 실패하면 오류를 나타내는 HRESULT 값이 반환됩니다. 일반적인 오류 코드 목록은 일반적인 HRESULT 값을 참조하세요.

VB

반환 값은 특성 값을 나타내는 문자열입니다.

설명

이 메서드를 사용하기 전에 ICertServerPolicy::SetContext 를 호출해야 합니다.

다음 요청 특성은 KEYGEN 스타일 요청에 고유합니다.

속성 이름 Type Description
과제 String 요청과 함께 제공되는 챌린지 문자열입니다.
ExpectedChallenge String 챌린지 문자열이 올바르지 않으면 서버는 오류를 진단할 수 있도록 이 요청 특성의 값을 예상된 챌린지로 설정합니다.
 

예제

BSTR     bstrAttribValue = NULL;
HRESULT  hr;

// Get the request attribute.
// bstrAttribName is BSTR assigned by EnumerateAttributes.
// pCertServerPolicy has been used to call SetContext previously.
hr = pCertServerPolicy->GetRequestAttribute(bstrAttribName,
                                            &bstrAttribValue);

if (FAILED(hr))
{
    printf("Failed GetRequestAttribute [%x]\n", hr);
    goto error;
}
else
{

    // Successful call. Use the bstrAttribValue as needed.
    // ...
}

// Done processing. Free BSTR.
if (NULL != bstrAttribValue)
    SysFreeString(bstrAttribValue);

요구 사항

요구 사항
지원되는 최소 클라이언트 지원되는 버전 없음
지원되는 최소 서버 Windows Server 2003 [데스크톱 앱만 해당]
대상 플랫폼 Windows
헤더 certif.h(Certsrv.h 포함)
라이브러리 Certidl.lib
DLL Certcli.dll

추가 정보

ICertServerPolicy

ICertServerPolicy::SetContext