PHP Classes

PHP Quill: Write data to a Chronicle server using encryption

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 21 All time: 11,275 This week: 524Up
Version License PHP version Categories
quill 1.0MIT/X Consortium ...5PHP 5, Cryptography, Web services
Description 

Author

This package can write data to a Chronicle server using encryption.

It can send HTTP requests to a Chronicle server using a pair of private and public encryption keys to transmit data.

The package can send a message string encrypting it with the client's secret key and the server's public key.

It can also send a message string without using encryption keys.

Innovation Award
PHP Programming Innovation award nominee
October 2022
Number 3
Chronicle is a Web service application that can process HTTP requests to append data in blockchains.

The Quill package is a PHP client package that can write data to a Chronicle server to update blockchains.

This package allows the creation of distributed clients that can generate blockchain data stored in a Chronicle server.

Manuel Lemos
Picture of Scott Arciszewski
  Performance   Level  
Name: Scott Arciszewski <contact>
Classes: 37 packages by
Country: United States United States
Age: ???
All time rank: 1173170 in United States United States
Week rank: 22 Up4 in United States United States Up
Innovation award
Innovation award
Nominee: 28x

Winner: 1x

Documentation

Quill

Build Status Latest Stable Version Latest Unstable Version License Downloads

Quill is a library for publishing data to a Chronicle instance. Requires PHP 7.1 or newer. PHP 7.2+ is recommended.

A monolog handler is also available.

Installing

composer require paragonie/quill

Usage

<?php

use ParagonIE\ConstantTime\Base64UrlSafe;
use ParagonIE\Quill\Quill;
use ParagonIE\Sapient\CryptographyKeys\{
    SigningSecretKey,
    SigningPublicKey
};

$quill = (new Quill())
    ->setChronicleURL('https://chronicle-public-test.paragonie.com/chronicle')
    ->setServerPublicKey(
        new SigningPublicKey(
            Base64UrlSafe::decode('3BK4hOYTWJbLV5QdqS-DFKEYOMKd-G5M9BvfbqG1ICI=')
        )
    )
    ->setClientID('Your Client ID provided by the Chronicle here')
    ->setClientSecretKey(
        new SigningSecretKey('/Loaded from the filesystem or something./')
    );

$quill->write("Important security notice goes here.");

Writing Data (Unencrypted)

There are two main API methods that do the same thing but differ in their return values:

  • `write(string $input): ResponseInterface` * Returns the PSR-7 Response object, or throws an exception
  • `blindWrite(string $input): bool` * Returns `TRUE` or `FALSE`

Writing Data (Symmetric Encryption)

If you want to encrypt your messages using a shared encryption key:

  • `writeEncrypted(string $input, SharedEncryptionKey $key): ResponseInterface` * Returns the PSR-7 Response object, or throws an exception
  • `blindWriteEncrypted(string $input, SharedEncryptionKey $key): bool` * Returns `TRUE` or `FALSE`

Writing Data (Asymmetric Encryption)

If you want to encrypt your messages using a public-key cryptography:

  • `writeSealed(string $input, SealingPublicKey $key): ResponseInterface` * Returns the PSR-7 Response object, or throws an exception
  • `blindWriteSealed(string $input, SealingPublicKey $key): bool` * Returns `TRUE` or `FALSE`

  Files folder image Files (8)  
File Role Description
Files folder image.github (1 directory)
Files folder imagesrc (1 file)
Files folder imagetest (1 file)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file phpunit.xml.dist Data Auxiliary data
Accessible without login Plain text file psalm.xml Data Auxiliary data
Accessible without login Plain text file README.md Doc. Read me

  Files folder image Files (8)  /  .github  
File Role Description
Files folder imageworkflows (1 file)

  Files folder image Files (8)  /  .github  /  workflows  
File Role Description
  Accessible without login Plain text file ci.yml Data Auxiliary data

  Files folder image Files (8)  /  src  
File Role Description
  Accessible without login Plain text file Quill.php Class Class source

  Files folder image Files (8)  /  test  
File Role Description
  Accessible without login Plain text file QuillTest.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:21
This week:0
All time:11,275
This week:524Up