openssl_wrapper.h 1.0 KB

1234567891011121314151617181920
  1. //
  2. // openssl_wrapper.h
  3. // ThirdDemoApp
  4. //
  5. // Created by Xu Hanjie on 11-1-20.
  6. // Copyright 2011 __MyCompanyName__. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. int rsa_sign_with_private_key_pem(char *message, int message_length
  10. , unsigned char *signature, unsigned int *signature_length
  11. , char *private_key_file_path, BOOL rsa2);
  12. int rsa_verify_with_public_key_pem(char *message, int message_length
  13. , unsigned char *signature, unsigned int signature_length
  14. , char *public_key_file_path, BOOL rsa2);
  15. NSString *base64StringFromData(NSData *signature);
  16. NSData *dataFromBase64String(NSString *base64String);
  17. NSString *rsaSignString(NSString *stringToSign, NSString *privateKeyFilePath, BOOL *signSuccess, BOOL rsa2);
  18. void rsaVerifyString(NSString *stringToVerify, NSString *signature, NSString *publicKeyFilePath, BOOL *verifySuccess, BOOL rsa2);
  19. NSString *formattedPEMString(NSString *originalString);