OpenSecurityGuardManager.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. //
  2. // OpenSecurityGuardSDK version 2.1.0
  3. //
  4. #import <Foundation/Foundation.h>
  5. /**
  6. * 各compoent的compoentid,在获取component对象时传入
  7. */
  8. typedef enum {
  9. /**
  10. * 签名component
  11. */
  12. OpenSecureSignatureComponentID,
  13. /**
  14. * 动态存储component
  15. */
  16. OpenDynamicDataStoreComponentID,
  17. /**
  18. * 静态存储component
  19. */
  20. OpenStaticDataStoreComponentID,
  21. /**
  22. * 初始化component
  23. */
  24. OpenInitComponentID,
  25. /**
  26. * 静态加解密component
  27. */
  28. OpenStaticDataEncryptCompnentID,
  29. /**
  30. * data collection compnent
  31. */
  32. OpenDataCollectionCompnentID,
  33. /**
  34. * dynamic data encrypt componentID
  35. */
  36. OpenDynamicDataEncryptComponentID,
  37. /**
  38. * StaticKeyEncrypt componentID
  39. */
  40. OpenStaticKeyEncryptComponentID,
  41. /**
  42. * UMID componentID
  43. */
  44. OpenUMIDComponentID,
  45. /**
  46. * OpenSDK componentID
  47. */
  48. OpenOpenSDKComponentID,
  49. /**
  50. * AtlasEncrypt ComponentID
  51. */
  52. OpenAtlasEncryptComponentID,
  53. /**
  54. * SimulatorDetect ComponentID
  55. */
  56. OpenSimulatorDetectComponentID,
  57. /**
  58. * NoCpatcha ComponentID
  59. */
  60. OpenNoCaptchaComponentID,
  61. /**
  62. * SecurityBody ComponentID
  63. */
  64. OpenSecurityBodyComponentID,
  65. /**
  66. * 无效component
  67. */
  68. OpenInvalidComponentID
  69. } OpenSecurityGuardComponentID;
  70. /**
  71. * 签名接口,详细定义见:IOpenSecureSignatureComponent.h
  72. */
  73. @protocol IOpenSecureSignatureComponent;
  74. /**
  75. * 动态数据存储接口,详细定义见:IOpenDynamicDataStoreComponent.h
  76. */
  77. @protocol IOpenDynamicDataStoreComponent;
  78. /**
  79. * 静态数据存储接口,详细定义见:IOpenStaticDataStoreComponent.h
  80. */
  81. @protocol IOpenStaticDataStoreComponent;
  82. /**
  83. * 静态数据存储接口,详细定义见:IOpenStaticDataEncryptComponent.h
  84. */
  85. @protocol IOpenStaticDataEncryptComponent;
  86. /**
  87. * 数据采集接口,详细定义见:IOpenDataCollectionComponent.h
  88. */
  89. @protocol IOpenDataCollectionComponent;
  90. /**
  91. * 动态数据加密接口,详细定义见:IOpenDynamicDataEncryptComponent.h
  92. */
  93. @protocol IOpenDynamicDataEncryptComponent;
  94. /**
  95. * 静态密钥安全加密接口,详细定义见:IOpenStaticKeyEncryptComponent.h
  96. */
  97. @protocol IOpenStaticKeyEncryptComponent;
  98. /**
  99. * 获取 umid 接口, 详细定义见 IUMIDComponent.h
  100. */
  101. @protocol IOpenUMIDComponent;
  102. /**
  103. * 获取 openSDK 接口, 详细定义见 IOpenOpenSDKComponent.h
  104. */
  105. @protocol IOpenOpenSDKComponent;
  106. /**
  107. * 增强加解密接口, 详细定义见 IOpenAtlasEncryptComponent.h
  108. */
  109. @protocol IOpenAtlasEncryptComponent;
  110. /**
  111. * NoCaptcha接口, 详细定义见 IOpenNocpatchaComponent.h
  112. */
  113. @protocol IOpenNoCaptchaComponent;
  114. /**
  115. * 模拟器检测接口, 详细定义见 IOpenSimulatorDetectComponent.h
  116. */
  117. @protocol IOpenSimulatorDetectComponent;
  118. /**
  119. * 人机接口, 详细定义见 IOpenSecurityBodyComponent.h
  120. */
  121. @protocol IOpenSecurityBodyComponent;
  122. /**
  123. * SecurityGuardSDK管理类
  124. */
  125. @interface OpenSecurityGuardManager : NSObject
  126. /**
  127. * 获取SecurityGuardManager单例对象
  128. *
  129. * @return SecurityGuardManager单例对象
  130. */
  131. + (OpenSecurityGuardManager*) getInstance;
  132. /**
  133. * 获取SecurityGuardManager单例对象
  134. *
  135. * @param authCode 初始化传入authcode
  136. *
  137. * @return SecurityGuardManager单例对象
  138. */
  139. + (OpenSecurityGuardManager*) getInstance: (NSString *)authCode
  140. error: (NSError * __autoreleasing *)error;
  141. /**
  142. * 获取SecurityGuardManager单例对象
  143. *
  144. * @param authCode 初始化传入authcode
  145. * @param customBundlePath 初始化传入自定义BundlePath
  146. *
  147. * @return SecurityGuardManager单例对象
  148. */
  149. + (OpenSecurityGuardManager*) getInstance: (NSString *)authCode
  150. withCustomBundlePath: (NSString *)customBundlePath
  151. error: (NSError * __autoreleasing *)error;
  152. /**
  153. * 获取安全签名接口
  154. *
  155. * @return 返回签名接口,失败时nil
  156. */
  157. - (id<IOpenSecureSignatureComponent>) getSecureSignatureComp;
  158. /**
  159. * 获取动态数据存储接口
  160. *
  161. * @return 返回动态数据存储接口,失败时nil
  162. */
  163. - (id<IOpenDynamicDataStoreComponent>) getDynamicDataStoreComp;
  164. /**
  165. * 获取静态数据存储接口
  166. *
  167. * @return 返回静态数据存储接口,失败时nil
  168. */
  169. - (id<IOpenStaticDataStoreComponent>) getStaticDataStoreComp;
  170. /**
  171. * 获取静态数据加密接口
  172. *
  173. * @return 返回模拟器检测模块,失败时nil
  174. */
  175. - (id<IOpenStaticDataEncryptComponent>) getStaticDataEncryptComp;
  176. /**
  177. * 获取数据采集接口
  178. *
  179. * @return 返回数据采集接口,失败时返回nil
  180. */
  181. - (id<IOpenDataCollectionComponent>) getDataCollectionComp;
  182. /**
  183. * 获取动态数据存储接口
  184. *
  185. * @return 返回动态数据存储接口,失败时返回nil
  186. */
  187. - (id<IOpenDynamicDataEncryptComponent>) getDynamicDataEncryptComp;
  188. /**
  189. * 获取静态密钥安全加解密接口
  190. *
  191. * @return 返回静态密钥安全加解密接口,失败时返回nil
  192. */
  193. - (id<IOpenStaticKeyEncryptComponent>) getStaticKeyEncryptComp;
  194. /**
  195. * 获取UMID接口
  196. *
  197. * @return 返回UMID接口,失败返回nil
  198. */
  199. - (id<IOpenUMIDComponent>) getUMIDComp;
  200. /**
  201. * 获取OpenSDK接口
  202. *
  203. * @return 返回OpenSDK接口,失败返回nil
  204. */
  205. - (id<IOpenOpenSDKComponent>) getOpenOpenSDKComp;
  206. /**
  207. * 获取增强加密接口
  208. *
  209. * @return 返回增强加密接口,失败返回nil
  210. */
  211. - (id<IOpenAtlasEncryptComponent>) getAtlasEncryptComp;
  212. /**
  213. * 获取NoCaptcha接口
  214. *
  215. * @return 返回NoCaptcha接口,失败返回nil
  216. */
  217. - (id<IOpenNoCaptchaComponent>) getNoCaptchaComp;
  218. /**
  219. * 获取模拟器检测接口
  220. *
  221. * @return 返回模拟器检测接口,失败返回nil
  222. */
  223. - (id<IOpenSimulatorDetectComponent>) getSimulatorDetectComp;
  224. /**
  225. * 获取人机接口
  226. *
  227. * @return 返回模拟器检测接口,失败返回nil
  228. */
  229. - (id<IOpenSecurityBodyComponent>) getSecurityBodyComp;
  230. /**
  231. * 根据传入的component id获取对应的component对象
  232. *
  233. * @param componentId 目标compoent的id
  234. *
  235. * @return 返回componentId对应的component对象,失败时返回nil
  236. */
  237. - (id) getComponent: (OpenSecurityGuardComponentID) componentId;
  238. /**
  239. * 根据传入的 protocol 获取接口
  240. *
  241. * @param protocol 要获取的 interface
  242. *
  243. * @return 返回的实现 protocol 的对象
  244. */
  245. - (id) getInterface: (Protocol*) protocol;
  246. /**
  247. * 获取sdk当前版本号
  248. *
  249. * @return sdk当前版本号
  250. */
  251. - (NSString*) getSDKVersion;
  252. /**
  253. * 是否为外部版本的无线保镖SDK
  254. *
  255. * @return 是否为外部版本的无线保镖SDK
  256. */
  257. - (BOOL) isOpen;
  258. /**
  259. * 设置用户数据,用于数据上报
  260. *
  261. * @return 无
  262. */
  263. + (BOOL) setGlobalUserData: (NSString *) key
  264. GlobalUserValue: (NSString *) value;
  265. @end