Download the PHP package furqansiddiqui/ecdsa-php without Composer

On this page you can find all versions of the php package furqansiddiqui/ecdsa-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ecdsa-php

:warning: Warning

You are welcome to use this at your own risk. No liabilities, no warranty, check LICENSE file.

ECDSA lib for PHP

Easy interface and to the point API for following curves and features:

Prerequisites

Installation

composer require furqansiddiqui/ecdsa-php

Documentation

KeyPair

Method Returns Description
__construct - Requires EllipticCurveInterface and AbstractByteArray (private key) as arguments.
public PublicKey Creates and holds on to instance of PublicKey for corresponding private key.
sign Signature Creates a signature. Depending on ECC curve passed in constructor, the returning Signature instance may or may not have recovery id set.
signRecoverable Signature Creates a recoverable signature. This signature will always contain a recovery id.
findRecoveryId int Finds a recovery id for given Signature and message hash.
verify bool Verifies a signature with given Signature and message hash.
verifyPublicKey bool Verifies a recoverable signature. It is possible to override recovery id directly in arguments for this method if Signature does not have a recovery id set.

PublicKey

Constructor Arguments Description
fromDER AbstractByteArray Expects 65 byte long DER encoded public key starting with \x04 prefix.
Method Returns Description
getUnCompressed Buffer Gets DER serialized uncompressed public key. 65 bytes long including prefix of \x04.
getCompressed Buffer Get DER serialized compressed public key. 33 bytes long including \x02 or \x03 prefix.
compare int Compares with another PublicKey instance. Returns 0 if identical OR a negative value if public keys do not match.

Signature

Property Type Description
r AbstractByteArray Signature value r. (readonly)
s AbstractByteArray Signature value s. (readonly)
recoveryId int Recovery ID (v) for signature. Defaults to -1 when there is no recovery id available. (readonly)
Constructor Arguments Description
fromDER AbstractByteArray Unserializes a DER encoded signature .
fromCompact AbstractByteArray Unserializes a 65 byte compact signature where first byte is v (recovery id) followed by 32 bytes each for r and s.
Method Returns Description
getDER Buffer Returns a DER encoded signature starts with \x30 byte.
compare int Compares with another Signature instance. Returns 0 if identical OR a negative value if signatures do not match.

EllipticCurveInterface

Method Returns Description
validatePrivateKey bool Validates a private key.
generatePublicKey PublicKey Generates public key from given private key.
getPublicKeyFromCompressed PublicKey Retrieves uncompressed public key from given compressed variant. Accepted prefixes are \x02 or \x03.
sign Signature Creates a signature from private key and message hash. This method may or may not retrieve recovery id depending on ECC curve used. Therefore, recovery Id may have to be retrieved separately.
recoverPublicKeyFromSignature PublicKey Recovers a public key from given Signature and message hash. Can be used to retrieve recovery id in 1-4 iterations.
verify bool Verifies a signature with given Signature and message hash.

Difference in Secp256k1 variants

Method Secp256k1_GMP Secp256k1_RPC
sign :no_entry_sign: Does not return recovery id with signature r and s values. It is recommended to use KeyPair which provides signRecoverable and findRecoveryId methods. :white_check_mark: Returns recovery id alongside signature.

All versions of ecdsa-php with dependencies

PHP Build Version
Package Version
Requires php-64bit Version ^8.1
ext-gmp Version *
ext-curl Version *
charcoal-dev/buffers Version ^0.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package furqansiddiqui/ecdsa-php contains the following files

Loading the files please wait ....