PHPackages                             bitpay/key-utils - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bitpay/key-utils

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

bitpay/key-utils
================

BitPay Utils pack for cryptography

2.2.0(2mo ago)8485.2k—9.5%131MITPHPPHP ^8.1 || ^8.2 || ^8.3 || ^8.4 || ^8.5CI passing

Since Aug 19Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/bitpay/bitpay-php-keyutils)[ Packagist](https://packagist.org/packages/bitpay/key-utils)[ RSS](/packages/bitpay-key-utils/feed)WikiDiscussions 2.2.x Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (23)Used By (1)

bitpay/bitpay-php-keyutils
==========================

[](#bitpaybitpay-php-keyutils)

[![GitHub license](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://raw.githubusercontent.com/bitpay/bitpay-php-keyutils/master/LICENSE.md)[![Packagist](https://camo.githubusercontent.com/9164d0b21ff44df5e98e4156a0c4f2cef5603f35df152b5bdcbb845fd412494a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6269747061792f6b65792d7574696c732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bitpay/key-utils)[![Total Downloads](https://camo.githubusercontent.com/df21f8ba623358647fabf8ed9fde01edabef337187d8a1486b9dfe5660a0c80c/68747470733a2f2f706f7365722e707567782e6f72672f6269747061792f6b65792d7574696c732f646f776e6c6f6164732e737667)](https://packagist.org/packages/bitpay/key-utils)[![Latest Unstable Version](https://camo.githubusercontent.com/e44c9b936be2e788f4b3b2bece09f81e882e8f6dee06851b467580d82a7db006/68747470733a2f2f706f7365722e707567782e6f72672f6269747061792f6b65792d7574696c732f762f756e737461626c652e737667)](https://packagist.org/packages/bitpay/key-utils)

This dependency file provides utilities for use with the BitPay API. It enables creating keys, retrieving public keys, retrieving private keys, creating the SIN that is used in retrieving tokens from BitPay, and signing payloads for the `X-Signature` header in a BitPay API request.

Installation
============

[](#installation)

Composer
--------

[](#composer)

### Install Composer

[](#install-composer)

```
curl -sS https://getcomposer.org/installer | php
```

### Install via composer by hand

[](#install-via-composer-by-hand)

Add to your composer.json file by hand.

```
{
    ...
    "require": {
        ...
        "bitpay/key-utils": "~2.2"
    }
    ...
}
```

Once you have added this, just run:

```
php composer.phar update bitpay/key-utils
```

### Install using composer

[](#install-using-composer)

```
php composer.phar require bitpay/key-utils:~2.2
```

Usage
=====

[](#usage)

Autoloader
----------

[](#autoloader)

To use the library's autoloader (which doesn't include composer dependencies) instead of composer's autoloader, use the following code:

```
