Introduction | SDK Features | Install E3Kit Package | License | Support
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.
- multidevice support
- manage users' Public Keys
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'
}
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
}
}
}
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)
This library is released under the 3-clause BSD License.
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.