Main Page | File List | File Members

Security.h

Go to the documentation of this file.
00001 /* -*- mode: c++; -*-
00002  *-----------------------------------------------------------------------------
00003  * $RCSfile: Security.h,v $
00004  *
00005  * See Copyright for the status of this software.
00006  *
00007  * The OpenSOAP Project
00008  * http://opensoap.jp/
00009  *-----------------------------------------------------------------------------
00010  */
00011 #ifndef OpenSOAP_Security_H
00012 #define OpenSOAP_Security_H
00013 
00014 #include <stdio.h>
00015 #include <OpenSOAP/Envelope.h>
00016 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif /* __cplusplus */
00026 
00031 #define OPENSOAP_HA_MD2    (1)  /* MD2 */
00032 
00037 #define OPENSOAP_HA_MD4    (2)  /* MD4 */
00038 
00043 #define OPENSOAP_HA_MD5    (3)  /* MD5 */
00044 
00049 #define OPENSOAP_HA_MDC2   (4)  /* MDC2 */
00050 
00055 #define OPENSOAP_HA_RIPEMD (5)  /* RIPEMD */
00056 
00061 #define OPENSOAP_HA_SHA    (6)  /* SHA */
00062 
00067 #define OPENSOAP_CA_OWNER_LEN  (1024)
00068 
00072 #define OPENSOAP_CERT_DATE_LEN   (14)
00073 
00074 
00075 
00076     /* Certificate */
00082     typedef struct tagOpenSOAPSecCert OpenSOAPSecCert;
00083 
00089     typedef OpenSOAPSecCert* OpenSOAPSecCertPtr;
00090 
00091 
00092     /* CA */
00098     typedef struct tagOpenSOAPCARec OpenSOAPCARec;
00099 
00105     typedef OpenSOAPCARec* OpenSOAPCARecPtr;
00106 
00119     int
00120     OPENSOAP_API
00121     OpenSOAPSecGenerateRSAKeys
00122     (const unsigned char* szSeedPhrase, /* (i)  Seed phrase */
00123      FILE*          fpPrivKey,    /* (i)  RSA Private Key File stream */
00124      FILE*          fpPubKey);    /* (i)  RSA Public Key File stream */
00125 
00138     int
00139     OPENSOAP_API
00140     OpenSOAPSecGenerateRSAKeysToFile
00141     (const unsigned char* szSeedPhrase,      /* (i)  Seed phrase */
00142      const char*          szPrivKeyFileName, /* (i)  RSA Private Key File Name */
00143      const char*          szPubKeyFileName); /* (i)  RSA Public Key File Name */
00144 
00155     int
00156     OPENSOAP_API
00157     OpenSOAPSecEncWithStream
00158     (OpenSOAPEnvelopePtr env,       /* (i)  Envelope */
00159      FILE*               fpPubKey); /* (i)  Public Key File stream */
00160 
00171     int
00172     OPENSOAP_API
00173     OpenSOAPSecEncWithFile
00174     (OpenSOAPEnvelopePtr env,         /* (i)  Envelope */
00175      const char*         szPubKName); /* (i)  Public Key File Name */
00176 
00187     int
00188     OPENSOAP_API
00189     OpenSOAPSecDecWithStream
00190     (OpenSOAPEnvelopePtr env,        /* (i)  Envelope */
00191      FILE*               fpPrivKey); /* (i)  Private Key File stream */
00192 
00203     int
00204     OPENSOAP_API
00205     OpenSOAPSecDecWithFile
00206     (OpenSOAPEnvelopePtr env,          /* (i)  Envelope */
00207      const char*         szPrivKName); /* (i)  Private Key File Name */
00208 
00223     int
00224     OPENSOAP_API
00225     OpenSOAPSecAddSignWithStream
00226     (OpenSOAPEnvelopePtr env,        /* (io) Envelope */
00227      int                 iType,      /* (i)  Hash Type(OPENSOAP_HA_*) */
00228      FILE*               fpPrivKey,  /* (i)  Private Key File stream */
00229      OpenSOAPStringPtr   name);      /* (i)  Name of Sign */
00230 
00245     int
00246     OPENSOAP_API
00247     OpenSOAPSecAddSignWithFile
00248     (OpenSOAPEnvelopePtr env,          /* (io) Envelope */
00249      int                 iType,        /* (i)  Hash Type(OPENSOAP_HA_*) */
00250      const char*         szPrivKName,  /* (i)  Private Key File Name */
00251      OpenSOAPStringPtr   name);        /* (i)  Name of Sign */
00252 
00263     int
00264     OPENSOAP_API
00265     OpenSOAPSecCntSign
00266     (const OpenSOAPEnvelopePtr env,    /* (i)  Envelope */
00267      int*                      pnSig); /* (o)  Signature Count */
00268 
00283     int
00284     OPENSOAP_API
00285     OpenSOAPSecGetSignedByList
00286     (OpenSOAPEnvelopePtr env,          /* (i)  Envelope */
00287      int                 nCntMax,      /* (i)  Maximum Count */
00288      OpenSOAPStringPtr   list[],       /* (io) SignedBy List  */
00289      int*                pnCntPacked); /* (o)  Packed Count */
00290 
00301     int
00302     OPENSOAP_API
00303     OpenSOAPSecVerifySignWithStream
00304     (OpenSOAPEnvelopePtr env,       /* (io) Envelope */
00305      FILE*               fpPubKey); /* (i)  Public Key File stream */
00306 
00317     int
00318     OPENSOAP_API
00319     OpenSOAPSecVerifySignWithFile
00320     (OpenSOAPEnvelopePtr env,         /* (io) Envelope */
00321      const char*         szPubKName); /* (i)  Public Key File Name */
00322 
00339     int
00340     OPENSOAP_API
00341     OpenSOAPSecCertCreateWithStream
00342     (const char*            szPublish, /* (i)  Publisher's Name */
00343      FILE*                  fpPrivKey, /* (i)  Private Key(Publisher) */
00344      int                    iHashType, /* (i)  Hash Type(OPENSOAP_HA_*) */
00345      const OpenSOAPCARecPtr pRec,      /* (i)  CA Record */
00346      FILE*                  fpCert);   /* (o)  Certificate File */
00347 
00364     int
00365     OPENSOAP_API
00366     OpenSOAPSecCertCreateWithFile
00367     (const char*         szPublish,     /* (i)  Publisher's Name */
00368      const char*         szPrivKeyFile, /* (i)  PrivKey File Name (Publisher) */
00369      int                 iHashType,     /* (i)  Hash Type(OPENSOAP_HA_*) */
00370      const OpenSOAPCARecPtr pRec,          /* (i)  CA Record */
00371      const char*         szCertName);   /* (i)  Certificate File Name */
00372 
00385     int
00386     OPENSOAP_API
00387     OpenSOAPSecCertLoadFromMem
00388     (size_t               sizArea,  /* (i)  Size of Input Area */
00389      const unsigned char* pucArea,  /* (i)  Input Area */
00390      OpenSOAPSecCertPtr*  ppCert);  /* (o)  Certificate */
00391 
00402     int
00403     OPENSOAP_API
00404     OpenSOAPSecCertLoad
00405     (const char*          szName,   /* (i)  File Name */
00406      OpenSOAPSecCertPtr*  ppCert);  /* (o)  Certificate */
00407 
00416     int
00417     OPENSOAP_API
00418     OpenSOAPSecCertFree
00419     (OpenSOAPSecCertPtr ppCert);
00420 
00431     int
00432     OPENSOAP_API
00433     OpenSOAPSecCertVerifyWithStream
00434     (FILE* fpCert,                  /* (i)  Certificate File Stream */
00435      FILE* fpPubKey);               /* (i)  Public Key File Stream */
00436 
00447     int
00448     OPENSOAP_API
00449     OpenSOAPSecCertVerifyWithFile
00450     (const char* szCertName,    /* (i)  Certificate File Name */
00451      const char* szPubKeyName); /* (i)  Public Key File Name */
00452 
00463     int
00464     OPENSOAP_API
00465     OpenSOAPSecCertGetPublisherName
00466     (OpenSOAPSecCertPtr pCert,      /* (i)   */
00467      char**             pszName);   /* (o)  Name (Internal Area) */
00468 
00479     int
00480     OPENSOAP_API
00481     OpenSOAPSecCertGetSerialNo
00482     (OpenSOAPSecCertPtr pCert,      /* (i)   */
00483      unsigned long*     pulSerial); /* (o)  Serial Number */
00484 
00495     int
00496     OPENSOAP_API
00497     OpenSOAPSecCertGetOwnerName
00498     (OpenSOAPSecCertPtr pCert,      /* (i)   */
00499      char**             pszName);   /* (o)  Name (Internal Area) */
00500 
00511     int
00512     OPENSOAP_API
00513     OpenSOAPSecCertGetEndDate
00514     (OpenSOAPSecCertPtr pCert,      /* (i)   */
00515      char**             pszDate);   /* (o)  Date(Internal Area) */
00516 
00527     int
00528     OPENSOAP_API
00529     OpenSOAPSecCertGetPubKey
00530     (OpenSOAPSecCertPtr pCert,       /* (i)   */
00531      const char*        szSaveName); /* (i)  Public Key File Name */
00532 
00547     int
00548     OPENSOAP_API
00549     OpenSOAPSecDecodeKeyFile
00550     (FILE*           fp,          /* (i)  File Stream */
00551      unsigned long*  pulLenOut,   /* (o)  Length of output data */
00552      unsigned char** ppucDecode); /* (o)  Decoded String(call free() after use) */
00553 
00564     int
00565     OPENSOAP_API
00566     OpenSOAPSecCABrowseRec
00567     (const OpenSOAPCARecPtr pRec,   /* (i)  Record */
00568      FILE*                  fpOut); /* (i)  Output Stream */
00569 
00578     int
00579     OPENSOAP_API
00580     OpenSOAPSecCABrowse
00581     (FILE* fpOut);                  /* (i)  Output Stream */
00582 
00599     int
00600     OPENSOAP_API
00601     OpenSOAPSecCARegist
00602     (const char*    szNameOwner,    /* (i)  Owner's Name */
00603      const char*    szTermDate,     /* (i)  Terminate Date */
00604                                     /*      "YYYYMMDDHHMMSS" */
00605      size_t         sizPubkey,      /* (i)  Size of public key */
00606      const unsigned char* szPubKey, /* (i)  Public Key */
00607      unsigned long* pulSerialNo);   /* (o)  Serial Number */
00608 
00619     int
00620     OPENSOAP_API
00621     OpenSOAPSecCAInvalidate
00622     (const char*     szNameOwner,   /* (i)  Owner's Name */
00623      unsigned long   ulSerial);     /* (i)  Serial Number */
00624 
00639     int
00640     OPENSOAP_API
00641     OpenSOAPSecCASearchRecords
00642     (const char* szNameOwner, /* (i)  Owner's Name */
00643      int*        pnRec,       /* (o)  Record Count */
00644      long**      pplIdxs);    /* (o)  Index Numbers (call free() after use) */
00645 
00656     int
00657     OPENSOAP_API
00658     OpenSOAPSecCASearchOneRecord
00659     (const char*         szNameOwner, /* (i)  Owner's Name */
00660      OpenSOAPCARecPtr*   ppRec);      /* (o)  Record */
00661 
00672     int
00673     OPENSOAP_API
00674     OpenSOAPSecCAGetRecord
00675     (long              lIdx,    /* (i)  Index */
00676      OpenSOAPCARecPtr* ppRec);  /* (o)  Record */
00677 
00686     int
00687     OPENSOAP_API
00688     OpenSOAPSecCAFreeRecord
00689     (OpenSOAPCARecPtr pRec);  /* (i)  Record */
00690 
00699     int
00700     OPENSOAP_API
00701     OpenSOAPSecCARemoveRecord
00702     (unsigned long ulSerial);   /* (i)  Serial Number */
00703 
00704 #ifdef __cplusplus
00705 }
00706 #endif /* __cplusplus */
00707 
00708 #endif /* OpenSOAP_Security_H */

Generated on Mon Oct 18 18:29:43 2004 for OpenSOAP by doxygen 1.3.6