Download the PHP package virgil/sdk without Composer

On this page you can find all versions of the php package virgil/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk

Virgil Core SDK PHP

Build Status Latest Version on Packagist Total Downloads GitHub license

Support

Introduction

Virgil Security provides a set of APIs for adding security to any application. In a few simple steps you can encrypt communications, securely store data, and ensure data integrity. Virgil Security products are available for desktop, embedded (IoT), mobile, cloud, and web applications in a variety of modern programming languages.

The Virgil Core SDK is a low-level library that allows developers to get up and running with Virgil Cards Service API quickly and add end-to-end security to their new or existing digital solutions.

In case you need additional security functionality for multi-device support, group chats and more, try our high-level Virgil E3Kit framework.

SDK Features

Installation

The Virgil Core SDK is provided as a package named virgil/sdk. The package is distributed via Composer package management system.

The package is available for PHP version 8.2 and newer.

Installing the package using Package Manager Console:

Crypto Extensions notice

In order to support crypto operations, you'll also need to install a Virgil crypto extensions. We supply Virgil Core SDK with our own extensions that can be easily used by everyone. To install automatically extensions in your current system just run this command:

Be aware that crypto-wrapper package appears in your vendors after virgil/sdk have been installed by composer. To check Virgil crypto extensions is proper installed run:

There are should be available following extensions: vsce_phe_php, vscf_foundation_php, vscp_pythia_php

NOTE: If following warning is occurred export environment variable LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/php7/modules (/usr/lib/php7/modules - your php extensions path can be other):

LD_LIBRARY_PATH is environment variable which keeps all path that contains users dynamic shared libraries.

Now Virgil Core SDK is ready to be used, lets configure it and run some samples.

Configure SDK

This section contains guides on how to set up Virgil Core SDK modules for authenticating users, managing Virgil Cards and storing private keys.

Set up authentication

Set up user authentication with tokens that are based on the JSON Web Token standard with some Virgil modifications.

In order to make calls to Virgil Services (for example, to publish user's Card on Virgil Cards Service), you need to have a JSON Web Token ("JWT") that contains the user's identity, which is a string that uniquely identifies each user in your application.

Credentials that you'll need:

Parameter Description
App ID ID of your Application at Virgil Dashboard
App Key ID A unique string value that identifies your account at the Virgil developer portal
App Key A Private Key that is used to sign API calls to Virgil Services. For security, you will only be shown the App Key when the key is created. Don't forget to save it in a secure location for the next step

Set up JWT provider on Client side

Use these lines of code to specify which JWT generation source you prefer to use in your project:

Generate JWT on Server side

Next, you'll need to set up the JwtGenerator and generate a JWT using the Virgil SDK.

Here is an example of how to generate a JWT:

For this subsection we've created a sample backend that demonstrates how you can set up your backend to generate the JWTs. To set up and run the sample backend locally, head over to your GitHub repo of choice:

Node.js | Golang | PHP | Java | Python and follow the instructions in README.

Set up Card Verifier

Virgil Card Verifier helps you automatically verify signatures of a user's Card, for example when you get a Card from Virgil Cards Service.

By default, VirgilCardVerifier verifies only two signatures - those of a Card owner and Virgil Cards Service.

Set up VirgilCardVerifier with the following lines of code:

Set up Card Manager

This subsection shows how to set up a Card Manager module to help you manage users' public keys.

With Card Manager you can:

Use the following lines of code to set up the Card Manager:

Usage Examples

Before you start practicing with the usage examples, make sure that the SDK is configured. See the Configure SDK section for more information.

Generate and publish Virgil Cards at Cards Service

Use the following lines of code to create a user's Card with a public key inside and publish it at Virgil Cards Service:

Sign then encrypt data

Virgil Core SDK allows you to use a user's private key and their Virgil Cards to sign and encrypt any kind of data.

In the following example, we load a private key from a customized key storage and get recipient's Card from the Virgil Cards Service. Recipient's Card contains a public key which we will use to encrypt the data and verify a signature.

Decrypt data and verify signature

Once the user receives the signed and encrypted message, they can decrypt it with their own private key and verify the signature with the sender's Card:

Get Card by its ID

Use the following lines of code to get a user's card from Virgil Cloud by its ID:

Get Card by user's identity

For a single user, use the following lines of code to get a user's Card by a user's identity:

Revoke Card

You can revoke user's Card in case they don't need it anymore. Revoked Card can still be obtained using its identifier, but this card won't appear during search query.

Generate key pair using VirgilCrypto

You can generate a key pair and save it in a secure key storage with the following code:

Save and retrieve key from filesystem key storage

Docs

Virgil Security has a powerful set of APIs, and the Developer Documentation can 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. Find out more information on our Help Center.

You can find us on Twitter or send us email [email protected].

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


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires ext-curl Version *
ext-json Version *
php Version ^8.3
virgil/crypto Version ^7.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package virgil/sdk contains the following files

Loading the files please wait ....