MHEG-5  19.3.0
MHEG-5 Documentation
Classes | Macros | Typedefs | Enumerations | Functions
mh5sig.c File Reference

Functions relating to HTTPS Signature certificates. More...

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <openssl/sha.h>
#include <openssl/rsa.h>
#include <openssl/evp.h>
#include <openssl/x509.h>
#include "mh5profile.h"
#include "mh5sig.h"
#include "mh5memory.h"
#include "mh5fileorm.h"
#include "mh5debug.h"
#include "stb_os.h"

Go to the source code of this file.

Classes

struct  sSigCacheEntry
 
struct  sCertLink
 
struct  sCertFile
 

Macros

#define SIG_CERT_TIMEOUT   (3 * 60 * 60 * 1000)
 
#define MAX_SIG_CERT_NAME   (22)
 
#define MAX_SIG_SIZE   (256)
 
#define ENTRY_STATE_STRING(e)
 
#define SIG_DEBUG_PRINT
 
#define PRINT(x)
 

Typedefs

typedef struct sSigCacheEntry SigCacheEntry
 
typedef struct sCertLink CertLink
 
typedef struct sCertFile CertFile
 

Enumerations

enum  SigEntryState {
  ENTRY_STATE_START, ENTRY_STATE_VERIFIED, ENTRY_STATE_NOT_VERIFIED, ENTRY_STATE_WAIT_FOR_CERT,
  ENTRY_STATE_HAS_CERT, ENTRY_STATE_NO_CERT
}
 

Functions

MHEG5SigVerifyStatus_t MHEG5IsValidSignature (MHEG5String *hash, MHEG5String *signature)
 Check whether the signature is valid. More...
 
void MHEG5ClearSigCertCache (void)
 Clear the signature certificate cache and all related information. More...
 
void MHEG5InvalidateSigCertCache (void)
 Invalidate the certificates in the certificate cache. More...
 
void MHEG5SetSigVerifyCallback (void(*callback)(void))
 Sets the callback to be called when pending requests are resolved. More...
 

Detailed Description

Functions relating to HTTPS Signature certificates.

Date
22/02/2010
Author
Omri Barel

Definition in file mh5sig.c.

Macro Definition Documentation

#define ENTRY_STATE_STRING (   e)
Value:
((e)->state == ENTRY_STATE_START ? "ENTRY_STATE_START" : \
(e)->state == ENTRY_STATE_VERIFIED ? "ENTRY_STATE_VERIFIED" : \
(e)->state == ENTRY_STATE_NOT_VERIFIED ? "ENTRY_STATE_NOT_VERIFIED" : \
(e)->state == ENTRY_STATE_WAIT_FOR_CERT ? "ENTRY_STATE_WAIT_FOR_CERT" : \
(e)->state == ENTRY_STATE_HAS_CERT ? "ENTRY_STATE_HAS_CERT" : \
(e)->state == ENTRY_STATE_NO_CERT ? "ENTRY_STATE_NO_CERT" : \
"UNKNOWN")

Definition at line 50 of file mh5sig.c.

Function Documentation

void MHEG5ClearSigCertCache ( void  )

Clear the signature certificate cache and all related information.

Returns
Nothing

Definition at line 242 of file mh5sig.c.

void MHEG5InvalidateSigCertCache ( void  )

Invalidate the certificates in the certificate cache.

Returns
Nothing

Definition at line 262 of file mh5sig.c.

MHEG5SigVerifyStatus_t MHEG5IsValidSignature ( MHEG5String hash,
MHEG5String signature 
)

Check whether the signature is valid.

Parameters
hashHash file contents
signatureSignature file contents
Returns
MHEG5_SIG_VERIFIED MHEG5_SIG_NOT_VERIFIED MHEG5_SIG_CHECK_PENDING

Definition at line 181 of file mh5sig.c.

void MHEG5SetSigVerifyCallback ( void(*)(void)  callback)

Sets the callback to be called when pending requests are resolved.

Parameters
callbackCallback function to be called when pending requests are resolved
Returns
Nothing

Definition at line 290 of file mh5sig.c.