Skip to content

yangtu222/RSAPublicKey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

RSAPublicKey

Using RSA publickey's modulus and exponent to create SecKeyRef and do encrytion and decrytion.

This takes me several days digging in stackoverflow and other websites and finally it works on iOS9.

Method:

  1. Use BasicEncodingRules to create a RSA public key object, which can be used for SecKeyEncrypt function to do encrypt.
  2. A workaround fix for BasicEncodingRules against iOS9 can be found in RSAPubKey.m, line 53.
  3. RSA decryption is using kSecPaddingNone mode, and handle the padding myself simply after SecKeyDecrypt. This is tested against Java PKCS1 Padding, not tested for C# or other languages.

About

Using RSA public key's modulus and exponent to create SecKeyRef and do encryption and decryption.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published