paragonie/quill

Library for quickly and easily writing data to a Chronicle instance

Maintainers

👁 paragonie-scott

Package info

github.com/paragonie/quill

pkg:composer/paragonie/quill

Statistics

Installs: 25 075

Dependents: 1

Suggesters: 0

Stars: 21

Open Issues: 0

v0.7.0 2024-05-08 17:14 UTC

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

ISC 4f959bf38db0431acc08aee7c80fae52b6ae84d0

  • Paragon Initiative Enterprises <security.woop@paragonie.com>

This package is auto-updated.

Last update: 2026-06-08 21:50:34 UTC


README

👁 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