The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Crypt::ECDSA - Elliptic Curve Digital Signature Algorithm

VERSION

 $Revision: 1.006 $
 $Date: Thu Jun  8 20:29:32 PDT 2017 $

SYNOPSIS

Elliptic Curve Digital Signature Algorithm

    use Crypt::ECDSA;

    my $ecdsa = new Crypt::ECDSA;

    my ($pubkey, $seckey) = $ecdsa->keygen;

    my $msg = 'Hello, world!';

    my $signature = $ecdsa->sign( Message => $msg, Key => $seckey );

    print "Verified\n" if $ecdsa->verify( Message => $msg, Key => $pubkey,
                                          Signature => $signature );

METHODS

new

Creates and returns a new Crypt::ECDSA object. The following optional named parameters can be provided:

    Curve - The name of the elliptic curve to use. Defaults to 'secp256k1'. To use an unnamed curve, set the curve using the curve accessor.

    Debug - Set to a true value to have the module emit messages useful for debugging.

keygen

Generates and returns an ECDSA key-pair as a two-element list, with the public key as the first element and the secret key as the second.

sign

Generates and returns an ECDSA signature. The following named parameters are required:

    Key - The private key of the signer

    Message - The message to be signed

verify

Verify a signature. Returns a true value if the verification succeeds and false otherwise. The following named parameters are required:

    Key - The public key of the signer

    Signature - The signature

    Message - The message that was signed

ACCESSORS

Accessors can be called with no arguments to query the value of an object property, or with a single argument, to set the property to a specific value (unless it is read-only).

debug

Set true to emit helpful messages for debugging purposes, false otherwise. Default is false.

curve

The elliptic curve to use (a Math::EllipticCurve::Prime object).

SEE ALSO

  • Crypt::Ed25519

    A digital signature scheme with deterministic signatures.

AUTHOR

Ashish Gulhati, <crypt-ecdsa at hash.neo.tc>

BUGS

Please report any bugs or feature requests to bug-crypt-ecdsa at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Crypt-ECDSA. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Crypt::ECDSA

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright (c) 2017 Ashish Gulhati.

This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License 2.0.

See http://www.perlfoundation.org/artistic_license_2_0 for the full license terms.