CASA/BrowserExtensions/linux/src/MiCASAKeys.h

113 lines
2.9 KiB
C++

/***********************************************************************
*
* Copyright (C) 2005-2006 Novell, Inc. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, Novell, Inc.
*
* To contact Novell about this file by physical or electronic mail,
* you may find current contact information at www.novell.com.
*
***********************************************************************/
#ifndef _MICASA_KEYS_H_
#define _MICASA_KEYS_H_
#include "IMiCASAKeys.h"
#include <micasa.h>
#define MICASA_KEYS_CONTRACTID "@novell.com/CASA/MiCASAKeys;1"
#define MICASA_KEYS_CLASSNAME "Common Authentication Services Adapter"
// {287249D7-A851-4aa4-9AEE-5BCDA3B53566}
#define MICASA_KEYS_CID { 0x287249d7, 0xa851, 0x4aa4, { 0x9a, 0xee, 0x5b, 0xcd, 0xa3, 0xb5, 0x35, 0x66 } }
// External prototypes not yet in micasa.h
typedef
void *
(*PCASAOPEN)(
SSCS_SECRETSTORE_T * ssid,
unsigned long ssFlags,
SSCS_EXT_T * ext
);
typedef
int
(*PCASACLOSE)(
void * context,
unsigned long ssFlags,
SSCS_EXT_T * ext
);
typedef
int
(*PCASAWRITEKEY)(
void * context,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T * keyChainID,
SSCS_SECRET_ID_T * sharedSecretID,
SS_UTF8_T * key,
uint32_t keyLen,
uint8_t * val,
uint32_t valLen,
SSCS_PASSWORD_T * epPassword,
SSCS_EXT_T * ext
);
typedef
int
(*PCASAREADKEY)(
void * context,
uint32_t ssFlags,
SSCS_KEYCHAIN_ID_T * keyChainID,
SSCS_SECRET_ID_T * sharedSecretID,
SS_UTF8_T * key,
uint32_t keyLen,
uint8_t * val,
uint32_t * valLen,
SSCS_PASSWORD_T * epPassword,
uint32_t * bytesRequired,
SSCS_EXT_T * ext
);
typedef void * HANDLE;
#define TRUE 1
#define FALSE 0
/* Header file */
class MiCASAKeys : public IMiCASAKeys
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IMICASAKEYS
MiCASAKeys();
private:
~MiCASAKeys();
void * m_hCASALibrary;
int m_bLibraryLoaded;
PCASAOPEN m_pCASAOpen;
PCASACLOSE m_pCASAClose;
PCASAWRITEKEY m_pCASAWriteKey;
PCASAREADKEY m_pCASAReadKey;
protected:
/* additional members */
};
#endif //_MICASA_KEYS_H_