준코딩

[iOS/Swift] KeyChain 이용하기 본문

프로그래밍/IOS (Swift)

[iOS/Swift] KeyChain 이용하기

Ljunhyeob - App Dev 2023. 1. 20. 20:43

https://github.com/Ljunhyeob/keyChain

 

GitHub - Ljunhyeob/keyChain: ios 내장 보안영역 keyChain 이용

ios 내장 보안영역 keyChain 이용. Contribute to Ljunhyeob/keyChain development by creating an account on GitHub.

github.com

 

keyChain?

 

-> iOS는 암호화된 컨테이너로 Keychain이 존재하며, 민감함 데이터를 암호화하고 복호화하며 재사용하는 행위를 보다 쉽고 안전하게 사용할 수 있게끔 Keychain Services API를 제공합니다.

https://github.com/jrendel/SwiftKeychainWrapper

 

GitHub - jrendel/SwiftKeychainWrapper: A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User

A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift. - GitHub - jrendel/SwiftKeychainWrapper: A simple wrapper for the iOS Keychain ...

github.com

이 SwiftKeyChainWrapper 를 사용하겠습니다.

 

 

1. 해당하는 프로젝트에 pod init 해주시고 , Podfile 열어서

pod 'SwiftKeychainWrapper'  입력하고   저장한 뒤,

pod install 진행해주세요.

2. 그리고 프로젝트 파일 가면 원래 없던 xcworkspace 파일이 생겼는데 저걸로 실행해주세요.

 

3. import SwiftKeychainWrapper 해주시고,

 

4. 아래 코드와 같이 키 생성, 키값 가져오기, 키 삭제 를 실행할 수 있습니다.

Comments