trusted_cert_utils.h [plain text]
#ifndef _TRUSTED_CERT_UTILS_H_
#define _TRUSTED_CERT_UTILS_H_ 1
#include <Security/SecCertificate.h>
#include <Security/SecPolicy.h>
#include <Security/SecTrust.h>
#include <Security/SecTrustedApplication.h>
#ifdef __cplusplus
extern "C" {
#endif
#define CFRELEASE(cf) if(cf != NULL) { CFRelease(cf); }
extern void indentIncr(void);
extern void indentDecr(void);
extern void indent(void);
void printAscii(const char *buf, unsigned len, unsigned maxLen);
void printHex(const unsigned char *buf, unsigned len, unsigned maxLen);
void printCfStr(CFStringRef cfstr);
void printCFDate(CFDateRef dateRef);
void printCfNumber(CFNumberRef cfNum);
void printResultType(CFNumberRef cfNum);
void printKeyUsage(CFNumberRef cfNum);
void printCssmErr(CFNumberRef cfNum);
void printCertLabel(SecCertificateRef certRef);
void printCertDescription(SecCertificateRef certRef);
void printCertText(SecCertificateRef certRef);
void printCertChain(SecTrustRef trustRef, bool printPem, bool printText);
extern SecPolicyRef oidToPolicy(const CSSM_OID *oid);
extern SecPolicyRef oidStringToPolicy(const char *oidStr);
extern const char *oidToOidString(const CSSM_OID *oid);
extern int compareOids(const CSSM_OID *oid1, const CSSM_OID *oid2);
extern SecTrustedApplicationRef appPathToAppRef(const char *appPath);
int readCertFile(const char *fileName, SecCertificateRef *certRef);
const CSSM_OID *policyStringToOid(const char *policy, bool *useTLS);
CFOptionFlags revCheckOptionStringToFlags(const char *revCheckOption);
#ifdef __cplusplus
}
#endif
#endif