⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rmaauth.pas

📁 Delphi源码REAlRMSDK.rar
💻 PAS
字号:
unit RmaAuth;

interface

uses
  PnResult, PnTypes, RmaPckts;

(****************************************************************************
 *
 *  $Id: rmaauth.h,v 1.18 1999/01/29 18:32:10 hboone Exp $
 *
 *  Copyright (C) 1995-1999 RealNetworks, Inc. All rights reserved.
 *
 *  http://www.real.com/devzone
 *
 *  This program contains proprietary
 *  information of Progressive Networks, Inc, and is licensed
 *  subject to restrictions on use and distribution.
 *
 *  Authentication and password interfaces.
 *
 *)

(****************************************************************************
 *
 *  Interface:
 *
 *      IRMAAuthenticatorRequest
 *
 *  Purpose:
 *
 *      Request object for the Authenticator class.
 *
 *  IID_IRMAAuthenticatorRequest:
 *
 *      {00001802-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMAAuthenticatorRequest: TGUID = '{00001802-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAAuthenticatorRequest}

type
  IRMAAuthenticatorRequest = interface (IUnknown)
  ['{00001802-0901-11d1-8B06-00A024406D59}']

    (* GetAuthValues is called by the Authenticator object when it
     * needs to know the authorization info for this transaction.
     *
     * This object should call AuthValuesReady when ready.
     *)

    function GetAuthValues(pOrigValues: IRMAValues): HRESULT; stdcall;

  end;
  {$EXTERNALSYM IRMAAuthenticatorRequest}

(****************************************************************************
 *
 *  Interface:
 *
 *      IRMAAuthenticatorResponse
 *
 *  Purpose:
 *
 *      Response object for the Authenticator class.
 *
 *  IID_IRMAAuthenticatorResponse:
 *
 *      {00001801-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMAAuthenticatorResponse: TGUID = '{00001801-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAAuthenticatorResponse}

type
  IRMAAuthenticatorResponse = interface (IUnknown)
  ['{00001801-0901-11d1-8B06-00A024406D59}']

    (* AuthenticateDone is called by an IRMAAuthenticator when it has
     * finished it's authorization steps.  If the result is PNR_OK,
     * then the values contain authorization information as generated by
     * IRMAPassword.
     *)

    function AuthenticateDone(result: PN_RESULT; pAuthResponseValues: IRMAValues): HRESULT; stdcall;

  end;
  {$EXTERNALSYM IRMAAuthenticatorResponse}

(****************************************************************************
 *
 *  Interface:
 *
 *      IRMAAuthenticator
 *
 *  Purpose:
 *
 *      Provide a means of authenticating users.
 *
 *  IID_IRMAAuthenticator:
 *
 *      {00001800-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMAAuthenticator: TGUID = '{00001800-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAAuthenticator}

  CLSID_IRMAAuthenticator: TGUID = '{00001800-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM CLSID_IRMAAuthenticator}

type
  IRMAAuthenticator = interface (IUnknown)
  ['{00001800-0901-11d1-8B06-00A024406D59}']

    (*
     * InitAuthenticator is called by the creator of the Authenticator
     * object in order to pass it an IRMAAuthenticatorRequest object,
     * usually implemented by the creator itself.
     *)

    function InitAuthenticator(pRequest: IRMAAuthenticatorRequest): HRESULT; stdcall;

    (*
     * Authenticate is called by a file object (and others??)
     * when it wants to ask the creator, presumably an FS Manager,
     * for authorization to open it's file.
     *
     * Authenticate will call IRMAAuthenticateResponse::AuthenticateDone
     * when done with PNR_OK or an error.
     *
     * File objects will presumably perform the Authenticate response as
     * part of their Init() call, and not call InitDone until they receive
     * a response one way or the other.
     *)

    function Authenticate(pValues: IRMAValues; pResponse: IRMAAuthenticatorResponse): HRESULT; stdcall;

    (* GenerateAuthRequest is called by the creator of this object
     * when they want to send an authentication request to someone.
     *)

    function GenerateAuthRequest(authType: UINT32; out pValues: IRMAValues): HRESULT; stdcall;

    (*
     * AuthValuesReady is called by IRMAAuthenticatorRequest when it
     * is ready to respond to a GetAuthValues request.
     *)

    function AuthValuesReady(result: PN_RESULT; pValues: IRMAValues): HRESULT; stdcall;

  end;
  {$EXTERNALSYM IRMAAuthenticator}

(****************************************************************************
 *
 *  Interface:
 *
 *      IRMAPassword
 *
 *  Purpose:
 *
 *      Provides a general password facility for storing of passwords in
 *	an encrypted form and a facility for verifying passwords securely
 *	over the network.
 *
 *  IID_IRMAPassword:
 *
 *      {00001700-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  PN_AUTH_BASIC  = 1;
  {$EXTERNALSYM PN_AUTH_BASIC}
  PN_AUTH_DIGEST = 2;
  {$EXTERNALSYM PN_AUTH_DIGEST}
  PN_AUTH_RN5    = 3;
  {$EXTERNALSYM PN_AUTH_RN5}
  PN_AUTH_NTLM   = 4;
  {$EXTERNALSYM PN_AUTH_NTLM}

const
  IID_IRMAPassword: TGUID = '{00001700-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAPassword}

type
  IRMAPassword = interface (IUnknown)
  ['{00001700-0901-11d1-8B06-00A024406D59}']

    function Crypt(pAuthentication: IRMAValues): HRESULT; stdcall;
    function Verify(pAuth1, pAuth2: IRMAValues): HRESULT; stdcall;

    function AsString(pAuth: IRMAValues; out pBuffer: IRMABuffer): HRESULT; stdcall;
    function AsValues(str: PChar; pValues: IRMAValues): HRESULT; stdcall;

    (*
     * CreateBuffer is provided for the convenince of external users,
     * who would otherwise have to get a context and common class factory
     * just to create IRMABuffers.  This method can be used instead, but
     * is not advisable if other means are available.
     *)

    function CreateBuffer(out pBuffer: IRMABuffer): HRESULT; stdcall;

    (*
     * Ditto for CreateValues
     *)

    function CreateValues(out pValues: IRMAValues): HRESULT; stdcall;

  end;
  {$EXTERNALSYM IRMAPassword}

(****************************************************************************
 *
 *  Interface:
 *
 *      IRMAAuthenticationManagerResponse
 *
 *  Purpose:
 *
 *      Response object for IRMAAuthenticationManager.
 *
 *  IID_IRMAAuthenticator:
 *
 *      {00001a01-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMAAuthenticationManagerResponse: TGUID = '{00001a01-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAAuthenticationManagerResponse}

type
  IRMAAuthenticationManagerResponse = interface (IUnknown)
  ['{00001a01-0901-11d1-8B06-00A024406D59}']

    (* HandleAuthenticationRequest is called when the core wants us to get
     * a username and password.
     *)

    function AuthenticationRequestDone(result: PN_RESULT; pUserName, pPassword: PChar): HRESULT; stdcall;

  end;
  {$EXTERNALSYM IRMAAuthenticationManagerResponse}

(****************************************************************************
 *
 *  Interface:
 *
 *      IRMAAuthenticationManager
 *
 *  Purpose:
 *
 *      Provide a means of authenticating users.
 *
 *  IID_IRMAAuthenticator:
 *
 *      {00001a00-0901-11d1-8B06-00A024406D59}
 *
 *)

const
  IID_IRMAAuthenticationManager: TGUID = '{00001a00-0901-11d1-8B06-00A024406D59}';
  {$EXTERNALSYM IID_IRMAAuthenticationManager}

type
  IRMAAuthenticationManager = interface (IUnknown)
  ['{00001a00-0901-11d1-8B06-00A024406D59}']

    (* HandleAuthenticationRequest is called when the core wants us to get
     * a username and password.
     *)

    function HandleAuthenticationRequest(pResponse: IRMAAuthenticationManagerResponse): HRESULT; stdcall;

  end;
  {$EXTERNALSYM IRMAAuthenticationManager}

function CreatePassword(out ppIUnknown: IUnknown): PN_RESULT; stdcall;
{$EXTERNALSYM CreatePassword}

implementation

function CreatePassword; external 'TODO' name 'CreatePassword';

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -