Git Product home page Git Product logo

virgil-sdk-net's Introduction

Virgil Security .NET/C# SDK

Build status Nuget package

Installation | Encryption Example | Initialization | Documentation | Support

Virgil Security provides a set of APIs for adding security to any application. In a few simple steps you can encrypt communication, securely store data, provide passwordless login, and ensure data integrity.

For a full overview head over to our .NET/C# Get Started guides.

Installation

The Virgil .NET SDK is provided as a package named Virgil.SDK. The package is distributed via NuGet package management system.

The package is available for .NET Framework 4.5 and newer.

Installing the package

  1. Use NuGet Package Manager (Tools -> Library Package Manager -> Package Manager Console)
  2. Run PM> Install-Package Virgil.SDK

Next: Get Started with the .NET/C# SDK.

Encryption Example

Virgil Security makes it super easy to add encryption to any application. With our SDK you create a public Virgil Card for every one of your users and devices. With these in place you can easily encrypt any data in the client.

// find Alice's card(s)
var aliceCards = await virgil.Cards.FindAsync("alice");

// encrypt the message using Alice's cards
var message = "Hello Alice!";
var encryptedMessage = aliceCards.Encrypt(message);

// transmit the message with your preferred technology
this.TransmitMessage(encryptedMessage.ToString(StringEncoding.Base64));

The receiving user then uses their stored private key to decrypt the message.

// load Alice's Key from storage.
var aliceKey = virgil.Keys.Load("alice_key_1", "mypassword");

// decrypt the message using the key 
var originalMessage = aliceKey.Decrypt(transferData).ToString();

Next: To get you properly started you'll need to know how to create and store Virgil Cards. Our Get Started guide will get you there all the way.

Also: Encrypted communication is just one of the few things our SDK can do. Have a look at our guides on Encrypted Storage, Data Integrity and Passwordless Login for more information.

Initialization

To use this SDK you need to sign up for an account and create your first application. Make sure to save the app id, private key and it's password. After this, create an application token for your application to make authenticated requests from your clients.

To initialize the SDK on the client side you will only need the access token you created.

var virgil = new VirgilApi("[ACCESS_TOKEN]");

Note: this client will have limited capabilities. For example, it will be able to generate new Cards but it will need a server-side client to transmit these to Virgil.

To initialize the SDK on the server side we will need the access token, app id and the App Key you created on the Developer Dashboard.

var context = new VirgilApiContext
{
    AccessToken = "[YOUR_ACCESS_TOKEN_HERE]",
    Credentials = new AppCredentials
    {
        AppId = "[YOUR_APP_ID_HERE]",
        AppKeyData = VirgilBuffer.FromFile("[YOUR_APP_KEY_PATH_HERE]"),
        AppKeyPassword = "[YOUR_APP_KEY_PASSWORD_HERE]"
    }
};

var virgil = new VirgilApi(context);

Next: Learn more about our the different ways of initializing the .NET/C# SDK in our documentation.

Documentation

Virgil Security has a powerful set of APIs, and the documentation is there to get you started today.

License

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

Support

Our developer support team is here to help you. You can find us on Twitter and email.

virgil-sdk-net's People

Contributors

unlim-it avatar dv00d00 avatar imarina avatar scratch-net avatar sergeyseroshtan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.