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

📄 ospsecurity.h

📁 mgcp协议源代码。支持多种编码:g711
💻 H
字号:
/**########################################################################*########################################################################*########################################################################*                                                               *   COPYRIGHT (c) 1998, 1999 by TransNexus, LLC                          *                                                                    *   This software contains proprietary and confidential information  *   of TransNexus, LLC. Except as may be set forth in the license    *   agreement under which this software is supplied, use, disclosure, *   or reproduction is prohibited without the prior, express, written*   consent of TransNexus, LLC.                                      *                                     *******#########################################################################*#########################################################################*#########################################################################*//* * ospsecurity.h - Prototypes for security object. */#ifndef _OSPSECURITY_H#define _OSPSECURITY_H#include "osp.h"#include "osptrans.h"#include "ospasn1.h"#include "osppkcs1.h"#include "ospx509.h"#include "ospsslsess.h"/* defines for Local or Remote validation */#define OSPC_LOCAL  0x05#define OSPC_REMOTE 0x06#define OSPC_SEC_MAX_AUTH_CERTS 5 #define OSPC_SEC_SIGNATURE_AND_CONTENT 0#define OSPC_SEC_SIGNATURE_ONLY 1/*-------------------------------------------*//* security typedef                          *//*-------------------------------------------*/ typedef struct _OSPTSEC{    unsigned            NumberOfAuthorityCertificates;    OSPTASN1OBJECT      *AuthorityCertInfo[OSPC_SEC_MAX_AUTH_CERTS];    OSPTASN1OBJECT      *LocalCertInfo;    OSPTASN1OBJECT      *PrivateKeyInfo;    OSPTASN1OBJECT      *DigestAlgorithm;        unsigned            LocalValidation;    OSPTMUTEX           SecurityMutex;    OSPTSSLSESSIONID    *SSLSessionIdList;        unsigned            SSLLifetime;    OSPTBOOL            SSLSessionHasMutex;    OSPTMUTEX           SSLSessionMutex;    void                *ContextRef;} OSPTSEC;#ifdef __cplusplusextern "C" {#endif    /********************************/    /* PROTOTYPES FOR ospsecurity.c */    /********************************/    int    OSPPSecCopyPrivateKey(        OSPTSEC *ospvSecurity,                          OSPTPRIVATEKEY *ospvPrivateKey);    int      OSPPSecGetPrivateKeyData(        OSPTSEC *ospvSecurity,         unsigned char **ospvPrivateKeyData,        unsigned int  *ospvPrivateKeyDataLength);    int    OSPPSecNew(        OSPTSEC **ospvSecurity);    int    OSPPSecGetLocalValidation(        OSPTSEC *ospvSecurity,        unsigned *ospvLocalValidation);    int OSPPSecSetPrivateKey(        OSPTSEC *ospvSecurity,        OSPTPRIVATEKEY *ospvPrivateKey);    int    OSPPSecSetLocalCertificate(        OSPTSEC         *ospvSecurity,        unsigned char   *ospvLocalCertificate,        unsigned long   *ospvCustomerId,        unsigned long   *ospvDeviceId);    int    OSPPSecSetLocalValidation(        OSPTSEC     *ospvSecurity,         unsigned    ospvLocalValidation);    int    OSPPSecGetNumberOfAuthorityCertificates(        OSPTSEC     *ospvSecurity,        unsigned    *ospvNumberOfAuthorityCertificates);    int    OSPPSecCopyAuthorityCertificates(        OSPTSEC *ospvSecurity,        unsigned ospvMaxCertificateSize,        unsigned char *ospvAuthorityCertificates[],        unsigned *ospvCertificateCount);    int    OSPPSecDelete(        OSPTSEC     **ospvSecurity);    int    OSPPSecVerifyRootAuthorityCertificate(        OSPTSEC *ospvSecurity,        void    *ospvRootCACert,        int      ospvRootCACertLen);    int    OSPPSecSetAuthorityCertificates(        OSPTSEC         *ospvSecurity,        unsigned        ospvNumberOfAuthorityCertificates,        unsigned char   *ospvAuthorityCertificates[]);    int     OSPPSecSignatureCreate(        OSPTSEC *ospvSecurity,         unsigned char *ospvContent,        unsigned ospvContentLength,         unsigned char **ospvSignature,         unsigned *ospvSignatureLength,        int ospvSignatureOnly);    int      OSPPSecSignatureVerify(        OSPTSEC *ospvSecurity,         unsigned char **ospvContent,         unsigned *ospvContentLength,         unsigned char *ospvSignature,        unsigned ospvSignatureLength,        int ospvSignatureOnly);    int     OSPPSecCopyLocalCertificate(        OSPTSEC *ospvSecurity,         unsigned *ospvLocalCertificateSize,        unsigned char *ospvLocalCertificate);    int    OSPPSecGetSignerCertSubjectName(        OSPTSEC         *ospvSecurity,        unsigned char   *ospvToken,        unsigned        ospvTokenLen,        unsigned char   **ospvSubjectName,        unsigned        *ospvSubjectNameLen);            /******************************/    /* PROTOTYPES FOR ospsecssl.c */    /******************************/    OSPTBOOL        OSPPSecSSLLifetimeHasExpired(        OSPTSEC          *ospvSecurity,        OSPTSSLSESSIONID *ospvSessionId);    unsigned    OSPPSecGetSSLLifetime(        OSPTSEC *ospvSecurity);    int    OSPPSecSSLSessionIdNew(        OSPTSEC        *ospvSecurity,        unsigned long   ospvLength,         unsigned char  *ospvData,        char           *ospvHostName,        short           ospvPort);    int    OSPPSecSSLSessionIdGet(        OSPTSEC        *ospvSecurity,        unsigned long  *ospvLength,         unsigned char **ospvData,        char           *ospvHostName,        short           ospvPort);    void    OSPPSecSSLSessionIdDelete(        OSPTSEC           *ospvSecurity,        OSPTSSLSESSIONID **ospvSSLSessionId,        OSPTBOOL           ospvUseMutex);    int    OSPPSecSSLSessionIdInitDB(        OSPTSEC *ospvSecurity);    void    OSPPSecSSLSessionIdDeleteDB(        OSPTSEC *ospvSecurity);    void    OSPPSecSetSSLLifetime(        OSPTSEC *ospvSecurity,        unsigned ospvSSLLifetime);    int    OSPPSecValidCertChain(        OSPTSEC *ospvSecurity,        int     *ospvCAIndex,        unsigned char *ospvCertificate,        unsigned int  *ospvCertificateLength);#ifdef __cplusplus}#endif#endif

⌨️ 快捷键说明

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