Windows Media Format SDK banner art
PreviousNext

Implementing the Secure Authenticated Channel

A static link library, Mssachlp.lib, is provided that includes two classes to help an application authenticate a component using the IComponentAuthenticate interface. The library also includes code to simplify implementation of the IComponentAuthenticate methods.

For more information about using and implementing SAC, see Secure Authenticated Channel Interface                                                                                                                                                                                                                          .

The authentication classes are:

class CSecureChannelClient
{
public:
    CSecureChannelClient();
    ~CSecureChannelClient();
    HRESULT SetCertificate(
        DWORD dwFlags, 
        BYTE *pbAppCert, 
        DWORD dwCertLen, 
        BYTE *pbAppPVK, 
        DWORD dwPVKLen); 
   void SetInterface(
        IComponentAuthenticate *pComponentAuth); 
    HRESULT Authenticate(
        DWORD dwProtocolID); 
    HRESULT EncryptParam(
        BYTE *pbData, 
        DWORD dwDataLen); 
    HRESULT DecryptParam(
        BYTE *pbData, 
        DWORD dwDataLen); 
    HRESULT MACInit(
        HMAC *phMAC); 
    HRESULT MACUpdate(
        HMAC hMAC, 
        BYTE *pbData, 
        DWORD dwDataLen); 
    HRESULT MACFinal(
        HMAC hMAC, 
        BYTE abData[SAC_MAC_LEN]); 
    HRESULT GetAppSec(
        DWORD *pdwLocalAppSec, 
        DWORD *pdwRemoteAppSec); 
    HRESULT SetSessionKey(
        BYTE *pbSPSessionKey); 
    HRESULT GetSessionKey(
        BYTE *pbSPSessionKey); 
    BOOL fIsAuthenticated();
};

class CSecureChannelServer
{
public:
    CSecureChannelServer();
    ~CSecureChannelServer();
    HRESULT SetCertificate(
        DWORD dwFlags, 
        BYTE *pbAppCert, 
        DWORD dwCertLen, 
        BYTE *pbAppPVK, 
        DWORD dwPVKLen); 
    HRESULT SACAuth(
        DWORD dwProtocolID, 
        DWORD dwPass, 
        BYTE *pbDataIn, 
        DWORD dwDataInLen, 
        BYTE **ppbDataOut, 
        DWORD *pdwDataOutLen); 
    HRESULT SACGetProtocols(
        DWORD **ppdwProtocols, 
        DWORD *pdwProtocolCount); 
    HRESULT EncryptParam(
        BYTE *pbData, 
        DWORD dwDataLen); 
    HRESULT DecryptParam(
        BYTE *pbData, 
        DWORD dwDataLen); 
    HRESULT MACInit(
        HMAC *phMAC); 
    HRESULT MACUpdate(
        HMAC hMAC, 
        BYTE *pbData, 
        DWORD dwDataLen); 
    HRESULT MACFinal(
        HMAC hMAC, 
        BYTE abData[SAC_MAC_LEN]); 
    HRESULT GetAppSec(
        DWORD *pdwLocalAppSec, 
        DWORD *pdwRemoteAppSec); 
    HRESULT SetSessionKey(
        BYTE *pbSPSessionKey); 
    HRESULT GetSessionKey(
        BYTE *pbSPSessionKey); 
    BOOL fIsAuthenticated(); 
}; 
PreviousNext


© 1999 Microsoft Corporation. All rights reserved.