洛阳学员端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.1 KiB

8 months ago
  1. //
  2. // AntSecurityManager.h
  3. // APPSecuritySDK
  4. //
  5. // Created by msq on 2018/8/20.
  6. // Copyright © 2018年 Alipay. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. typedef enum: NSInteger {
  10. //正常
  11. SEC_STORE_OK = 0,
  12. //未找到
  13. SEC_STORE_NOT_FOUND = 10001,
  14. //拷贝
  15. SEC_STORE_CP = 10002,
  16. //内部错误
  17. SEC_STORE_ERR = 10003,
  18. SEC_STORE_PARAM_ERR = 10004,
  19. SEC_STORE_DEGRADE_ERR = 10005,
  20. } SEC_STORE_ERR_CODE;
  21. @interface APSecStoreResult : NSObject
  22. @property (nonatomic, strong) NSString* value;
  23. @property (nonatomic, assign) SEC_STORE_ERR_CODE errCode;
  24. @property (nonatomic, assign) int errCodeDetail;
  25. @end
  26. @interface AntSecurityManager : NSObject
  27. /**
  28. * brief aes_encrypt
  29. * ase
  30. * param data
  31. *
  32. * return
  33. *
  34. * nil
  35. */
  36. + (NSString*)securityEncrypt:(NSString*)data;
  37. /**
  38. * brief aes_decrypt
  39. * ase
  40. * param data
  41. *
  42. * return
  43. *
  44. * nil
  45. */
  46. + (NSString*)securityDecrypt:(NSString*)data;
  47. /**
  48. * brief wbSign
  49. *
  50. * param data
  51. *
  52. * return
  53. * 44B base64文本
  54. */
  55. + (NSString*)wbSign:(NSString*)data;
  56. /**
  57. *
  58. *@param key
  59. *@param value
  60. *@param bizType
  61. *@return 00
  62. */
  63. + (int) setSafeStore:(NSString*)key value:(NSString*)value bizType:(NSString*)bizType;
  64. /**
  65. *
  66. *@param key
  67. *@param bizType
  68. *@return APSecStoreResult对象
  69. * SEC_STORE_OK 0
  70. * SEC_STORE_NOT_FOUND 10001
  71. * SEC_STORE_CP 10002
  72. * SEC_STORE_ERR 10003
  73. */
  74. + (APSecStoreResult*)getSafeStore:(NSString*)key bizType:(NSString*)bizType;
  75. /**
  76. *
  77. *@param key
  78. *@param bizType
  79. *@return 00
  80. */
  81. + (int) deleteSafeStore:(NSString*)key bizType:(NSString*)bizType;
  82. @end