Eneboo - Documentación para desarrolladores
'defines' | Funciones
Referencia del Archivo src/libdigidoc/DigiDocCert.c
#include <libdigidoc/DigiDocDefs.h>
#include <libdigidoc/DigiDocCert.h>
#include <libdigidoc/DigiDocConvert.h>
#include <libdigidoc/DigiDocLib.h>
#include <libdigidoc/DigiDocError.h>
#include <libdigidoc/DigiDocDebug.h>
#include <libdigidoc/DigiDocMem.h>
#include <libdigidoc/DigiDocOCSP.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>
#include <string.h>

'defines'

#define NID_firstName   99
#define NID_lastName   100
#define NID_perCode   105
#define NID_countryName   14
#define NID_serialNumber   105
#define NID_organization   17
#define NID_organizationUnit   18
#define NID_commonName   13
#define NID_emailAddress   48

Funciones

int createOCSPRequest (SignedDoc *pSigDoc, OCSP_REQUEST **req, X509 *cert, X509 *pCA, byte *nonce, int nlen)
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 hasUmlauts (const char *str)
int checkNonceAndCertbyOCSP (OCSP_RESPONSE *resp, X509 *cert, byte *nonce1, int nonceLen)
EXP_OPTION int ReadCertificate (X509 **x509, const char *szCertfile)
EXP_OPTION int ReadCertificateByPKCS12 (X509 **x509, const char *pkcs12file, const char *passwd, EVP_PKEY **pkey)
EXP_OPTION int GetCertSerialNumber (char *szSerial, int nMaxLen, const char *szCertfile)
EXP_OPTION int ReadCertSerialNumber (char *szSerial, int nMaxLen, X509 *x509)
EXP_OPTION int ReadPublicKey (EVP_PKEY **PublicKey, const char *szCertfile)
EXP_OPTION int GetPublicKey (EVP_PKEY **pubKey, const X509 *x509)
int pemkey_callback (char *buf, int size, int rwflag, void *userdata)
EXP_OPTION int ReadPrivateKey (EVP_PKEY **privKey, const char *keyfile, const char *passwd, int format)
EXP_OPTION int WritePrivateKey (EVP_PKEY *privKey, const char *keyfile, const char *passwd, int format)
EXP_OPTION int ddocWriteKeyAndCertPem (EVP_PKEY *privKey, X509 *pCert, const char *keyfile, const char *passwd)
EXP_OPTION int ReadRSAPrivateKey (RSA **privKey, const char *keyfile, const char *passwd, int format)
EXP_OPTION int verifyCertificateByOCSP (X509 *pCert, const X509 **caCerts, const X509 *notaryCert, char *notaryURL, char *proxyHost, char *proxyPort, const char *pkcs12file, const char *pkcs12paswd, OCSP_RESPONSE **ppResp)
EXP_OPTION int verifyCertificateByOCSPWithIp (X509 *pCert, const X509 **caCerts, const X509 *notaryCert, char *notaryURL, char *proxyHost, char *proxyPort, const char *pkcs12file, const char *pkcs12paswd, OCSP_RESPONSE **ppResp, unsigned long ip)
EXP_OPTION int ddocDecodeX509Data (X509 **ppX509, const byte *certData, int certLen)
EXP_OPTION int ddocDecodeX509PEMData (X509 **ppX509, const char *certData, int certLen)
EXP_OPTION int isCertValid (X509 *cert, time_t tDate)
EXP_OPTION time_t getCertNotBeforeTimeT (X509 *pCert)
EXP_OPTION time_t getCertNotAfterTimeT (X509 *pCert)
EXP_OPTION int isCertSignedBy (X509 *cert, const char *cafile)
EXP_OPTION int writeCertToXMLFile (BIO *bout, X509 *cert)
EXP_OPTION int getCertPEM (X509 *cert, int bHeaders, char **buf)
EXP_OPTION int getCertNotBefore (const SignedDoc *pSigDoc, X509 *cert, char *timestamp, int len)
EXP_OPTION int getCertNotAfter (const SignedDoc *pSigDoc, X509 *cert, char *timestamp, int len)
EXP_OPTION int saveCert (X509 *cert, const char *szFileName, int nFormat)
EXP_OPTION void * decodeCert (const char *pemData)
EXP_OPTION void encodeCert (const X509 *x509, char *encodedCert, int *encodedCertLen)
EXP_OPTION int isCertSignedByCERT (const X509 *cert, const X509 *caCert)
EXP_OPTION int ddocCertCopySubstring (const char *szSrc, const char *szLabel, const char *szTerminator, char **szDest)
EXP_OPTION int readCertPoliciesFromOU (X509 *pX509, PolicyIdentifier **pPolicies, int *nPols)
EXP_OPTION int readCertPolicies (X509 *pX509, PolicyIdentifier **pPolicies, int *nPols)
EXP_OPTION void PolicyIdentifiers_free (PolicyIdentifier *pPolicies, int nPols)
EXP_OPTION int isCompanyCPSPolicy (PolicyIdentifier *pPolicy)
EXP_OPTION int ddocCertGetDigest (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetPubkeyDigest (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetDN (X509 *pCert, DigiDocMemBuf *pMemBuf, int bIssuer)
EXP_OPTION int ddocCertGetIssuerDN (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetSubjectDN (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetDNFromName (X509_NAME *pName, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetDNPart (X509 *pCert, DigiDocMemBuf *pMemBuf, int nNid, int bIssuer)
EXP_OPTION int ddocCertGetSubjectCN (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetIssuerCN (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetSubjectFirstName (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetSubjectLastName (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetSubjectPerCode (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetSubjectCountryName (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetSubjectOrganization (X509 *pCert, DigiDocMemBuf *pMemBuf)
EXP_OPTION int ddocCertGetSubjectOrganizationUnit (X509 *pCert, DigiDocMemBuf *pMemBuf)

Documentación de los 'defines'

#define NID_commonName   13
#define NID_countryName   14
#define NID_emailAddress   48
#define NID_firstName   99
#define NID_lastName   100
#define NID_organization   17
#define NID_organizationUnit   18
#define NID_perCode   105
#define NID_serialNumber   105

Documentación de las funciones

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 
)
EXP_OPTION int ddocCertCopySubstring ( const char *  szSrc,
const char *  szLabel,
const char *  szTerminator,
char **  szDest 
)
EXP_OPTION int ddocCertGetDigest ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetDN ( X509 pCert,
DigiDocMemBuf pMemBuf,
int  bIssuer 
)
EXP_OPTION int ddocCertGetDNFromName ( X509_NAME pName,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetDNPart ( X509 pCert,
DigiDocMemBuf pMemBuf,
int  nNid,
int  bIssuer 
)
EXP_OPTION int ddocCertGetIssuerCN ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetIssuerDN ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetPubkeyDigest ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetSubjectCN ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetSubjectCountryName ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetSubjectDN ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetSubjectFirstName ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetSubjectLastName ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetSubjectOrganization ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetSubjectOrganizationUnit ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocCertGetSubjectPerCode ( X509 pCert,
DigiDocMemBuf pMemBuf 
)
EXP_OPTION int ddocDecodeX509Data ( X509 **  ppX509,
const byte certData,
int  certLen 
)
EXP_OPTION int ddocDecodeX509PEMData ( X509 **  ppX509,
const char *  certData,
int  certLen 
)
EXP_OPTION int ddocWriteKeyAndCertPem ( EVP_PKEY privKey,
X509 pCert,
const char *  keyfile,
const char *  passwd 
)
EXP_OPTION void* decodeCert ( const char *  pemData)
EXP_OPTION void encodeCert ( const X509 x509,
char *  encodedCert,
int encodedCertLen 
)
EXP_OPTION int getCertNotAfter ( const SignedDoc pSigDoc,
X509 cert,
char *  timestamp,
int  len 
)
EXP_OPTION time_t getCertNotAfterTimeT ( X509 pCert)
EXP_OPTION int getCertNotBefore ( const SignedDoc pSigDoc,
X509 cert,
char *  timestamp,
int  len 
)
EXP_OPTION time_t getCertNotBeforeTimeT ( X509 pCert)
EXP_OPTION int getCertPEM ( X509 cert,
int  bHeaders,
char **  buf 
)
EXP_OPTION int GetCertSerialNumber ( char *  szSerial,
int  nMaxLen,
const char *  szCertfile 
)
EXP_OPTION int GetPublicKey ( EVP_PKEY **  pubKey,
const X509 x509 
)
int hasUmlauts ( const char *  str)
EXP_OPTION int isCertSignedBy ( X509 cert,
const char *  cafile 
)
EXP_OPTION int isCertSignedByCERT ( const X509 cert,
const X509 caCert 
)
EXP_OPTION int isCertValid ( X509 cert,
time_t  tDate 
)
EXP_OPTION int isCompanyCPSPolicy ( PolicyIdentifier pPolicy)
int pemkey_callback ( char *  buf,
int  size,
int  rwflag,
void *  userdata 
)
EXP_OPTION void PolicyIdentifiers_free ( PolicyIdentifier pPolicies,
int  nPols 
)
EXP_OPTION int ReadCertificate ( X509 **  x509,
const char *  szCertfile 
)
EXP_OPTION int ReadCertificateByPKCS12 ( X509 **  x509,
const char *  pkcs12file,
const char *  passwd,
EVP_PKEY **  pkey 
)
EXP_OPTION int readCertPolicies ( X509 pX509,
PolicyIdentifier **  pPolicies,
int nPols 
)
EXP_OPTION int readCertPoliciesFromOU ( X509 pX509,
PolicyIdentifier **  pPolicies,
int nPols 
)
EXP_OPTION int ReadCertSerialNumber ( char *  szSerial,
int  nMaxLen,
X509 x509 
)
EXP_OPTION int ReadPrivateKey ( EVP_PKEY **  privKey,
const char *  keyfile,
const char *  passwd,
int  format 
)
EXP_OPTION int ReadPublicKey ( EVP_PKEY **  PublicKey,
const char *  szCertfile 
)
EXP_OPTION int ReadRSAPrivateKey ( RSA **  privKey,
const char *  keyfile,
const char *  passwd,
int  format 
)
EXP_OPTION int saveCert ( X509 cert,
const char *  szFileName,
int  nFormat 
)
int signOCSPRequestPKCS12 ( OCSP_REQUEST req,
const char *  filename,
const char *  passwd 
)
EXP_OPTION int verifyCertificateByOCSP ( X509 pCert,
const X509 **  caCerts,
const X509 notaryCert,
char *  notaryURL,
char *  proxyHost,
char *  proxyPort,
const char *  pkcs12file,
const char *  pkcs12paswd,
OCSP_RESPONSE **  ppResp 
)
EXP_OPTION int verifyCertificateByOCSPWithIp ( X509 pCert,
const X509 **  caCerts,
const X509 notaryCert,
char *  notaryURL,
char *  proxyHost,
char *  proxyPort,
const char *  pkcs12file,
const char *  pkcs12paswd,
OCSP_RESPONSE **  ppResp,
unsigned long  ip 
)
int verifyOCSPResponse ( OCSP_RESPONSE pResp,
const X509 **  caCerts,
const char *  CApath,
const X509 notCert 
)
EXP_OPTION int writeCertToXMLFile ( BIO bout,
X509 cert 
)
EXP_OPTION int WritePrivateKey ( EVP_PKEY privKey,
const char *  keyfile,
const char *  passwd,
int  format 
)
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'