|
Eneboo - Documentación para desarrolladores
|
#include <libdigidoc/DigiDocDefs.h>#include <libdigidoc/DigiDocLib.h>#include <libdigidoc/DigiDocSAXParser.h>#include <libdigidoc/DigiDocDebug.h>#include <libdigidoc/DigiDocConvert.h>#include <libdigidoc/DigiDocConfig.h>#include <libdigidoc/DigiDocCert.h>#include <libdigidoc/DigiDocGen.h>#include <stdio.h>#include <stdlib.h>#include <memory.h>#include <string.h>#include <assert.h>#include <ctype.h>#include <fcntl.h>#include <time.h>#include <openssl/sha.h>#include <openssl/rsa.h>#include <openssl/evp.h>#include <openssl/objects.h>#include <openssl/x509.h>#include <openssl/x509v3.h>#include <openssl/err.h>#include <openssl/pem.h>#include <openssl/ssl.h>#include <openssl/ocsp.h>#include <openssl/pkcs12.h>#include <openssl/rand.h>'defines' | |
| #define | WIN32_PKCS 1 |
| #define | GUI_VERSION_LEN 100 |
Funciones | |
| int | notary2ocspBasResp (const SignedDoc *pSigDoc, const NotaryInfo *pNotInfo, X509 *notCert, OCSP_BASICRESP **pBasResp) |
| int | calculateOcspBasicResponseDigest (OCSP_BASICRESP *pBsResp, byte *digBuf, int *digLen) |
| int | createOCSPRequest (SignedDoc *pSigDoc, OCSP_REQUEST **req, X509 *cert, X509 *pCA, byte *nonce, int nlen) |
| EXP_OPTION int | signOCSPRequestPKCS12 (OCSP_REQUEST *req, const char *filename, const char *passwd) |
| int | verifyOCSPResponse (OCSP_RESPONSE *pResp, const X509 **caCerts, const char *CApath, const X509 *notCert) |
| int | checkNonceAndCertbyOCSP (OCSP_RESPONSE *resp, X509 *cert, byte *nonce1, int nonceLen) |
| int | verifyResp (OCSP_BASICRESP *bs, const char *CA2file, const char *CA1file, const char *CApath, const char *notCertFile) |
| int | writeCertToXMLFile (BIO *bout, X509 *cert) |
| EXP_OPTION int | ddocLocalTime (time_t *pTime, struct tm *pTmStruct, int bLocal) |
| EXP_OPTION const char * | getLibName () |
| EXP_OPTION const char * | getLibVersion () |
| EXP_OPTION const char ** | getSupportedFormats () |
| EXP_OPTION FormatAndVer * | getSupportedFormatsAndVersions () |
| int | ddocCheckFormatAndVer (const char *format, const char *version) |
| EXP_OPTION void | initDigiDocLib () |
| EXP_OPTION const char * | getGUIVersion () |
| EXP_OPTION void | setGUIVersion (const char *szVer) |
| EXP_OPTION void | finalizeDigiDocLib () |
| EXP_OPTION long | checkErrors () |
| EXP_OPTION int | calculateFileDigest (const char *szFileName, int nDigestType, byte *pDigestBuf, int *nDigestLen, long *lFileLen) |
| EXP_OPTION int | calculateFileSize (const char *szFileName, long *lFileLen) |
| EXP_OPTION int | calculateFileSignature (const char *szFileName, int nDigestType, byte *pSigBuf, int *nSigLen, const char *keyfile, const char *passwd) |
| EXP_OPTION int | signData (const byte *data, int dlen, byte *pSigBuf, int *nSigLen, int nDigestType, const char *keyfile, const char *passwd) |
| EXP_OPTION int | calculateDigest (const byte *data, int nDataLen, int nDigestType, byte *pDigestBuf, int *nDigestLen) |
| EXP_OPTION const char * | getSimpleFileName (const char *szFileName) |
| EXP_OPTION int | getFullFileName (const char *szFileName, char *szDest, int len) |
| EXP_OPTION int | getFileNamePath (const char *szFileName, char *szPath, int len) |
| EXP_OPTION int | getTempFileName (char *szFileName, int len) |
| EXP_OPTION int | setSignatureCert (SignatureInfo *pSigInfo, X509 *cert) |
| EXP_OPTION int | setSignatureCertFile (SignatureInfo *pSigInfo, const char *certFile) |
| EXP_OPTION int | checkFileExists (const char *szFileName) |
| EXP_OPTION X509 * | getSignCertData (const SignatureInfo *pSignInfo) |
| int | ddocPullUrl (const char *url, DigiDocMemBuf *pSendData, DigiDocMemBuf *pRecvData, const char *proxyHost, const char *proxyPort) |
| EXP_OPTION int | ddocPrepareSignature (SignedDoc *pSigDoc, SignatureInfo **ppSigInfo, const char *manifest, const char *city, const char *state, const char *zip, const char *country, X509 *pCert, const char *id) |
| EXP_OPTION int | ddocGetSignedHash (SignatureInfo *pSigInfo, char *pBuf, int *pBufLen, int enc, int bWithAsn1Prefix) |
Variables | |
| long int | tzone = -7200 |
| int | daylight = 0 |
| char | g_szLibName [] = "CDigiDoc" |
| char | g_szLibVer [] = DIGIDOC_VERSION |
| char * | g_szSupportedVersions [] |
| char * | g_arrFormats [] = { SK_XML_1_NAME, 0 } |
| FormatAndVer | g_supportedFormatsAndVersions [] |
| char | g_szGUIVersion [GUI_VERSION_LEN] |
| char | g_sigPrefix [] = { 48, 33, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20 } |
| #define GUI_VERSION_LEN 100 |
| #define WIN32_PKCS 1 |
| EXP_OPTION int calculateDigest | ( | const byte * | data, |
| int | nDataLen, | ||
| int | nDigestType, | ||
| byte * | pDigestBuf, | ||
| int * | nDigestLen | ||
| ) |
| EXP_OPTION int calculateFileDigest | ( | const char * | szFileName, |
| int | nDigestType, | ||
| byte * | pDigestBuf, | ||
| int * | nDigestLen, | ||
| long * | lFileLen | ||
| ) |
| EXP_OPTION int calculateFileSignature | ( | const char * | szFileName, |
| int | nDigestType, | ||
| byte * | pSigBuf, | ||
| int * | nSigLen, | ||
| const char * | keyfile, | ||
| const char * | passwd | ||
| ) |
| EXP_OPTION int calculateFileSize | ( | const char * | szFileName, |
| long * | lFileLen | ||
| ) |
| int calculateOcspBasicResponseDigest | ( | OCSP_BASICRESP * | pBsResp, |
| byte * | digBuf, | ||
| int * | digLen | ||
| ) |
| EXP_OPTION long checkErrors | ( | ) |
| EXP_OPTION int checkFileExists | ( | const char * | szFileName | ) |
| int checkNonceAndCertbyOCSP | ( | OCSP_RESPONSE * | resp, |
| X509 * | cert, | ||
| byte * | nonce1, | ||
| int | nonceLen | ||
| ) |
| int createOCSPRequest | ( | SignedDoc * | pSigDoc, |
| OCSP_REQUEST ** | req, | ||
| X509 * | cert, | ||
| X509 * | pCA, | ||
| byte * | nonce, | ||
| int | nlen | ||
| ) |
| int ddocCheckFormatAndVer | ( | const char * | format, |
| const char * | version | ||
| ) |
| EXP_OPTION int ddocGetSignedHash | ( | SignatureInfo * | pSigInfo, |
| char * | pBuf, | ||
| int * | pBufLen, | ||
| int | enc, | ||
| int | bWithAsn1Prefix | ||
| ) |
| EXP_OPTION int ddocPrepareSignature | ( | SignedDoc * | pSigDoc, |
| SignatureInfo ** | ppSigInfo, | ||
| const char * | manifest, | ||
| const char * | city, | ||
| const char * | state, | ||
| const char * | zip, | ||
| const char * | country, | ||
| X509 * | pCert, | ||
| const char * | id | ||
| ) |
| int ddocPullUrl | ( | const char * | url, |
| DigiDocMemBuf * | pSendData, | ||
| DigiDocMemBuf * | pRecvData, | ||
| const char * | proxyHost, | ||
| const char * | proxyPort | ||
| ) |
| EXP_OPTION void finalizeDigiDocLib | ( | ) |
| EXP_OPTION const char* getGUIVersion | ( | ) |
| EXP_OPTION const char* getLibName | ( | ) |
| EXP_OPTION const char* getLibVersion | ( | ) |
| EXP_OPTION X509* getSignCertData | ( | const SignatureInfo * | pSignInfo | ) |
| EXP_OPTION const char* getSimpleFileName | ( | const char * | szFileName | ) |
| EXP_OPTION const char** getSupportedFormats | ( | ) |
| EXP_OPTION FormatAndVer* getSupportedFormatsAndVersions | ( | ) |
| EXP_OPTION void initDigiDocLib | ( | ) |
| int notary2ocspBasResp | ( | const SignedDoc * | pSigDoc, |
| const NotaryInfo * | pNotInfo, | ||
| X509 * | notCert, | ||
| OCSP_BASICRESP ** | pBasResp | ||
| ) |
| EXP_OPTION void setGUIVersion | ( | const char * | szVer | ) |
| EXP_OPTION int setSignatureCert | ( | SignatureInfo * | pSigInfo, |
| X509 * | cert | ||
| ) |
| EXP_OPTION int setSignatureCertFile | ( | SignatureInfo * | pSigInfo, |
| const char * | certFile | ||
| ) |
| EXP_OPTION int signData | ( | const byte * | data, |
| int | dlen, | ||
| byte * | pSigBuf, | ||
| int * | nSigLen, | ||
| int | nDigestType, | ||
| const char * | keyfile, | ||
| const char * | passwd | ||
| ) |
| EXP_OPTION int signOCSPRequestPKCS12 | ( | OCSP_REQUEST * | req, |
| const char * | filename, | ||
| const char * | passwd | ||
| ) |
| int verifyOCSPResponse | ( | OCSP_RESPONSE * | pResp, |
| const X509 ** | caCerts, | ||
| const char * | CApath, | ||
| const X509 * | notCert | ||
| ) |
| int verifyResp | ( | OCSP_BASICRESP * | bs, |
| const char * | CA2file, | ||
| const char * | CA1file, | ||
| const char * | CApath, | ||
| const char * | notCertFile | ||
| ) |
| char* g_arrFormats[] = { SK_XML_1_NAME, 0 } |
| char g_sigPrefix[] = { 48, 33, 48, 9, 6, 5, 43, 14, 3, 2, 26, 5, 0, 4, 20 } |
{
{ SK_XML_1_NAME, SK_XML_1_VER },
{ DIGIDOC_XML_1_1_NAME, DIGIDOC_XML_1_1_VER },
{ DIGIDOC_XML_1_1_NAME, DIGIDOC_XML_1_2_VER },
{ DIGIDOC_XML_1_1_NAME, DIGIDOC_XML_1_3_VER },
{ NULL, NULL }
}
| char g_szGUIVersion[GUI_VERSION_LEN] |
| char g_szLibName[] = "CDigiDoc" |
| char g_szLibVer[] = DIGIDOC_VERSION |
| char* g_szSupportedVersions[] |
{ "1.0", "1.1", "1.2", "1.3"
}
1.7.4