Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
gopkg.in/virgilsecurity/virgil-sdk-go.v4
Installation | Initialization | Encryption / Decryption Example | Documentation | Support
Virgil Security provides a set of APIs for adding security to any application. In a few steps you can encrypt communication, securely store data, provide passwordless authentication, and ensure data integrity.
To initialize and use Virgil SDK, you need to have Developer Account.
The package is available for Go 1.7.1 and newer.
Installing the package using Package Manager Console
go get -u gopkg.in/virgil.v4
Be sure that you have already registered at the Dev Portal and created your application.
To initialize the SDK at the Client Side you need only the Access Token created for a client at Dev Portal. The Access Token helps to authenticate client's requests.
api, err := virgilapi.New("[YOUR_ACCESS_TOKEN_HERE]")
To initialize the SDK at the Server Side you need the application credentials (Access Token, App ID, App Key and App Key Password) you got during Application registration at the Dev Portal.
keyfile, err := ioutil.ReadFile("[YOUR_APP_KEY_FILEPATH_HERE]")
api, err := virgilapi.NewWithConfig(virgilapi.Config{
Token: "[YOUR_ACCESS_TOKEN_HERE]",
Credentials: &virgilapi.AppCredentials{
AppId: "[YOUR_APP_ID_HERE]",
PrivateKey: keyfile,
PrivateKeyPassword : "[YOUR_APP_KEY_PASSWORD_HERE]",
},
})
Virgil Security simplifies adding encryption to any application. With our SDK you may create unique Virgil Cards for your all users and devices. With users' Virgil Cards, you can easily encrypt any data at Client Side.
// find Alice's Virgil Card(s) at Virgil Services
aliceCards, err := api.Cards.Find("alice")
// encrypt the message using Alice's Virgil Cards
message := virgilapi.BufferFromString("Hello Alice!")
cipherData, err := aliceCards.Encrypt(message)
//transmit the message using your preferred technology to Alice
transmit(cipherData.ToBase64String())
Alice uses her Virgil Private Key to decrypt the encrypted message.
// load Alice's Virgil Key from secure storage provided by default.
aliceKey, err := api.Keys.Load("alice_key_1", "mypassword")
// get buffer from base64 encoded string
encryptedData, err := virgilapi.BufferFromBase64String(transferData)
// decrypt message using Alice's Virgil key.
originalData, err := aliceKey.Decrypt(encryptedData)
// originalData = aliceKey.Decrypt(encryptedData)
originalMessage := originalData.ToString()
Next: On the page below you can find configuration documentation and the list of our guides and use cases where you can see appliance of Virgil Go SDK.
Virgil Security has a powerful set of APIs and the documentation to help you get started:
This library is released under the 3-clause BSD License.
Our developer support team is here to help you. You can find us on Twitter and email.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.