No Description

openssl_wrapper.h 979B

123456789101112131415161718192021
  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. int rsa_sign_with_private_key_pem(char *message, int message_length
  9. , unsigned char *signature, unsigned int *signature_length
  10. , char *private_key_file_path);
  11. int rsa_verify_with_public_key_pem(char *message, int message_length
  12. , unsigned char *signature, unsigned int signature_length
  13. , char *public_key_file_path);
  14. NSString *base64StringFromData(NSData *signature);
  15. NSData *dataFromBase64String(NSString *base64String);
  16. NSString *rsaSignString(NSString *stringToSign, NSString *privateKeyFilePath, BOOL *signSuccess);
  17. void rsaVerifyString(NSString *stringToVerify, NSString *signature, NSString *publicKeyFilePath, BOOL *verifySuccess);
  18. NSString *formattedPEMString(NSString *originalString);