KMDSignatureManager.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // KMDSignatureManager.h
  3. // SignFlow
  4. //
  5. // Created by 丁林圭 on 2021/8/2.
  6. //
  7. #import <Foundation/Foundation.h>
  8. #define DSignatureDidStartLoadNotification @"DSignatureDidStartLoadNotification"
  9. #define DSignatureDidFinishLoadNotification @"DSignatureDidFinishLoadNotification"
  10. @interface KMDSignatureModel: NSObject
  11. @property (nonatomic,assign) SecIdentityRef identityRef;
  12. @property (nonatomic,retain) NSString *name;
  13. @property (nonatomic,retain) NSDate *expiresDate;
  14. @property (nonatomic,retain) NSString *issusName;
  15. @property (nonatomic,retain) NSString *DN;
  16. @property (nonatomic,assign) BOOL isFormKeyChain;
  17. @property (nonatomic,retain) NSString *filePath;
  18. @property (nonatomic,retain) NSString *password;
  19. @end
  20. @interface KMDSignatureManager : NSObject
  21. @property (nonatomic,readonly) NSMutableArray *signatures;
  22. + (KMDSignatureManager *)defaultManager;
  23. + (BOOL)exportKeyChainWithP12FilePath:(NSString *)filePath signatureModel:(KMDSignatureModel *)model passWord:(NSString *)passWord;
  24. + (SecIdentityRef)privateKeyUsingSecItemImportFromP12File:(NSString *)filePath password:(NSString *)password;
  25. - (void)loadAllKeyChainCertificates;
  26. - (BOOL)importKeyChainWithP12FilePath:(NSString *)filePath passWord:(NSString *)passWord;
  27. - (BOOL)moveP12DigitalFileWithFilePath:(NSString *)filePath password:(NSString *)password;
  28. - (void)addSignatureCertPath:(NSString *)filePath passWord:(NSString *)password;
  29. - (BOOL)removeSignatureCertPath:(NSString *)filePath;
  30. - (NSArray *)sortContens:(NSArray *)contens;
  31. @end