CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | BSD |
ReleasedLast Release | Feb 2016 |
Maintained by Pavlo Gorb.
Depends on: | |
VirgilFoundation | = 1.3.3 |
VirgilKit | >= 0 |
VirgilSDK is a wrapper over the Virgil Security Services for Apple-based platforms. It allows user to interact with Virgil Services much easier. This framework takes care about composing correct requests and parsing the service's responds into usable model classes.
VirgilSDK framework is supposed to be installed via CocoaPods. So, if you are not familiar with it it is time to install CocoaPods. Open your terminal window and execute the following line:
$ sudo gem install cocoapods
It will ask you about the password and then will install latest release version of CocoaPods. CocoaPods is built with Ruby and it will be installable with the default Ruby available on OS X.
If you encountered any issues during this installation, please take a look at cocoapods.org for more information.
VirgilSDK framework has 1 dependency:
You don't need to install it manually. CocoaPods will handle it for you automatically.
Now it is possible to add VirgilSDK to the particular application. So:
$ cd <Path to Xcode project folder>
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target '<Put your Xcode target name here>' do
pod 'VirgilSDK'
end
$ pod install
At this point you should be able to use VirgilSDK functionality in your code. See examples for most common tasks below. If you encountered any issues with CocoaPods installations try to find more information at cocoapods.org.
Although VirgilSDK is using Objective-C as its primary language it might be quite easily used in a Swift application. After VirgilSDK is installed as described in the Getting started section it is necessary to perform the following:
Create a new header file in the Swift project.
Name it something like BridgingHeader.h
Put there the following lines:
@import VirgilFoundation;
@import VirgilSDK;
You can find more information about using Objective-C and Swift in the same project here.
Before you make any calls to the Virgil Servics you need to obtain an application token. Please, register here or sign in if you already have an account.
This token is necessary for making any calls to the Virgil Services.
@import VirgilFoundation;
//...
VSSKeyPair *keyPair = [[VSSKeyPair alloc] init];
//...
//...
let keyPair = VSSKeyPair()
//...
Optionally it is possible to create a new key pair protected by some password:
@import VirgilFoundation;
//...
VSSKeyPair *keyPair = [[VSSKeyPair alloc] initWithPassword:<#password#>];
//...
//...
let keyPair = VSSKeyPair(password:<#password#>)
//...
Requests to the service is an asynchronous network operation. VSSClient instance send the request and when it is done it calls completion handler block given as last parameter in any call. To get this work VSSClient instance should exist when the request is done. It is a good idea to make a property which will hold the VSSClient instance.
Requires iOS 8.x or greater, OSX 10.11 or greater, WatchOS 2.0 or greater, tvOS 9.0 or greater.
Usage is provided under the The BSD 3-Clause License. See LICENSE for the full details.