Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8323345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:41:58+00:00 2026-06-08T23:41:58+00:00

Using the apple built in Security framework and common crypto libraries I do not

  • 0

Using the apple built in Security framework and common crypto libraries I do not want to randomly generate RSA keys but I want to hardcode the file containing my special private key into the following function:

Code below was found here but I want to modify it to accomplish the above: Iphone – How to encrypt NSData with public key and decrypt with private key?

- (void)decryptWithPrivateKey:(uint8_t *)cipherBuffer plainBuffer:(uint8_t *)plainBuffer 
{ 
    OSStatus status = noErr; 

size_t cipherBufferSize = strlen((char *)cipherBuffer); 

NSLog(@"decryptWithPrivateKey: length of buffer: %lu", BUFFER_SIZE); 
NSLog(@"decryptWithPrivateKey: length of input: %lu", cipherBufferSize); 

// DECRYPTION 
size_t plainBufferSize = BUFFER_SIZE; 

//  Error handling 
status = SecKeyDecrypt([self getPrivateKeyRef], 
                       PADDING, 
                       &cipherBuffer[0], 
                       cipherBufferSize, 
                       &plainBuffer[0], 
                       &plainBufferSize 
                       ); 
NSLog(@"decryption result code: %ld (size: %lu)", status, plainBufferSize); 
NSLog(@"FINAL decrypted text: %s", plainBuffer); 

} 

Is it possible to do it with this function or do I have to rewrite the whole function to accomidate for my own private key use?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T23:41:59+00:00Added an answer on June 8, 2026 at 11:41 pm

    I figured out how to read this from a file by inputing the file path and importing the files to the project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using apple's sample URLCache ,but when i mention url, it loads data
I've opened the following input and output bluetooth streams using Apple's External Accessory Framework:
On a quite ancient UNIX (Apple A/UX 3.0.1 for 680x0 processors) using the built-in
Apple now says that apps built against the iPhone OS 2.0 SDK will not
I am using the IOBluetooth framework provided by Apple in OS X to communicate
This app is using iOS 5's built-in dictionary with UISearchBar. I want to include
simpatico$ /Developer/usr/bin/g++-4.2 -v Using built-in specs. Target: i686-apple-darwin10 Configured with: /var/tmp/gcc/gcc-5664~89/src/configure --disable-checking --enable-werror --prefix=/usr
I am using apple's custom table view cell code and modifying the drawRect code
I'm using Apple's EPFImporter tool http://www.apple.com/itunes/affiliates/resources/documentation/epfimporter.html It's a Python script that will take space
We were using Apple's Reachability a few months ago to check for the network

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.