blib/lib/Crypt/Perl/Ed25519/PublicKey.pm

filter: Statementstmt 100% 17 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 95.8% 23 / 24 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« lib/Crypt/Perl/RSA/Template.pm ↑ Summary lib/Crypt/Perl/PKCS10/Attribute/challengePassword.pm »
1 package Crypt::Perl::Ed25519::PublicKey;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 =encoding utf-8
7  
8 =head1 NAME
9  
10 Crypt::Perl::Ed25519::PublicKey
11  
12 =head1 SYNOPSIS
13  
14 # This expects an octet string.
15 my $import_key = Crypt::Perl::Ed25519::PublicKey->new( $pub_str );
16  
17 $key->verify( $message, $signature ) or die "Invalid sig for msg!";
18  
19 #----------------------------------------------------------------------
20  
21 # Returns an octet string.
22 my $pub_str = $key->get_public();
23  
24 # Returns an object
25 my $pub_obj = $key->get_public_key();
26  
27 =head1 DESCRIPTION
28  
29 This class implements Ed25519 verification.
30  
31 =cut
32  
33 1 ▶use parent qw( Crypt::Perl::Ed25519::KeyBase );
Subroutine BEGIN: called CC=1 SCAR=0.0
34  
35 sub new {
36 2 ▶ my ($class, $pub) = @_;
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
37  
38 2 return bless {
39 _public => $pub,
40 _public_ar => [ unpack 'C*', $pub ],
41 }, $class;
42 }
43  
44 use constant {
45 1 _PEM_HEADER => 'PUBLIC KEY',
46 _ASN1 => q<
47 FG_Key ::= SEQUENCE {
48 algorithmIdentifier AlgorithmIdentifier,
49 subjectPublicKey BIT STRING
50 }
51 >,
52 1 ▶};
Subroutine BEGIN: called CC=1 SCAR=0.0
53  
54 sub _to_der_args {
55 1 ▶ my ($self) = @_;
Subroutine _to_der_args: called CC=1 SCAR=0.0
56  
57 return (
58  
59 # The leading bytes are the encoding of the inner CurvePrivateKey
60 # (i.e., OCTET STRING).
61 1 subjectPublicKey => $self->{'_public'},
62 );
63 }
64  
65 1 1;
« lib/Crypt/Perl/RSA/Template.pm ↑ Summary lib/Crypt/Perl/PKCS10/Attribute/challengePassword.pm »