#ifndef _DER_DIGEST_H_
#define _DER_DIGEST_H_
#ifdef __cplusplus
extern "C" {
#endif
#include "libDER.h"
#define DER_SHA1_DIGEST_LEN 20
#define DER_SHA1_DIGEST_INFO_LEN 35
DERReturn DEREncodeSHA1DigestInfo(
const DERByte *sha1Digest,
DERSize sha1DigestLen,
DERByte *result,
DERSize *resultLen);
#define DER_SHA256_DIGEST_LEN 32
#define DER_SHA256_DIGEST_INFO_LEN 51
DERReturn DEREncodeSHA256DigestInfo(
const DERByte *sha256Digest,
DERSize sha256DigestLen,
DERByte *result,
DERSize *resultLen);
#define DER_MD_DIGEST_LEN 16
#define DER_MD_DIGEST_INFO_LEN 34
typedef enum {
WD_MD2 = 1,
WD_MD5 = 2
} WhichDigest;
DERReturn DEREncodeMDDigestInfo(
WhichDigest whichDigest,
const DERByte *mdDigest,
DERSize mdDigestLen,
DERByte *result,
DERSize *resultLen);
#define DER_MAX_DIGEST_LEN DER_SHA256_DIGEST_LEN
#define DER_MAX_ENCODED_INFO_LEN DER_SHA256_DIGEST_INFO_LEN
#ifdef __cplusplus
}
#endif
#endif