Skip to content

[DEPRECATED] PHP sdk to sign PDF documents using Soluti's service

Notifications You must be signed in to change notification settings

MemedDev/soluti-sdk-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Soluti PHP sdk

Its a simple SDK for PHP language that abstract Soluti's digital signature service. In the first moment is possible to sign PDF documents authenticating using OAuth or Basic Credentials

Installation

composer require "memeddev/soluti-sdk-php=*"

Basic Usage

use Memed\Soluti\Auth\Client;
use Memed\Soluti\Auth\Credentials;
use Memed\Soluti\Auth\Token;
use Memed\Soluti\Config;
use Memed\Soluti\Document;
use Memed\Soluti\Manager;
use Memed\Soluti\Signer;
use GuzzleHttp\Client as GuzzleClient;

// -----------------------
// Authentication strategy
// -----------------------

// Using Credentials
$token = new Credentials(
    new Client('CLIENT_ID', 'CLIENT_SECRET'),
    'USERNAME',
    'PASSWORD',
    60 // How much longer token will be acceptable after authentication (in seconds)
);

// Using OAuth token
$token = new Token('some-secret-oauth-token', 'bearer');

// -----------------------
// Document signature
// -----------------------
 
// Defines base URL's
$config = new Config([
    'url_cess' => 'http://cess:8080',
    'url_vaultid' => 'https://apicloudid.hom.vaultid.com.br/oauth',
]);

// Initializes signer service
$manager = new Manager($config, new Client(new GuzzleClient());
$signer = new Signer($manager);

// Creates a document instance using file which you want to sign.
$document = new Document(__DIR__.'/file_to_sign.pdf');

// Defines directory to save signed documents.
$destinationDir = '/some/directory';

// Signs document
$files = $signer->sign($document, $token, $destinationDir);

// Result
// array(1) {
//   [0] =>
//   string(32) "/some/directory/signed_file.pdf"
// }

About

[DEPRECATED] PHP sdk to sign PDF documents using Soluti's service

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages