RSAEncryptor.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. //
  2. // RSAEncryptor.m
  3. // RSA加密
  4. //
  5. // Created by liaowentao on 17/4/19.
  6. // Copyright © 2017年 Haochuang. All rights reserved.
  7. //
  8. #import "RSAEncryptor.h"
  9. #import <Security/Security.h>
  10. @implementation RSAEncryptor
  11. static NSString *base64_encode_data(NSData *data){
  12. data = [data base64EncodedDataWithOptions:0];
  13. NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  14. return ret;
  15. }
  16. static NSData *base64_decode(NSString *str){
  17. NSData *data = [[NSData alloc] initWithBase64EncodedString:str options:NSDataBase64DecodingIgnoreUnknownCharacters];
  18. return data;
  19. }
  20. #pragma mark - 使用'.der'公钥文件加密
  21. //加密
  22. + (NSString *)encryptString:(NSString *)str publicKeyWithContentsOfFile:(NSString *)path{
  23. if (!str || !path) return nil;
  24. return [self encryptString:str publicKeyRef:[self getPublicKeyRefWithContentsOfFile:path]];
  25. }
  26. //获取公钥
  27. + (SecKeyRef)getPublicKeyRefWithContentsOfFile:(NSString *)filePath{
  28. NSData *certData = [NSData dataWithContentsOfFile:filePath];
  29. if (!certData) {
  30. return nil;
  31. }
  32. SecCertificateRef cert = SecCertificateCreateWithData(NULL, (CFDataRef)certData);
  33. SecKeyRef key = NULL;
  34. SecTrustRef trust = NULL;
  35. SecPolicyRef policy = NULL;
  36. if (cert != NULL) {
  37. policy = SecPolicyCreateBasicX509();
  38. if (policy) {
  39. if (SecTrustCreateWithCertificates((CFTypeRef)cert, policy, &trust) == noErr) {
  40. SecTrustResultType result;
  41. if (SecTrustEvaluate(trust, &result) == noErr) {
  42. key = SecTrustCopyPublicKey(trust);
  43. }
  44. }
  45. }
  46. }
  47. if (policy) CFRelease(policy);
  48. if (trust) CFRelease(trust);
  49. if (cert) CFRelease(cert);
  50. return key;
  51. }
  52. + (NSString *)encryptString:(NSString *)str publicKeyRef:(SecKeyRef)publicKeyRef{
  53. if(![str dataUsingEncoding:NSUTF8StringEncoding]){
  54. return nil;
  55. }
  56. if(!publicKeyRef){
  57. return nil;
  58. }
  59. NSData *data = [self encryptData:[str dataUsingEncoding:NSUTF8StringEncoding] withKeyRef:publicKeyRef];
  60. NSString *ret = base64_encode_data(data);
  61. return ret;
  62. }
  63. + (NSData *)encryptData:(NSData *)key publicKeyWithContentsOfFile:(NSString *)path
  64. {
  65. return [self encryptData:key withKeyRef:[self getPublicKeyRefWithContentsOfFile:path]];
  66. }
  67. #pragma mark - 使用'.12'私钥文件解密
  68. //解密
  69. + (NSString *)decryptString:(NSString *)str privateKeyWithContentsOfFile:(NSString *)path password:(NSString *)password{
  70. if (!str || !path) return nil;
  71. if (!password) password = @"";
  72. return [self decryptString:str privateKeyRef:[self getPrivateKeyRefWithContentsOfFile:path password:password]];
  73. }
  74. //获取私钥
  75. + (SecKeyRef)getPrivateKeyRefWithContentsOfFile:(NSString *)filePath password:(NSString*)password{
  76. NSData *p12Data = [NSData dataWithContentsOfFile:filePath];
  77. if (!p12Data) {
  78. return nil;
  79. }
  80. SecKeyRef privateKeyRef = NULL;
  81. NSMutableDictionary * options = [[NSMutableDictionary alloc] init];
  82. [options setObject: password forKey:(__bridge id)kSecImportExportPassphrase];
  83. CFArrayRef items = CFArrayCreate(NULL, 0, 0, NULL);
  84. OSStatus securityError = SecPKCS12Import((__bridge CFDataRef) p12Data, (__bridge CFDictionaryRef)options, &items);
  85. if (securityError == noErr && CFArrayGetCount(items) > 0) {
  86. CFDictionaryRef identityDict = CFArrayGetValueAtIndex(items, 0);
  87. SecIdentityRef identityApp = (SecIdentityRef)CFDictionaryGetValue(identityDict, kSecImportItemIdentity);
  88. securityError = SecIdentityCopyPrivateKey(identityApp, &privateKeyRef);
  89. if (securityError != noErr) {
  90. privateKeyRef = NULL;
  91. }
  92. }
  93. CFRelease(items);
  94. return privateKeyRef;
  95. }
  96. + (NSString *)decryptString:(NSString *)str privateKeyRef:(SecKeyRef)privKeyRef{
  97. NSData *data = [[NSData alloc] initWithBase64EncodedString:str options:NSDataBase64DecodingIgnoreUnknownCharacters];
  98. if (!privKeyRef) {
  99. return nil;
  100. }
  101. data = [self decryptData:data withKeyRef:privKeyRef];
  102. NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  103. return ret;
  104. }
  105. #pragma mark - 使用公钥字符串加密
  106. /* START: Encryption with RSA public key */
  107. //使用公钥字符串加密
  108. + (NSString *)encryptString:(NSString *)str publicKey:(NSString *)pubKey{
  109. NSData *data = [self encryptData:[str dataUsingEncoding:NSUTF8StringEncoding] publicKey:pubKey];
  110. NSString *ret = base64_encode_data(data);
  111. return ret;
  112. }
  113. + (NSData *)encryptData:(NSData *)data publicKey:(NSString *)pubKey{
  114. if(!data || !pubKey){
  115. return nil;
  116. }
  117. SecKeyRef keyRef = [self addPublicKey:pubKey];
  118. if(!keyRef){
  119. return nil;
  120. }
  121. return [self encryptData:data withKeyRef:keyRef];
  122. }
  123. + (SecKeyRef)addPublicKey:(NSString *)key{
  124. NSRange spos = [key rangeOfString:@"-----BEGIN PUBLIC KEY-----"];
  125. NSRange epos = [key rangeOfString:@"-----END PUBLIC KEY-----"];
  126. if(spos.location != NSNotFound && epos.location != NSNotFound){
  127. NSUInteger s = spos.location + spos.length;
  128. NSUInteger e = epos.location;
  129. NSRange range = NSMakeRange(s, e-s);
  130. key = [key substringWithRange:range];
  131. }
  132. key = [key stringByReplacingOccurrencesOfString:@"\r" withString:@""];
  133. key = [key stringByReplacingOccurrencesOfString:@"\n" withString:@""];
  134. key = [key stringByReplacingOccurrencesOfString:@"\t" withString:@""];
  135. key = [key stringByReplacingOccurrencesOfString:@" " withString:@""];
  136. // This will be base64 encoded, decode it.
  137. NSData *data = base64_decode(key);
  138. data = [self stripPublicKeyHeader:data];
  139. if(!data){
  140. return nil;
  141. }
  142. //a tag to read/write keychain storage
  143. NSString *tag = @"RSAUtil_PubKey";
  144. NSData *d_tag = [NSData dataWithBytes:[tag UTF8String] length:[tag length]];
  145. // Delete any old lingering key with the same tag
  146. NSMutableDictionary *publicKey = [[NSMutableDictionary alloc] init];
  147. [publicKey setObject:(__bridge id) kSecClassKey forKey:(__bridge id)kSecClass];
  148. [publicKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType];
  149. [publicKey setObject:d_tag forKey:(__bridge id)kSecAttrApplicationTag];
  150. SecItemDelete((__bridge CFDictionaryRef)publicKey);
  151. // Add persistent version of the key to system keychain
  152. [publicKey setObject:data forKey:(__bridge id)kSecValueData];
  153. [publicKey setObject:(__bridge id) kSecAttrKeyClassPublic forKey:(__bridge id)
  154. kSecAttrKeyClass];
  155. [publicKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)
  156. kSecReturnPersistentRef];
  157. CFTypeRef persistKey = nil;
  158. OSStatus status = SecItemAdd((__bridge CFDictionaryRef)publicKey, &persistKey);
  159. if (persistKey != nil){
  160. CFRelease(persistKey);
  161. }
  162. if ((status != noErr) && (status != errSecDuplicateItem)) {
  163. return nil;
  164. }
  165. [publicKey removeObjectForKey:(__bridge id)kSecValueData];
  166. [publicKey removeObjectForKey:(__bridge id)kSecReturnPersistentRef];
  167. [publicKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)kSecReturnRef];
  168. [publicKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType];
  169. // Now fetch the SecKeyRef version of the key
  170. SecKeyRef keyRef = nil;
  171. status = SecItemCopyMatching((__bridge CFDictionaryRef)publicKey, (CFTypeRef *)&keyRef);
  172. if(status != noErr){
  173. return nil;
  174. }
  175. return keyRef;
  176. }
  177. + (NSData *)stripPublicKeyHeader:(NSData *)d_key{
  178. // Skip ASN.1 public key header
  179. if (d_key == nil) return(nil);
  180. unsigned long len = [d_key length];
  181. if (!len) return(nil);
  182. unsigned char *c_key = (unsigned char *)[d_key bytes];
  183. unsigned int idx = 0;
  184. if (c_key[idx++] != 0x30) return(nil);
  185. if (c_key[idx] > 0x80) idx += c_key[idx] - 0x80 + 1;
  186. else idx++;
  187. // PKCS #1 rsaEncryption szOID_RSA_RSA
  188. static unsigned char seqiod[] =
  189. { 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x01,
  190. 0x01, 0x05, 0x00 };
  191. if (memcmp(&c_key[idx], seqiod, 15)) return(nil);
  192. idx += 15;
  193. if (c_key[idx++] != 0x03) return(nil);
  194. if (c_key[idx] > 0x80) idx += c_key[idx] - 0x80 + 1;
  195. else idx++;
  196. if (c_key[idx++] != '\0') return(nil);
  197. // Now make a new NSData from this buffer
  198. return ([NSData dataWithBytes:&c_key[idx] length:len - idx]);
  199. }
  200. + (NSData *)encryptData:(NSData *)data withKeyRef:(SecKeyRef) keyRef{
  201. const uint8_t *srcbuf = (const uint8_t *)[data bytes];
  202. size_t srclen = (size_t)data.length;
  203. size_t block_size = SecKeyGetBlockSize(keyRef) * sizeof(uint8_t);
  204. void *outbuf = malloc(block_size);
  205. size_t src_block_size = block_size - 11;
  206. NSMutableData *ret = [[NSMutableData alloc] init];
  207. for(int idx=0; idx<srclen; idx+=src_block_size){
  208. //NSLog(@"%d/%d block_size: %d", idx, (int)srclen, (int)block_size);
  209. size_t data_len = srclen - idx;
  210. if(data_len > src_block_size){
  211. data_len = src_block_size;
  212. }
  213. size_t outlen = block_size;
  214. OSStatus status = noErr;
  215. status = SecKeyEncrypt(keyRef,
  216. kSecPaddingPKCS1,
  217. srcbuf + idx,
  218. data_len,
  219. outbuf,
  220. &outlen
  221. );
  222. if (status != 0) {
  223. NSLog(@"SecKeyEncrypt fail. Error Code: %d", status);
  224. ret = nil;
  225. break;
  226. }else{
  227. [ret appendBytes:outbuf length:outlen];
  228. }
  229. }
  230. free(outbuf);
  231. CFRelease(keyRef);
  232. return ret;
  233. }
  234. /* END: Encryption with RSA public key */
  235. #pragma mark - 使用私钥字符串解密
  236. /* START: Decryption with RSA private key */
  237. //使用私钥字符串解密
  238. + (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey{
  239. if (!str) return nil;
  240. NSData *data = [[NSData alloc] initWithBase64EncodedString:str options:NSDataBase64DecodingIgnoreUnknownCharacters];
  241. data = [self decryptData:data privateKey:privKey];
  242. NSString *ret = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
  243. return ret;
  244. }
  245. + (NSData *)decryptData:(NSData *)data privateKey:(NSString *)privKey{
  246. if(!data || !privKey){
  247. return nil;
  248. }
  249. SecKeyRef keyRef = [self addPrivateKey:privKey];
  250. if(!keyRef){
  251. return nil;
  252. }
  253. return [self decryptData:data withKeyRef:keyRef];
  254. }
  255. + (SecKeyRef)addPrivateKey:(NSString *)key{
  256. NSRange spos = [key rangeOfString:@"-----BEGIN RSA PRIVATE KEY-----"];
  257. NSRange epos = [key rangeOfString:@"-----END RSA PRIVATE KEY-----"];
  258. if(spos.location != NSNotFound && epos.location != NSNotFound){
  259. NSUInteger s = spos.location + spos.length;
  260. NSUInteger e = epos.location;
  261. NSRange range = NSMakeRange(s, e-s);
  262. key = [key substringWithRange:range];
  263. }
  264. key = [key stringByReplacingOccurrencesOfString:@"\r" withString:@""];
  265. key = [key stringByReplacingOccurrencesOfString:@"\n" withString:@""];
  266. key = [key stringByReplacingOccurrencesOfString:@"\t" withString:@""];
  267. key = [key stringByReplacingOccurrencesOfString:@" " withString:@""];
  268. // This will be base64 encoded, decode it.
  269. NSData *data = base64_decode(key);
  270. data = [self stripPrivateKeyHeader:data];
  271. if(!data){
  272. return nil;
  273. }
  274. //a tag to read/write keychain storage
  275. NSString *tag = @"RSAUtil_PrivKey";
  276. NSData *d_tag = [NSData dataWithBytes:[tag UTF8String] length:[tag length]];
  277. // Delete any old lingering key with the same tag
  278. NSMutableDictionary *privateKey = [[NSMutableDictionary alloc] init];
  279. [privateKey setObject:(__bridge id) kSecClassKey forKey:(__bridge id)kSecClass];
  280. [privateKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType];
  281. [privateKey setObject:d_tag forKey:(__bridge id)kSecAttrApplicationTag];
  282. SecItemDelete((__bridge CFDictionaryRef)privateKey);
  283. // Add persistent version of the key to system keychain
  284. [privateKey setObject:data forKey:(__bridge id)kSecValueData];
  285. [privateKey setObject:(__bridge id) kSecAttrKeyClassPrivate forKey:(__bridge id)
  286. kSecAttrKeyClass];
  287. [privateKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)
  288. kSecReturnPersistentRef];
  289. CFTypeRef persistKey = nil;
  290. OSStatus status = SecItemAdd((__bridge CFDictionaryRef)privateKey, &persistKey);
  291. if (persistKey != nil){
  292. CFRelease(persistKey);
  293. }
  294. if ((status != noErr) && (status != errSecDuplicateItem)) {
  295. return nil;
  296. }
  297. [privateKey removeObjectForKey:(__bridge id)kSecValueData];
  298. [privateKey removeObjectForKey:(__bridge id)kSecReturnPersistentRef];
  299. [privateKey setObject:[NSNumber numberWithBool:YES] forKey:(__bridge id)kSecReturnRef];
  300. [privateKey setObject:(__bridge id) kSecAttrKeyTypeRSA forKey:(__bridge id)kSecAttrKeyType];
  301. // Now fetch the SecKeyRef version of the key
  302. SecKeyRef keyRef = nil;
  303. status = SecItemCopyMatching((__bridge CFDictionaryRef)privateKey, (CFTypeRef *)&keyRef);
  304. if(status != noErr){
  305. return nil;
  306. }
  307. return keyRef;
  308. }
  309. + (NSData *)stripPrivateKeyHeader:(NSData *)d_key{
  310. // Skip ASN.1 private key header
  311. if (d_key == nil) return(nil);
  312. unsigned long len = [d_key length];
  313. if (!len) return(nil);
  314. unsigned char *c_key = (unsigned char *)[d_key bytes];
  315. unsigned int idx = 22; //magic byte at offset 22
  316. if (0x04 != c_key[idx++]) return nil;
  317. //calculate length of the key
  318. unsigned int c_len = c_key[idx++];
  319. int det = c_len & 0x80;
  320. if (!det) {
  321. c_len = c_len & 0x7f;
  322. } else {
  323. int byteCount = c_len & 0x7f;
  324. if (byteCount + idx > len) {
  325. //rsa length field longer than buffer
  326. return nil;
  327. }
  328. unsigned int accum = 0;
  329. unsigned char *ptr = &c_key[idx];
  330. idx += byteCount;
  331. while (byteCount) {
  332. accum = (accum << 8) + *ptr;
  333. ptr++;
  334. byteCount--;
  335. }
  336. c_len = accum;
  337. }
  338. // Now make a new NSData from this buffer
  339. return [d_key subdataWithRange:NSMakeRange(idx, c_len)];
  340. }
  341. + (NSData *)decryptData:(NSData *)data withKeyRef:(SecKeyRef) keyRef{
  342. const uint8_t *srcbuf = (const uint8_t *)[data bytes];
  343. size_t srclen = (size_t)data.length;
  344. size_t block_size = SecKeyGetBlockSize(keyRef) * sizeof(uint8_t);
  345. UInt8 *outbuf = malloc(block_size);
  346. size_t src_block_size = block_size;
  347. NSMutableData *ret = [[NSMutableData alloc] init];
  348. for(int idx=0; idx<srclen; idx+=src_block_size){
  349. //NSLog(@"%d/%d block_size: %d", idx, (int)srclen, (int)block_size);
  350. size_t data_len = srclen - idx;
  351. if(data_len > src_block_size){
  352. data_len = src_block_size;
  353. }
  354. size_t outlen = block_size;
  355. OSStatus status = noErr;
  356. status = SecKeyDecrypt(keyRef,
  357. kSecPaddingNone,
  358. srcbuf + idx,
  359. data_len,
  360. outbuf,
  361. &outlen
  362. );
  363. if (status != 0) {
  364. NSLog(@"SecKeyEncrypt fail. Error Code: %d", status);
  365. ret = nil;
  366. break;
  367. }else{
  368. //the actual decrypted data is in the middle, locate it!
  369. int idxFirstZero = -1;
  370. int idxNextZero = (int)outlen;
  371. for ( int i = 0; i < outlen; i++ ) {
  372. if ( outbuf[i] == 0 ) {
  373. if ( idxFirstZero < 0 ) {
  374. idxFirstZero = i;
  375. } else {
  376. idxNextZero = i;
  377. break;
  378. }
  379. }
  380. }
  381. [ret appendBytes:&outbuf[idxFirstZero+1] length:idxNextZero-idxFirstZero-1];
  382. }
  383. }
  384. free(outbuf);
  385. CFRelease(keyRef);
  386. return ret;
  387. }
  388. /**签名=MD5(除function其他所有输入参数拼接+密钥),输出32位,字母为大写*/
  389. + (NSDictionary *)getParameters:(NSArray *)parameterArray
  390. {
  391. NSMutableDictionary *backDict = [NSMutableDictionary dictionaryWithCapacity:parameterArray.count];
  392. NSMutableString *signCodeString = [NSMutableString string];
  393. // NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@"Danny",@"name",@"12",@"age",@"man",@"sex",nil];
  394. NSArray *allKeyArray = [backDict allKeys];
  395. NSArray *afterSortKeyArray = [allKeyArray sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) {
  396. NSComparisonResult resuest = [obj2 compare:obj1];
  397. return resuest;
  398. }];
  399. NSLog(@"afterSortKeyArray:%@",afterSortKeyArray);
  400. //通过排列的key值获取value
  401. NSMutableArray *valueArray = [NSMutableArray array];
  402. for (int i = 0; i < afterSortKeyArray.count; i ++) {
  403. NSString *sortsing = afterSortKeyArray[i];
  404. NSString *valueString = [backDict objectForKey:sortsing];
  405. [valueArray addObject:valueString];
  406. NSString *str = @"";
  407. if (i == 0) {
  408. str = [NSString stringWithFormat:@"%@=%@",sortsing,valueString];
  409. }else{
  410. str = [NSString stringWithFormat:@"&%@=%@",sortsing,valueString];
  411. }
  412. [signCodeString appendString:str];
  413. }
  414. NSLog(@"valueArray:%@",valueArray);
  415. // for(NSInteger i = 0; i < parameterArray.count; i++){
  416. //
  417. //
  418. // NSDictionary *dict = [parameterArray objectAtIndex:i];
  419. //
  420. //
  421. // [backDict setValuesForKeysWithDictionary:dict];
  422. // if (i != 0) {
  423. // NSString *value = [[dict allValues]objectAtIndex:0];
  424. // [signCodeString appendString:value];
  425. // }
  426. // }
  427. // [signCodeString appendString:MD5_KEY];
  428. NSString *signCodeMD5 = [RSAEncryptor encryptString:signCodeString publicKey:@"MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAIojm1NocLkuPTT54D0Jd3n6aZTUZYTDsSSSBezWobwXXdvAMMyXJ5ftDLcp0aF/x+nUjGtJYhU0pdsuvp9j1rKB0sd6fyxhYDr2lsoYl6jWxPjA5az8pZ1a6TCTEKZsqHjVsl6mWbnTENDD0ALQIONp5jsL0zi6XcOtxeWShOjNAgMBAAECgYAbISkVNXLF+53LtLNkaWKMkzB/KUOS0ngMzZzaScDT1ub5DILI+3qsLMMNieoAxL63XqYBQBVCQue75y9K0GnOsscMIFy1nOX3+e6eMLACAySTxK5forrTKV4GQyPv50IHgEgHj02XH1CpKnYZtcDclPU2LHWhCeLAA9nWNPINJQJBAPKpnq4CcLWYRSbJjSkmOQkntCgfDF0Go8m0CFlMxDSFla4Hvk+fLJ0WA6G2eTPmxKnkUb9nQAlgRr2tPpdvHWcCQQCRu0pskAbNV+JmwKU7D0mDNxix9BGso7sM1pG3mmmvGQbe4S/WDzanIujB7YnFtJ0sIcCH/smAuN7h8BOA0XOrAkAmZ3nZiEFWPBcVoGhaztXQARyeDOvj/R0G2xtHJsMWnN2ngUo5R7PD2KwSd9KOyELvsFbPuAOGeFo5wqVZShiZAkAWaGL4MGkrV9ETFZoSa7ZU+7rLWgkBr6dKQQ/k2FRZvRJmYN+3HV2880wwzXJ6uNvV9lahUpbvOP3kZcLJ8urDAkAboi8kLye1R/rZWQT/Spp17ooRxqlCYzjZ3QZ8egg4mgq4j6vs5B438p1cVCbu8E6DgQpD4juUfcC+H86sf/FK"];
  429. [backDict setObject:signCodeMD5 forKey:@"signCode"];
  430. return backDict;
  431. }
  432. /* END: Decryption with RSA private key */
  433. @end