Vote count:
0
I'm completly lost on this subjet.
I've been checking countless websites, took libraries and exemple on internet but couldn't figure what's wrong.
My issue is the following: I got a public key in rsa looking like: "MIGfMA0G......DAQAB" (you can add = at the end if you want)
And I need to encrypt a simple NSString with it. Took me 10 minutes to do so on Android but I can't figure how to make it work on iOS...
I've tried, read and tried tweaking the following:
Using the last one I manager to store something with SecItemAdd but never manager to get anything back with SecItemCopyMatching. (event though I got no error coming from SecItemCopyMatching)
Using XRSA it seems my public key is not in the right format (he advises NSString *publicKey = @"MIICs ... kT0=\n"; // Base64 encoded key and I can't get a certificate in the init with mine) but I can't change the one I have.
I'm confused and really lost. What is exactly required for such a simple thing as encrypting a string with a public rsa key that is also a string? What step are needed and can you point me out a way to do it please?
NSString RSA Encryption in iOS
Aucun commentaire:
Enregistrer un commentaire