Set up Key StorageThis guide shows how to use key storage in order to save or load user's Private Key.Prerequisites for workInstall SDK and Set up Virgil CryptoThe Virgil is provided as a package. The package is distributed via Carthage and CocoaPods.The package is available for:iOS 7.0+COCOAPODSCocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:$ gem install cocoapodsTo integrate VirgilSDK into your Xcode project using CocoaPods, specify it in your Podfile:source 'https://github.com/CocoaPods/Specs.git' platform :ios, '10.0' use_frameworks! target '' do pod 'VirgilSDK', '~> 4.5.0' endThen, run the following command:$ pod install> CocoaPods 0.36+ is required to build VirgilSDK 4.0.0+.CarthageAs of version 4.2.0 VirgilSDK is available for integration using Carthage.Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.You can install Carthage with Homebrew using the following command:$ brew update $ brew install carthageTo integrate VirgilSDK into your Xcode project using Carthage, perform following steps:Create an empty file with name Cartfile in your project's root folder, that lists the frameworks you’d like to use in your project.Add the following line to your Cartfilegithub "VirgilSecurity/virgil-sdk-x" ~> 4.6.0Run carthage update. This will fetch dependencies into a Carthage/Checkouts folder inside your project's folder, then build each one or download a pre-compiled framework.On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, add each framework you want to use from the Carthage/Build folder inside your project's folder.On your application targets’ “Build Phases” settings tab, click the “+” icon and choose “New Run Script Phase”. Create a Run Script in which you specify your shell (ex: /bin/sh), add the following contents to the script area below the shell:/usr/local/bin/carthage copy-frameworksand add the paths to the frameworks you want to use under “Input Files”, e.g.:$(SRCROOT)/Carthage/Build/iOS/VirgilCrypto.framework $(SRCROOT)/Carthage/Build/iOS/VirgilSDK.frameworkSwift note Although VirgilSDK pod is using Objective-C as its primary language it might be quite easily used in a Swift application. All public API is available from Swift and is bridged using NS_SWIFT_NAME where needed. If you want to use VirgilSDK from swift it is necessary to perform the following:Create a new header file in the Swift project.Name it something like BridgingHeader.hPut there the following lines:Save a user's Private KeyUse the following lines of code to save a private key after its generation into default protected storage:// save Virgil Key into storage try! aliceKey.store(withName: @"[KEY_NAME]", password: @"[OPTIONAL_KEY_PASSWORD]")Load a user's Private KeyUser needs own private key to sign some data, decrypt encrypted content, or perform other cryptographic operations.Use the following lines of code to load a private key from key storage:// load a Virgil Key from storage let aliceKey = try! virgil.keys.loadKey(withName: "[KEY_NAME]", password: "[OPTIONAL_KEY_PASSWORD]")In order to use a specific key storage, developers need to change key storage parameters during Virgil SDK initialization.