William Herrera > Crypt-ECDSA-0.069 > Crypt::ECDSA::Key

Download:
Crypt-ECDSA-0.069.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Module Version: 0.067   Source  

NAME ^

Crypt::ECDSA::Key -- ECDSA Key object package for elliptic key DSA cryptography

DESCRIPTION ^

  These are for use with Crypt::ECDSA and require Math::BigInt::GMP.

METHODS ^

new
  Constructor.  Takes the following named pair arguments:
  
  
  curve => curve or a 'standard' named curve (this may be the best choice)
  if not a standard curve, will need X => integer, Y => integer, order => integer,
  G_x => base point x coordinate,  G_y => base point y coordinate
  d => secret key, a integer secret multiplier.  If secret not specified, 
  the object will generate a random secret key.

  If a PEM file is specified, new will read the key parameters from that file:
  
  my $key_from_PEM = Crypt::ECDSA::Key->new( PEM => $pem_filename );
curve
  Returns or sets the key's curve, a Crypt::ECDSA::Curve derived object 
Q
  Returns or sets the key's Q public point
Qx
  returns the x coordinate of the public key
Qy
  returns the y coordinate of the public key
order
  Returns the order of the curve's base point, if known
secret
  returns the secret scalar private key (stored internally as scalar $d)
set_public_Q
  Used to set a public key for use when the private key is unknown
new_key_values

sub new_key_values {

  my( $d, $Qx, $Qy ) = $key->new_secret_value();

  Regenerate a new private and public key and return the scalars
  ( secret value d, public point x coordinate, public point y coordinate )
  Be careful!  The old and new secret keys are not stored permanently by the module.
verify_public_key
  if( $key->verify_public_key { $Qx, $Qy ) ) {
    print "Public key verified ok";
  }

  Verify a provided public key when the curve, but not the private key are known
read_PEM
  $key->read_pem( filename =>$pem_filename, private => 1 );
  
  Read a key from a PEM file.  private => $n , if present and nonzero, means to
  read the secret key from the file, otherwise only the public key may be read.
write_PEM
  $bytes_written = $key->write_PEM( filename => $file, private => 1 );
  
  Write the key to a PEM file.  Private key is written if the 'private' 
  argument is nonzero. A password => "password" argument is permitted.

Class Internal Functions

G
new_secret_value

AUTHOR ^

   William Herrera B<wherrera@skylightview.com>. 

SUPPORT ^

Questions, feature requests and bug reports should go to <wherrera@skylightview.com>.

COPYRIGHT ^

Copyright (c) 2007 William Herrera. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.