#ifndef __CONFIGAPI__H__ #define __CONFIGAPI__H__ #include #include "stringutils.h" enum CertifiateStore { CERTSTORE_PRIVILEGED, // for privileged apps (OEM_CERTIFY_TRUST); CERTSTORE_UNPRIVILEGED, // for un-privileged apps (OEM_CERTIFY_RUN); CERTSTORE_SPC, // for signed cabs CERTSTORE_CA, // browser certificate authorities CERTSTORE_ROOT, // browser root certificates CERTSTORE_MY, // my browser certificates }; extern const char* storenames[]; #define CFGFLAG_PROCESS 0x0001 #define CFGFLAG_METADATA 0x0002 bool LoadRapi(); void UnloadRapi(); bool LoadProvisioningDoc(const std::string& xml, std::string& answer); std::string pd_SetSecurityPolicy(DWORD dwPolicyId, DWORD dwValue); std::string pd_GetSecurityPolicy(DWORD dwPolicyId); std::string pd_DeleteSecurityPolicy(DWORD dwPolicyId); std::string pd_LoadCertificate(const std::string& storename, DWORD dwRole, const ByteVector &certificate); std::string pd_QueryCertificateStore(const std::string& storename); std::string pd_QueryCertificateStore(const std::string& storename, const std::string& certsha1); std::string pd_DeleteCertificate(const std::string& storename, const std::string& sha1hex_str); std::string pd_DeleteRegistryValue(const std::string &key, const std::string &valname); std::string pd_DeleteRegistryValues(const std::string &key, StringList::const_iterator begin, StringList::const_iterator end); std::string pd_DeleteRegistryKey(const std::string &key); std::string pd_QueryRegistryValue(const std::string &key, const std::string &valname); std::string pd_QueryRegistryKey(const std::string &key); std::string pd_SetRegistryValue(const std::string &key, const std::string &valname, const std::string &type, const std::string &value); std::string pd_SetRegistryInteger(const std::string &key, const std::string &valname, DWORD value); std::string pd_SetRegistryString(const std::string &key, const std::string &valname, const std::string &value); std::string pd_SetRegistryStringList(const std::string &key, const std::string &valname, const StringList &value); std::string pd_SetMetabaseKey(const std::string& key, DWORD rwaccess, DWORD role); std::string pd_DeleteMetabaseKey(const std::string& key); std::string pd_QueryMetabaseKey(const std::string& key); bool calc_cert_sha1(const std::string& certfile, std::string& sha1hex_str); bool get_cert_from_file(const std::string& certfile, ByteVector& cert); #endif