GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Crypt::Perl::ECDSA::PublicKey(3) User Contributed Perl Documentation Crypt::Perl::ECDSA::PublicKey(3)

Crypt::Perl::ECDSA::PublicKey - object representation of ECDSA public key

    #Use Parse.pm or a private key’s get_public_key()
    #rather #than instantiating this class directly.

    #This works even if the object came from a key file that doesn’t
    #contain the curve name.
    $pbkey->get_curve_name();

    if ($payload > ($pbkey->max_sign_bits() / 8)) {
        die "Payload too long!";
    }

    $pbkey->verify($payload, $sig) or die "Invalid signature!";

    #For JSON Web Algorithms (JWT et al.), cf. RFC 7518 page 8
    #This verifies against the appropriate SHA digest rather than
    #against the original message.
    $pbkey->verify_jwa($payload, $sig) or die "Invalid signature!";

    #----------------------------------------------------------------------

    #Includes “kty”, “crv”, “x”, and “y”.
    #Add in whatever else your application needs afterward.
    #
    #This will die() if you try to run it with a curve that
    #doesn’t have a known JWK “crv” value.
    #
    my $pub_jwk = $pbkey->get_struct_for_public_jwk();

    #Useful for JWTs
    my $jwt_alg = $pbkey->get_jwa_alg();

The SYNOPSIS above should be illustration enough of how to use this class.

Export methods (PEM, DER, etc.) are shown in Crypt::Perl::ECDSA.

2018-07-21 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.