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

  • Home
  • SEARCH
  • 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 8604785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:39:47+00:00 2026-06-12T02:39:47+00:00

Looking to store public/private key information securely on an iOS device. I know I

  • 0

Looking to store public/private key information securely on an iOS device. I know I want to store this in the KeyChain however I am not 100% sure what sort of attributes I need to populate in the SecRecord. I was going to do something like:

// private key
SecKeyChain.Add(new SecRecord(SecKind.Key)
{
    Accessible = SecAccessible.AlwaysThisDeviceOnly,
    KeySizeInBits = 512,
    KeyClass = SecKeyClass.Private,
    CanSign = true,
    ValueData = privateKeyValue,
    Account = publicKeyValue
});

Which would store the private key, then follow a similar approach for the public key replacing the Account attribute with a value unique to the user e.g. username. However, not sure if this is the right way to use this.

Does anyone have a good examples on how you would do this specifically for keys?

  • 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-12T02:39:48+00:00Added an answer on June 12, 2026 at 2:39 am

    Decided to go with the following approach:

    // store public key
    SecKeyChain.Add(new SecRecord(SecKind.Key)
    {
        ApplicationLabel = userName,
        Accessible = SecAccessible.AlwaysThisDeviceOnly,
        KeySizeInBits = 512,
        KeyClass = SecKeyClass.Public,
        ValueData = NSData.FromString(publicKey)
    });
    
    // store private key
    SecKeyChain.Add(new SecRecord(SecKind.Key)
    {
        ApplicationLabel = publicKey,
        Accessible = SecAccessible.AlwaysThisDeviceOnly,
        KeySizeInBits = 512,
        KeyClass = SecKeyClass.Private,
        CanSign = true,
        ValueData = NSData.FromString(secretKey)
    });
    

    This means each public key is mapped to an individual user and each private key is mapped to a public key which allows me to store multiple user keys (rather than only storing current logged in users).

    Seems to work ok, however, still not 100% sure it is the correct way to do this kind of thing so some clarification would be nice.

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

Sidebar

Related Questions

I'm looking for [free] server software to store hierarchal data efficiently. My key challenge
I'm looking at solutions to store a massive quantity of information consuming the less
I'm not sure how I use get() to get my information. Looking at my
Just looking for varying opinions and reasoning on this: I want to maintain separate
I'm looking for some advice on how to do this. I want to have
Is it possible to create a login process that requires a public/private key through
I'm looking for advice/experience on using public variables vs private variables with accessor methods
I'm looking for a following pattern: I have several methods like this: 1. private
Looking to store usernames and passwords in a database, and am wondering what the
I'm looking to store some metadata in Docbook (V5) XML files. Specifically, links to

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.