酷店

AlibcSecurityGuardBridge.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. * AlibcSecurityGuardBridge.h
  3. *
  4. * 阿里百川电商
  5. * 项目名称:阿里巴巴电商 AlibcTradeCommon
  6. * 版本号:3.1.1.93
  7. * 发布时间:2017-03-06
  8. * 开发团队:阿里巴巴百川商业化团队
  9. * 阿里巴巴电商SDK答疑群号:1229144682(阿里旺旺)
  10. * Copyright (c) 2016-2019 阿里巴巴-移动事业群-百川. All rights reserved.
  11. */
  12. #import <Foundation/Foundation.h>
  13. #ifndef AlibcSecurityGuardBridge_h
  14. #define AlibcSecurityGuardBridge_h
  15. @interface AlibcSecurityGuardBridge : NSObject
  16. #pragma mark - Life Cycle
  17. /**
  18. 安全模块初始化
  19. @param handler callback
  20. */
  21. + (void)asyncInit:(void (^)(NSError *))handler;
  22. #pragma mark - Info
  23. /**
  24. 安全是否可用
  25. @return 安全是否可用
  26. */
  27. + (BOOL)isSecurityGuardAvaleable;
  28. /**
  29. authCode
  30. @return auth code
  31. */
  32. + (NSString *)authCode;
  33. /**
  34. 获取AppKey
  35. @return AppKey
  36. */
  37. + (NSString *)getAppKey;
  38. #pragma mark - Encryption & Decryption
  39. /**
  40. 解析混淆ID
  41. @param itemId 混淆ID
  42. @return 明文ID
  43. */
  44. + (NSNumber *)analyzeItemId:(NSString *)itemId;
  45. #pragma mark - Storage
  46. + (NSString *)getString:(NSString *)key;
  47. + (int)putString:(NSString *)value forKey:(NSString *)key;
  48. + (NSData *)getData:(NSString *)key;
  49. + (int)putData:(NSData *)value forKey:(NSString *)key;
  50. @end
  51. /**
  52. Security Adapter 协议
  53. */
  54. @protocol AlibcSecurityAdapter <NSObject>
  55. - (void)asyncInit:(void (^)(NSError *))handler;
  56. #pragma mark - Info
  57. - (NSString *)getAppKey;
  58. #pragma mark - Encryption & Decryption
  59. - (NSNumber *)analyzeItemId:(NSString *)itemId;
  60. #pragma mark - Storage
  61. - (NSString *)getString:(NSString *)key;
  62. - (int)putString:(NSString *)value forKey:(NSString *)key;
  63. - (NSData *)getData:(NSString *)key;
  64. - (int)putData:(NSData *)value forKey:(NSString *)key;
  65. @end
  66. #endif