https://github.com/bitpay/bitpay-perl-keyutils
Provides required cryptographic functions to use the BitPay 2.0 API
https://github.com/bitpay/bitpay-perl-keyutils
Last synced: 8 months ago
JSON representation
Provides required cryptographic functions to use the BitPay 2.0 API
- Host: GitHub
- URL: https://github.com/bitpay/bitpay-perl-keyutils
- Owner: bitpay
- License: mit
- Created: 2015-05-08T15:19:03.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2015-08-06T19:51:10.000Z (almost 11 years ago)
- Last Synced: 2025-04-06T08:03:03.111Z (about 1 year ago)
- Language: C
- Homepage:
- Size: 321 KB
- Stars: 5
- Watchers: 7
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
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
Install from cpan by typing the following:
sudo cpanm BitPay::KeyUtils
or
Clone the github repository and type the following:
perl Makefile.PL
make
make test
make install
USAGE
Use the key utils by including `use BitPay::KeyUtils` in your project. This should give you access to the functions:
my $pem = BitPay::KeyUtils::bpGeneratePem(); #creates ECDSA Keys and sets the value of pem to the PEM encoding of the key
my $pub = BitPay::KeyUtils::bpGetPublicKeyFromPem($pem); #takes a pem string and sets the value of pubkey to the compressed public key extracted from the pem
my $sin = BitPay::KeyUtils::bpGenerateSinFromPem($pem); #gets the base58 unique identifier associated with the pem
my $signature = BitPay::KeyUtils::bpSignMessageWithPem($pem, "He's dead, Jim."); #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