드라이버 인증서 체인 가져오기

[이 페이지와 연결된 기능인 DirectShow는 레거시 기능입니다. MediaPlayer, IMFMediaEngine 및 Media Foundation의 오디오/비디오 캡처로 대체되었습니다. 이러한 기능은 Windows 10 및 Windows 11 최적화되었습니다. 가능한 경우 새 코드가 DirectShow 대신 Media Foundation에서 MediaPlayer, IMFMediaEngine오디오/비디오 캡처를 사용하는 것이 좋습니다. 가능한 경우 레거시 API를 사용하는 기존 코드를 다시 작성하여 새 API를 사용하도록 제안합니다.]

COPP(Certified Output Protection Protocol)를 사용하려면 애플리케이션이 먼저 비디오 혼합 렌더링 필터(VMR-7 또는 VMR-9)를 포함하는 DirectShow 그래프를 빌드해야 합니다. 이전 Video Renderer 필터는 COPP를 지원하지 않습니다. COPP 메서드를 호출하기 전에 애플리케이션은 비디오 재생 그래프를 빌드하고 디코더를 VMR 필터의 입력 핀에 연결해야 합니다. 비디오 파일을 재생할 필요는 없습니다.

그래프를 빌드한 후 IAMCertifiedOutputProtection 인터페이스에 대한 VMR을 쿼리한 다음 IAMCertifiedOutputProtection::KeyExchange를 호출합니다. 이 메서드는 GUID로 입력된 128비트 난수를 반환하고 드라이버의 XML 인증서 체인을 UTF-8 형식으로 포함하는 바이트 배열에 대한 포인터를 반환합니다. 다음 코드는 인증서 체인을 가져오는 방법을 보여줍니다.

GUID guidRandom;
BYTE *pbCertificateChain = NULL;
DWORD cbCertificateChainLen;   // Size of the certificate chain, in bytes.
hr = pCOPP->KeyExchange(&guidRandom, &pbCertificateChain,
         &cbCertificateChainLen);
if (SUCCEEDED(hr))
{
    // TODO: Validate the certificate chain and get the driver's
    // public key. 

    // When you are done, free the buffer that contains the 
    // certificate chain.
    CoTaskMemFree(pbCertificateChain);
}

COPP(Certified Output Protection Protocol) 사용