#ifndef _SECURITY_SECPOLICYSERVER_H_
#define _SECURITY_SECPOLICYSERVER_H_
#include <Security/SecPolicyInternal.h>
#include <Security/SecTrustSettings.h>
#include <securityd/policytree.h>
#include <securityd/SecTrustServer.h>
__BEGIN_DECLS
typedef struct OpaqueSecPVC *SecPVCRef;
struct OpaqueSecPVC {
SecPathBuilderRef builder;
CFArrayRef policies;
CFAbsoluteTime verifyTime;
SecCertificatePathRef path;
CFArrayRef details;
CFMutableDictionaryRef info;
policy_tree_t valid_policy_tree;
CFDictionaryRef callbacks;
CFIndex policyIX;
void *rvcs;
unsigned int asyncJobCount;
CFStringRef check_revocation;
bool response_required;
bool optionally_ev;
bool is_ev;
bool is_ct;
bool is_ct_whitelisted;
bool result;
};
void SecPVCInit(SecPVCRef pvc, SecPathBuilderRef builder, CFArrayRef policies,
CFAbsoluteTime verifyTime);
void SecPVCDelete(SecPVCRef pvc);
void SecPVCSetPath(SecPVCRef pvc, SecCertificatePathRef path,
CF_CONSUMED CFArrayRef details);
SecPolicyRef SecPVCGetPolicy(SecPVCRef pv);
CFAbsoluteTime SecPVCGetVerifyTime(SecPVCRef pv);
CFIndex SecPVCGetCertificateCount(SecPVCRef pv);
SecCertificateRef SecPVCGetCertificateAtIndex(SecPVCRef pv, CFIndex ix);
bool SecPVCIsCertificateAtIndexSelfSigned(SecPVCRef pvc, CFIndex ix);
bool SecPVCIsAnchored(SecPVCRef pvc);
bool SecPVCSetResult(SecPVCRef pv, CFStringRef key, CFIndex ix,
CFTypeRef result);
bool SecPVCSetResultForced(SecPVCRef pvc,
CFStringRef key, CFIndex ix, CFTypeRef result, bool force);
void SecPVCSetCheckRevocation(SecPVCRef pvc, CFStringRef method);
void SecPVCSetCheckRevocationResponseRequired(SecPVCRef pvc);
bool SecPVCLeafChecks(SecPVCRef pvc);
bool SecPVCParentCertificateChecks(SecPVCRef pvc, CFIndex ix);
bool SecPVCBlackListedKeyChecks(SecPVCRef pvc, CFIndex ix);
bool SecPVCGrayListedKeyChecks(SecPVCRef pvc, CFIndex ix);
bool SecPVCPathChecks(SecPVCRef pvc);
CFAbsoluteTime SecPVCGetEarliestNextUpdate(SecPVCRef pvc);
typedef void (*SecPolicyCheckFunction)(SecPVCRef pv, CFStringRef key);
bool SecPolicyValidate(SecPolicyRef policy, SecPVCRef pvc, CFStringRef key);
void SecPolicyServerInitalize(void);
bool SecPolicySubscriberCertificateCouldBeEV(SecCertificateRef certificate);
void SecEVPolicyToAnchorDigestsInit(void);
SecTrustSettingsResult SecPVCGetTrustSettingsResult(SecPVCRef pvc, SecCertificateRef certificate, CFArrayRef constraints);
bool SecPVCCheckUsageConstraints(SecPVCRef pvc);
__END_DECLS
#endif