Questions tagged [security.framework]

Security.framework is an OS X and iOS framework for controlling various cryptographic services, primarily centered around key management.

Security.framework is an OS X and iOS framework for controlling various cryptographic services, primarily centered around key management.

9 questions
11
votes
2 answers

Obtain public key from private SecKeyRef

Given a SecKeyRef loaded using SecItemImport from an RSA private key is there a way to obtain or create a SecKeyRef for only the public key components? In OpenSSL this could be done by copying the modulus and public exponent to a new struct, but…
Paul Kehrer
  • 13,466
  • 4
  • 40
  • 57
3
votes
1 answer

How to decrypt data with Security.framework on macOS?

I need to decrypt data with a RSA public key on macOS, by googling I know we can use method SecKeyCreateDecryptedData of Security.framework to achieve that, but it leads to two problems: SecKeyCreateDecryptedData accepts a private key to execute…
Suge
  • 2,808
  • 3
  • 48
  • 79
3
votes
1 answer

RSA public key decryption on OS X using SecTransform API (or other system API)

I'm trying to replace my use of OpenSSL, which was long ago deprecated and has been removed from the 10.11 SDK with the Security Transform API. My use of OpenSSL is simply for license key verification. The problem I've run into is that license keys…
Andrew Madsen
  • 21,309
  • 5
  • 56
  • 97
2
votes
1 answer

How to use Secure Enclave without TouchID and Passcode?

To generate key pair I am using Secure Enclave (kSecAttrTokenIDSecureEnclave). When trying to access generated key pair, iOS system, asks for TouchID. Below is code snapshot how I am generating and accessing key pair. Is here a way to setup…
Ramis
  • 13,985
  • 7
  • 81
  • 100
1
vote
0 answers

SecKeyGeneratePair in xctest

func generateSecureKeyPair() -> Bool { var pubKey, privKey: SecKey? let privateKeyParams: [String: AnyObject] = [ kSecAttrIsPermanent as String: true as AnyObject, kSecAttrApplicationTag as String:…
Dhruv
  • 2,153
  • 3
  • 21
  • 45
1
vote
2 answers

Retrieving password and username from keychainItemWrapper iOS

I'm trying to use the KeychainItemWrapper.h and keychainWrapperItemWrapper.m to store user credentials such as username and password. I currently store when user logs in for the first time like this: KeychainItemWrapper* keychain =…
1
vote
0 answers

Under swift, do I need to import the security framework manually to use the keychain?

I wanna save login credentials in my app using the iOS keychain under swift. I downloaded the SwiftKeychainWrapper and watched a few youtube tutorials. Following these I copied the KeychainWrapper.swift file to my project and started using the…
Pvt. Joker
  • 155
  • 1
  • 10
1
vote
1 answer

SecItemAdd returns -25299 when adding second certificate

When trying to add second certificate fails with -25299 (The item already exists.). They have different kSecAttrLabel. Before trying to delete it fails as well with code -25300 (The item cannot be found.). Maybe someone knows what is wrong with this…
Ramis
  • 13,985
  • 7
  • 81
  • 100
0
votes
1 answer

iOS Security.framework arm64 architecture issue

I am trying to compile an app on an iPhone 6 device under iOS 11.4. This app uses a framework of my own compiled for architectures armv7 and arm64 (confirmed with lipo -info) and targetted for iOS8+. In this framework, I use…
IMACODE
  • 125
  • 2
  • 9