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.

License

Notifications You must be signed in to change notification settings

nau11713/e3kit-kotlin

 
 

Repository files navigation

Virgil E3Kit Android SDK

Build Status Maven Central GitHub license

Introduction | SDK Features | Install E3Kit Package | License | Support

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

Install E3Kit Package

Gradle

Gradle is an open-source build automation system that builds upon the concepts of Apache Ant and Apache Maven and introduces a Groovy-based domain-specific language (DSL) instead of the XML form used by Apache Maven for declaring the project configuration.

To integrate E3Kit SDK into your Android project using Gradle, add jcenter() repository if missing:

repositories {
    jcenter()
}

Set up dependencies in your build.gradle:

dependencies {
    implementation 'com.virgilsecurity:ethree-kotlin:0.1.0-alpha'
}

Bootstrap User

Use the following lines of code to authenticate a user.

// initialize E3Kit
EThree.initialize(context, tokenCallback, object : EThree.OnResultListener<EThree> {
                  override fun onSuccess(result: EThree) {
                      // done
                  }

                  override fun onError(throwable: Throwable) {
                      // error handling
                  }
              }
}

Encrypt & decrypt

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

// prepare a message
val messageToEncrypt = "Hello, Bob!"
var eThree: EThree? = null

// Listener for keys lookup
val lookupKeysListener = object : EThree.OnResultListener<List<PublicKey>> {
            override fun onSuccess(keys: List<PublicKey>) {
                val encryptedMessage = eThree!!.encrypt(messageToEncrypt, keys)
            }

            override fun onError(throwable: Throwable) {
                // Error handling
            }
        }

// Listener for bootstrap
val bootstrapListener = object : EThree.OnCompleteListener {
            override fun onSuccess() {
                eThree!!.lookupPublicKeys(listOf("Alice", "Bob"), lookupKeysListener)
            }

            override fun onError(throwable: Throwable) {
                // Error handling
            }
        }

// Listener for E3Kit initialization
val initListener = object : EThree.OnResultListener<EThree> {
            override fun onSuccess(result: EThree) {
                eThree = result
                eThree!!.bootstrap(bootstrapListener)
            }

            override fun onError(throwable: Throwable) {
                // Error handling
            }
        }

EThree.initialize(context, tokenCallback, initListener)

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.

About

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 96.2%
  • Java 3.8%