BitPay Key Utils version 2.0.0
==============================

This library provides utilities for use with the BitPay API. It enables creating keys, retrieving public 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.

DEPENDENCIES

	libssl-dev (OpenSSL 0.9.8+)
	SWIG (3.0.5+)
	Perl (5.18+)
	Make

INSTALLATION

Clone the github repository.

To install this module type the following:

	perl Makefile.pl
	make
	make test
	make install

USAGE

Use the key utils by including `use BitPay::key_utils` in your project. This should give you access to the functions:

	my $pem = BitPay::key_utils::mygeneratePem(); #creates ECDSA Keys and sets the value of pem to the PEM encoding of the key
	my $pub = BitPay::key_utils::mygetPublicKeyFromPem($pem); #takes a pem string and sets the value of pubkey to the compressed public key extracted from the pem
	my $sin = BitPay::key_utils::mygenerateSinFromPem($sin); #gets the base58 unique identifier associated with the pem
	my $signature = BitPay::key_utils::mysignMessageWith($pem, $message); #sets signature to the signature of the sha256 of the message

DEV ENVIRONMENT

Clone the github repository.

To build and install this module type the following:

	./clean
	./build

API DOCUMENTATION

API Documentation is available on the [BitPay site](https://bitpay.com/api).

RUNNING THE TESTS

To run the tests type the following:

	perl test.pl
