Skip to content
E3Kit is an SDK that simplifies work with Virgil services and presents the easiest way to add full end-to-end (E2EE) security to their applications to become HIPAA and GDPR compliant and more.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
CI
E3Kit TestApp iOS
E3Kit TestApp tvOS Revert "Removed test apps" Jan 16, 2019
Source [ci skip] Small docs supplement Mar 21, 2019
Tests Switched to crypto v5 Mar 19, 2019
VirgilE3Kit.xcodeproj Updated to swift 5 Apr 10, 2019
VirgilE3Kit Updated to swift 5 Apr 10, 2019
.gitignore
.swift-version Updated to swift 5 Apr 10, 2019
.swiftlint.yml Updated travis.yml Jan 17, 2019
.travis.yml Updated travis to swift 5 Apr 10, 2019
Cartfile Updated to swift 5 Apr 10, 2019
Cartfile.resolved
LICENSE Updated LICENSE Mar 19, 2019
README.md Updated to swift 5 Apr 10, 2019
TestConfig.plist.enc
VirgilE3Kit.podspec Updated to swift 5 Apr 10, 2019

README.md

Virgil E3Kit Objective-C/Swift SDK

Build Status Carthage compatible CocoaPods Compatible Platform GitHub license

Introduction

Virgil Security provides an SDK which simplifies work with Virgil services and presents easy to use API for adding security to any application. In a few simple steps you can setup user encryption with multidevice support.

SDK Features

  • multidevice support
  • manage users' Public Keys

Installation

Virgil E3Kit is provided as a set of frameworks. These frameworks are distributed via Carthage. Also in this guide, you find one more package called VirgilCrypto (Virgil Crypto Library) that is used by the E3Kit to perform cryptographic operations.

All frameworks are available for:

  • iOS 9.0+
  • macOS 10.11+
  • tvOS 9.0+
  • watchOS 2.0+

COCOAPODS

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate Virgil E3Kit into your Xcode project using CocoaPods, specify it in your Podfile:

target '<Your Target Name>' do
use_frameworks!

pod 'VirgilE3Kit', '~> 0.5'
end

Then, run the following command:

$ pod install

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 carthage

To integrate VirgilE3Kit into your Xcode project using Carthage, create an empty file with name Cartfile in your project's root folder and add following lines to your Cartfile

github "VirgilSecurity/virgil-e3kit-x" ~> 0.5

Linking against prebuilt binaries

To link prebuilt frameworks to your app, run following command:

$ carthage update

This will build each dependency or download a pre-compiled framework from github Releases.

Building for iOS/tvOS/watchOS

On your application targets’ “General” settings tab, in the “Linked Frameworks and Libraries” section, add following frameworks from the Carthage/Build folder inside your project's folder:

  • VirgilE3Kit
  • VirgilPythiaSDK
  • VirgilKeyknoxSDK
  • VirgilSDK
  • VirgilCryptoAPI
  • VirgilCrypto
  • VirgilCryptoFoundation
  • VirgilCryptoPythia
  • VSCCommon
  • VSCFoundation
  • VSCPythia

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-frameworks

and add the paths to the frameworks you want to use under “Input Files”, e.g.:

$(SRCROOT)/Carthage/Build/iOS/VirgilE3Kit.framework
$(SRCROOT)/Carthage/Build/iOS/VirgilPythiaSDK.framework
$(SRCROOT)/Carthage/Build/iOS/VirgilKeyknoxSDK.framework
$(SRCROOT)/Carthage/Build/iOS/VirgilSDK.framework
$(SRCROOT)/Carthage/Build/iOS/VirgilCryptoAPI.framework
$(SRCROOT)/Carthage/Build/iOS/VirgilCrypto.framework
$(SRCROOT)/Carthage/Build/iOS/VirgilCryptoFoundation.framework
$(SRCROOT)/Carthage/Build/iOS/VirgilCryptoPythia.framework
$(SRCROOT)/Carthage/Build/iOS/VSCCommon.framework
$(SRCROOT)/Carthage/Build/iOS/VSCFoundation.framework
$(SRCROOT)/Carthage/Build/iOS/VSCPythia.framework
Building for macOS

On your application target's “General” settings tab, in the “Embedded Binaries” section, drag and drop following frameworks from the Carthage/Build folder on disk:

  • VirgilE3Kit
  • VirgilPythiaSDK
  • VirgilKeyknoxSDK
  • VirgilSDK
  • VirgilCryptoAPI
  • VirgilCrypto
  • VirgilCryptoFoundation
  • VirgilCryptoPythia
  • VSCCommon
  • VSCFoundation
  • VSCPythia

Additionally, you'll need to copy debug symbols for debugging and crash reporting on macOS.

On your application target’s “Build Phases” settings tab, click the “+” icon and choose “New Copy Files Phase”. Click the “Destination” drop-down menu and select “Products Directory”. For each framework, drag and drop corresponding dSYM file.

Register User

Use the following lines of code to authenticate user.

import VirgilE3Kit

// initialize E3Kit
EThree.initialize(tokenCallback) { eThree, error in 
    guard let eThree = eThree, error == nil else {
      // error handling here
    }
    eThree.register { error in 
        // done
    }
}

Encrypt & decrypt

Virgil E3Kit lets you use a user's Private key and his or her Public Keys to sign, then encrypt text.

import VirgilE3Kit

// prepare a message
let messageToEncrypt = "Hello, Bob!"

// initialize E3Kit
EThree.initialize(tokenCallback) { eThree, error in 
    // Authenticate user 
    eThree!.register { error in
        // Search user's publicKeys to encrypt for
        eThree!.lookUpPublicKeys(of: ["Alice", "Den"]) { lookupResult, error in 
            // encrypt text
            let encryptedMessage = try! eThree.encrypt(messageToEncrypt, for: lookupResult!)
        }
    }
}

License

This library is released under the 3-clause BSD License.

Support

Our developer support team is here to help you. Find out more information on our Help Center.

You can find us on Twitter or send us email support@VirgilSecurity.com.

Also, get extra help from our support team on Slack.

You can’t perform that action at this time.