Open ElyasNaranjeeSani opened 8 years ago
Hi,
First, thanks for your awesome tool. I'm trying to sign a string with SHA256 as below. ,,,
NSData *messageData = [message dataUsingEncoding:NSUTF8StringEncoding]; NSData *signature = [[keyPair private] signWithSHA256:messageData error:&signingError];
,,,
There is no signing error and the signature variable in not nil. I need the signature as a base64 encoded string but when I wanna convert the signature to string none of the below solutions works and all of them returns nil.
NSString *str1=[[NSString alloc]initWithData:signature encoding:NSUTF8StringEncoding]; NSString* str2 = [NSString stringWithUTF8String:(char *)[signature bytes]]; NSString* str3 = [NSString stringWithUTF8String:[signature bytes]];
Appreciate any help, Thanks
Try: NSLog(@"%@", [[NSString alloc] initWithData:[signature base64EncodedDataWithOptions:NSDataBase64EncodignEndLineWithLineFeed] encoding:NSUTF8StringEncoding]);
NSLog(@"%@", [[NSString alloc] initWithData:[signature base64EncodedDataWithOptions:NSDataBase64EncodignEndLineWithLineFeed] encoding:NSUTF8StringEncoding]);
Hi,
First, thanks for your awesome tool. I'm trying to sign a string with SHA256 as below. ,,,
,,,
There is no signing error and the signature variable in not nil. I need the signature as a base64 encoded string but when I wanna convert the signature to string none of the below solutions works and all of them returns nil.
,,,
,,,
Appreciate any help, Thanks