| 1 | #!/usr/bin/perl -sw | ||||||||||||||||||||
| 2 | ## | ||||||||||||||||||||
| 3 | ## Crypt::RSA::SS:PSS | ||||||||||||||||||||
| 4 | ## | ||||||||||||||||||||
| 5 | ## Copyright (c) 2001, Vipul Ved Prakash. All rights reserved. | ||||||||||||||||||||
| 6 | ## This code is free software; you can redistribute it and/or modify | ||||||||||||||||||||
| 7 | ## it under the same terms as Perl itself. | ||||||||||||||||||||
| 8 | ## | ||||||||||||||||||||
| 9 | ## $Id: PSS.pm,v 1.5 2001/06/22 23:27:38 vipul Exp $ | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | package Crypt::RSA::SS::PSS; | ||||||||||||||||||||
| 12 | 3 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 3 | ▶ | use base 'Crypt::RSA::Errorhandler'; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 14 | 3 | ▶ | use Crypt::Random qw(makerandom_octet); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 15 | 3 | ▶ | use Crypt::RSA::DataFormat qw(octet_len os2ip i2osp octet_xor mgf1); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | 3 | ▶ | use Crypt::RSA::Primitives; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 17 | 3 | ▶ | use Crypt::RSA::Debug qw(debug); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 18 | 3 | ▶ | use Digest::SHA1 qw(sha1); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 19 | 3 | ▶ | use Math::Pari qw(floor); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 3 | $Crypt::RSA::SS::PSS::VERSION = '1.99'; | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
documented
| |||||||||||||||||||||
| 24 | 3 | my ($class, %params) = @_; | |||||||||||||||||||
| 25 | 3 | my $self = bless { primitives => new Crypt::RSA::Primitives, | |||||||||||||||||||
| 26 | hlen => 20, | ||||||||||||||||||||
| 27 | VERSION => $Crypt::RSA::SS::PSS::VERSION, | ||||||||||||||||||||
| 28 | }, $class; | ||||||||||||||||||||
| 29 | 3 | ▶ | if ($params{Version}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 30 | # do versioning here | ||||||||||||||||||||
| 31 | } | ||||||||||||||||||||
| 32 | 3 | return $self; | |||||||||||||||||||
| 33 | } | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | |||||||||||||||||||||
| 36 | 208 | ▶ | sub sign { | ||||||||||||||||||
|
Subroutine
sign: called CC=5 SCAR=16.7
Pod
documented
| |||||||||||||||||||||
| 37 | 208 | my ($self, %params) = @_; | |||||||||||||||||||
| 38 | 208 | ▶ | my $key = $params{Key}; my $M = $params{Message} || $params{Plaintext}; | ||||||||||||||||||
|
Condition33%1/3
$params{'Message'} || $params{'Plaintext'}
MC/DC0%0/2
$params{'Message'} || $params{'Plaintext'}
$params{'Message'}
$params{'Plaintext'}
Truth table33%1/3
A || B
A= $params{'Message'}B= $params{'Plaintext'}
| |||||||||||||||||||||
| 39 | 208 | ▶ | return $self->error("No Key parameter", \$M, \%params) unless $key; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 40 | 208 | ▶ | return $self->error("No Message or Plaintext parameter", \$key, \%params) unless $M; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 41 | 208 | my $k = octet_len ($key->n); | |||||||||||||||||||
| 42 | 208 | my $salt = makerandom_octet (Length => $self->{hlen}); | |||||||||||||||||||
| 43 | 208 | my $em = $self->encode ($M, $salt, $k-1); | |||||||||||||||||||
| 44 | 208 | my $m = os2ip ($em); | |||||||||||||||||||
| 45 | 208 | my $sig = $self->{primitives}->core_sign (Key => $key, Message => $m); | |||||||||||||||||||
| 46 | 208 | my $S = i2osp ($sig, $k); | |||||||||||||||||||
| 47 | 208 | ▶ | return ($S, $salt) if wantarray; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 48 | 208 | return $S; | |||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | |||||||||||||||||||||
| 51 | |||||||||||||||||||||
| 52 | 0 | ▶ | sub verify_with_salt { | ||||||||||||||||||
|
Subroutine
verify_with_salt: not called CC=11 SCAR=48.8
Pod
documented
| |||||||||||||||||||||
| 53 | 0 | my ($self, %params) = @_; | |||||||||||||||||||
| 54 | 0 | ▶ | my $key = $params{Key}; my $M = $params{Message} || $params{Plaintext}; | ||||||||||||||||||
|
Condition0%0/3
$params{'Message'} || $params{'Plaintext'}
MC/DC0%0/2
$params{'Message'} || $params{'Plaintext'}
$params{'Message'}
$params{'Plaintext'}
Truth table0%0/3
A || B
A= $params{'Message'}B= $params{'Plaintext'}
| |||||||||||||||||||||
| 55 | 0 | my $S = $params{Signature}; my $salt = $params{Salt}; | |||||||||||||||||||
| 56 | 0 | ▶ | return $self->error("No Key parameter", \$S, \%params) unless $key; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 57 | 0 | ▶ | return $self->error("No Signature parameter", \$key, \%params) unless $S; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 58 | 0 | my $k = octet_len ($key->n); | |||||||||||||||||||
| 59 | 0 | my $em; | |||||||||||||||||||
| 60 | 0 | ▶ | unless ($em = $self->encode ($M, $salt, $k-1)) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 61 | 0 | ▶ | return if $self->errstr eq "Message too long."; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 62 | 0 | ▶ | return $self->error ("Modulus too short.", \$M, \$S, \$key, \%params) if | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 63 | $self->errstr eq "Intended encoded message length too short."; | ||||||||||||||||||||
| 64 | } | ||||||||||||||||||||
| 65 | 0 | ▶ | return $self->error ("Invalid signature.", \$M, \$S, $key, \%params) if length($S) < $k; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 66 | 0 | my $s = os2ip ($S); | |||||||||||||||||||
| 67 | 0 | ▶ | my $m = $self->{primitives}->core_verify (Key => $key, Signature => $s) || | ||||||||||||||||||
|
Condition0%0/3
$self->{'primitives'}->core_verify('Key', $key, 'Signature', $s) || $self->error('Invalid signature.', \$M, \$S, $key, \%params)
MC/DC0%0/2
$self->{'primitives'}->core_verify('Key', $key, 'Signature', $s) || $self->error('Invalid signature.', \$M, \$S, $key, \%params)
$self->{'primitives'}->core_verify('Key', $key, 'Signature', $s)
$self->error('Invalid signature.', \$M, \$S, $key, \%params)
Truth table0%0/3
A || B
A= $self->{'primitives'}->core_verify('Key', $key, 'Signature', $s)B= $self->error('Invalid signature.', \$M, \$S, $key, \%params)
| |||||||||||||||||||||
| 68 | $self->error ("Invalid signature.", \$M, \$S, $key, \%params); | ||||||||||||||||||||
| 69 | 0 | ▶ | my $em1 = i2osp ($m, $k-1) || | ||||||||||||||||||
|
Condition0%0/2
i2osp($m, $k - 1) || (return $self->error('Invalid signature.', \$M, \$S, $key, \%params))
MC/DC0%0/1
i2osp($m, $k - 1) || (return $self->error('Invalid signature.', \$M, \$S, $key, \%params))
i2osp($m, $k - 1)
Truth table0%0/2
A
A= i2osp($m, $k - 1)
| |||||||||||||||||||||
| 70 | return $self->error ("Invalid signature.", \$M, \$S, $key, \%params); | ||||||||||||||||||||
| 71 | 0 | ▶ | return 1 if $em eq $em1; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 72 | 0 | return $self->error ("Invalid signature.", \$M, \$S, $key, \%params); | |||||||||||||||||||
| 73 | } | ||||||||||||||||||||
| 74 | |||||||||||||||||||||
| 75 | |||||||||||||||||||||
| 76 | 207 | ▶ | sub verify { | ||||||||||||||||||
|
Subroutine
verify: called CC=8 SCAR=22.9
Pod
documented
| |||||||||||||||||||||
| 77 | 207 | my ($self, %params) = @_; | |||||||||||||||||||
| 78 | 207 | ▶ | my $key = $params{Key}; my $M = $params{Message} || $params{Plaintext}; | ||||||||||||||||||
|
Condition33%1/3
$params{'Message'} || $params{'Plaintext'}
MC/DC0%0/2
$params{'Message'} || $params{'Plaintext'}
$params{'Message'}
$params{'Plaintext'}
Truth table33%1/3
A || B
A= $params{'Message'}B= $params{'Plaintext'}
| |||||||||||||||||||||
| 79 | 207 | my $S = $params{Signature}; | |||||||||||||||||||
| 80 | 207 | ▶ | return $self->error("No Key parameter", \$S, \$M, \%params) unless $key; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 81 | 207 | ▶ | return $self->error("No Signature parameter", \$key, \$M, \%params) unless $S; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 82 | 207 | ▶ | return $self->error("No Message or Plaintext parameter", \$key, \$S, \%params) unless $M; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 83 | 207 | my $k = octet_len ($key->n); | |||||||||||||||||||
| 84 | 207 | my $s = os2ip ($S); | |||||||||||||||||||
| 85 | 207 | ▶ | my $m = $self->{primitives}->core_verify (Key => $key, Signature => $s) || | ||||||||||||||||||
|
Condition33%1/3
$self->{'primitives'}->core_verify('Key', $key, 'Signature', $s) || $self->error('Invalid signature.', \$M, \$S, $key, \%params)
MC/DC0%0/2
$self->{'primitives'}->core_verify('Key', $key, 'Signature', $s) || $self->error('Invalid signature.', \$M, \$S, $key, \%params)
$self->{'primitives'}->core_verify('Key', $key, 'Signature', $s)
$self->error('Invalid signature.', \$M, \$S, $key, \%params)
Truth table33%1/3
A || B
A= $self->{'primitives'}->core_verify('Key', $key, 'Signature', $s)B= $self->error('Invalid signature.', \$M, \$S, $key, \%params)
| |||||||||||||||||||||
| 86 | $self->error ("Invalid signature.", \$M, \$S, $key, \%params); | ||||||||||||||||||||
| 87 | 207 | ▶ | my $em1 = i2osp ($m, $k-1) || | ||||||||||||||||||
|
Condition100%2/2
i2osp($m, $k - 1) || (return $self->error('Invalid signature.', \$M, \$S, $key, \%params))
MC/DC100%1/1
i2osp($m, $k - 1) || (return $self->error('Invalid signature.', \$M, \$S, $key, \%params))
i2osp($m, $k - 1)
Truth table100%2/2
A
A= i2osp($m, $k - 1)
| |||||||||||||||||||||
| 88 | return $self->error ("Invalid signature.", \$M, \$S, $key, \%params); | ||||||||||||||||||||
| 89 | 107 | ▶ | return 1 if $self->verify_with_salt_recovery ($M, $em1); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 90 | 0 | return $self->error ("Invalid signature.", \$M, \$S, $key, \%params); | |||||||||||||||||||
| 91 | } | ||||||||||||||||||||
| 92 | |||||||||||||||||||||
| 93 | |||||||||||||||||||||
| 94 | 208 | ▶ | sub encode { | ||||||||||||||||||
|
Subroutine
encode: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 95 | 208 | my ($self, $M, $salt, $emlen) = @_; | |||||||||||||||||||
| 96 | return $self->error ("Intended encoded message length too short.", \$M, \$salt ) | ||||||||||||||||||||
| 97 | 208 | ▶ | if $emlen < 2 * $self->{hlen}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 98 | 208 | my $H = $self->hash ("$salt$M"); | |||||||||||||||||||
| 99 | 208 | my $padlength = $emlen - (2*$$self{hlen}); | |||||||||||||||||||
| 100 | 208 | my $PS = chr(0)x$padlength; | |||||||||||||||||||
| 101 | 208 | my $db = $salt . $PS; | |||||||||||||||||||
| 102 | 208 | my $dbmask = $self->mgf ($H, $emlen - $self->{hlen}); | |||||||||||||||||||
| 103 | 208 | my $maskeddb = octet_xor ($db, $dbmask); | |||||||||||||||||||
| 104 | 208 | my $em = $H . $maskeddb; | |||||||||||||||||||
| 105 | 208 | return $em; | |||||||||||||||||||
| 106 | } | ||||||||||||||||||||
| 107 | |||||||||||||||||||||
| 108 | |||||||||||||||||||||
| 109 | 107 | ▶ | sub verify_with_salt_recovery { | ||||||||||||||||||
|
Subroutine
verify_with_salt_recovery: called CC=4 SCAR=14.1
Pod
undocumented
| |||||||||||||||||||||
| 110 | 107 | my ($self, $M, $EM) = @_; | |||||||||||||||||||
| 111 | 107 | my $hlen = $$self{hlen}; | |||||||||||||||||||
| 112 | 107 | my $emlen = length ($EM); | |||||||||||||||||||
| 113 | 107 | ▶ | return $self->error ("Encoded message too short.", \$M, \$EM) if $emlen < (2*$hlen); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 114 | 107 | my $H = substr $EM, 0, $hlen; | |||||||||||||||||||
| 115 | 107 | my $maskeddb = substr $EM, $hlen; | |||||||||||||||||||
| 116 | 107 | my $dbmask = $self->mgf ($H, $emlen-$hlen); | |||||||||||||||||||
| 117 | 107 | my $db = octet_xor ($maskeddb, $dbmask); | |||||||||||||||||||
| 118 | 107 | my $salt = substr $db, 0, $hlen; | |||||||||||||||||||
| 119 | 107 | my $PS = substr $db, $hlen; | |||||||||||||||||||
| 120 | 107 | my $check = chr(0) x ($emlen-(2*$hlen)); debug ("PS: $PS"); | |||||||||||||||||||
| 121 | 107 | ▶ | return $self->error ("Inconsistent.") unless $check eq $PS; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 122 | 107 | my $H1 = $self->hash ("$salt$M"); | |||||||||||||||||||
| 123 | 107 | ▶ | return 1 if $H eq $H1; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 124 | 0 | return $self->error ("Inconsistent."); | |||||||||||||||||||
| 125 | } | ||||||||||||||||||||
| 126 | |||||||||||||||||||||
| 127 | |||||||||||||||||||||
| 128 | 315 | ▶ | sub hash { | ||||||||||||||||||
|
Subroutine
hash: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 129 | 315 | my ($self, $data) = @_; | |||||||||||||||||||
| 130 | 315 | return sha1 ($data); | |||||||||||||||||||
| 131 | } | ||||||||||||||||||||
| 132 | |||||||||||||||||||||
| 133 | |||||||||||||||||||||
| 134 | 315 | ▶ | sub mgf { | ||||||||||||||||||
|
Subroutine
mgf: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 135 | 315 | my ($self, @data) = @_; | |||||||||||||||||||
| 136 | 315 | return mgf1 (@data); | |||||||||||||||||||
| 137 | } | ||||||||||||||||||||
| 138 | |||||||||||||||||||||
| 139 | |||||||||||||||||||||
| 140 | 3 | ▶ | sub version { | ||||||||||||||||||
|
Subroutine
version: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 141 | 3 | my $self = shift; | |||||||||||||||||||
| 142 | 3 | return $self->{VERSION}; | |||||||||||||||||||
| 143 | } | ||||||||||||||||||||
| 144 | |||||||||||||||||||||
| 145 | |||||||||||||||||||||
| 146 | 0 | ▶ | sub signblock { | ||||||||||||||||||
|
Subroutine
signblock: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||
| 147 | 0 | return -1; | |||||||||||||||||||
| 148 | } | ||||||||||||||||||||
| 149 | |||||||||||||||||||||
| 150 | |||||||||||||||||||||
| 151 | 4 | ▶ | sub verifyblock { | ||||||||||||||||||
|
Subroutine
verifyblock: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||
| 152 | 4 | my ($self, %params) = @_; | |||||||||||||||||||
| 153 | 4 | return octet_len($params{Key}->n); | |||||||||||||||||||
| 154 | } | ||||||||||||||||||||
| 155 | |||||||||||||||||||||
| 156 | |||||||||||||||||||||
| 157 | 3 | 1; | |||||||||||||||||||
| 158 | |||||||||||||||||||||
| 159 | =head1 NAME | ||||||||||||||||||||
| 160 | |||||||||||||||||||||
| 161 | Crypt::RSA::SS::PSS - Probabilistic Signature Scheme based on RSA. | ||||||||||||||||||||
| 162 | |||||||||||||||||||||
| 163 | =head1 SYNOPSIS | ||||||||||||||||||||
| 164 | |||||||||||||||||||||
| 165 | my $pss = new Crypt::RSA::SS::PSS; | ||||||||||||||||||||
| 166 | |||||||||||||||||||||
| 167 | my $signature = $pss->sign ( | ||||||||||||||||||||
| 168 | Message => $message, | ||||||||||||||||||||
| 169 | Key => $private, | ||||||||||||||||||||
| 170 | ) || die $pss->errstr; | ||||||||||||||||||||
| 171 | |||||||||||||||||||||
| 172 | my $verify = $pss->verify ( | ||||||||||||||||||||
| 173 | Message => $message, | ||||||||||||||||||||
| 174 | Key => $key, | ||||||||||||||||||||
| 175 | Signature => $signature, | ||||||||||||||||||||
| 176 | ) || die $pss->errstr; | ||||||||||||||||||||
| 177 | |||||||||||||||||||||
| 178 | |||||||||||||||||||||
| 179 | =head1 DESCRIPTION | ||||||||||||||||||||
| 180 | |||||||||||||||||||||
| 181 | PSS (Probabilistic Signature Scheme) is a provably secure method of | ||||||||||||||||||||
| 182 | creating digital signatures with RSA. "Provable" means that the | ||||||||||||||||||||
| 183 | difficulty of forging signatures can be directly related to inverting | ||||||||||||||||||||
| 184 | the RSA function. "Probabilistic" alludes to the randomly generated salt | ||||||||||||||||||||
| 185 | value included in the signature to enhance security. For more details | ||||||||||||||||||||
| 186 | on PSS, see [4] & [13]. | ||||||||||||||||||||
| 187 | |||||||||||||||||||||
| 188 | =head1 METHODS | ||||||||||||||||||||
| 189 | |||||||||||||||||||||
| 190 | =head2 B<new()> | ||||||||||||||||||||
| 191 | |||||||||||||||||||||
| 192 | Constructor. | ||||||||||||||||||||
| 193 | |||||||||||||||||||||
| 194 | =head2 B<version()> | ||||||||||||||||||||
| 195 | |||||||||||||||||||||
| 196 | Returns the version number of the module. | ||||||||||||||||||||
| 197 | |||||||||||||||||||||
| 198 | =head2 B<sign()> | ||||||||||||||||||||
| 199 | |||||||||||||||||||||
| 200 | Computes a PSS signature on a message with the private key of the signer. | ||||||||||||||||||||
| 201 | In scalar context, sign() returns the computed signature. In array | ||||||||||||||||||||
| 202 | context, it returns the signature and the random salt. The signature can | ||||||||||||||||||||
| 203 | verified with verify() or verify_with_salt(). sign() takes a hash argument | ||||||||||||||||||||
| 204 | with the following mandatory keys: | ||||||||||||||||||||
| 205 | |||||||||||||||||||||
| 206 | =over 4 | ||||||||||||||||||||
| 207 | |||||||||||||||||||||
| 208 | =item B<Message> | ||||||||||||||||||||
| 209 | |||||||||||||||||||||
| 210 | Message to be signed, a string of arbitrary length. | ||||||||||||||||||||
| 211 | |||||||||||||||||||||
| 212 | =item B<Key> | ||||||||||||||||||||
| 213 | |||||||||||||||||||||
| 214 | Private key of the signer, a Crypt::RSA::Key::Private object. | ||||||||||||||||||||
| 215 | |||||||||||||||||||||
| 216 | =back | ||||||||||||||||||||
| 217 | |||||||||||||||||||||
| 218 | =head2 B<verify()> | ||||||||||||||||||||
| 219 | |||||||||||||||||||||
| 220 | Verifies a signature generated with sign(). The salt is recovered from the | ||||||||||||||||||||
| 221 | signature and need not be passed. Returns a true value on success and | ||||||||||||||||||||
| 222 | false on failure. $self->errstr is set to "Invalid signature." or | ||||||||||||||||||||
| 223 | appropriate error on failure. verify() takes a hash argument with the | ||||||||||||||||||||
| 224 | following mandatory keys: | ||||||||||||||||||||
| 225 | |||||||||||||||||||||
| 226 | =over 4 | ||||||||||||||||||||
| 227 | |||||||||||||||||||||
| 228 | =item B<Key> | ||||||||||||||||||||
| 229 | |||||||||||||||||||||
| 230 | Public key of the signer, a Crypt::RSA::Key::Public object. | ||||||||||||||||||||
| 231 | |||||||||||||||||||||
| 232 | =item B<Message> | ||||||||||||||||||||
| 233 | |||||||||||||||||||||
| 234 | The original signed message, a string of arbitrary length. | ||||||||||||||||||||
| 235 | |||||||||||||||||||||
| 236 | =item B<Signature> | ||||||||||||||||||||
| 237 | |||||||||||||||||||||
| 238 | Signature computed with sign(), a string. | ||||||||||||||||||||
| 239 | |||||||||||||||||||||
| 240 | =item B<Version> | ||||||||||||||||||||
| 241 | |||||||||||||||||||||
| 242 | Version of the module that was used for creating the Signature. This is an | ||||||||||||||||||||
| 243 | optional argument. When present, verify() will ensure before proceeding | ||||||||||||||||||||
| 244 | that the installed version of the module can successfully verify the | ||||||||||||||||||||
| 245 | Signature. | ||||||||||||||||||||
| 246 | |||||||||||||||||||||
| 247 | =back | ||||||||||||||||||||
| 248 | |||||||||||||||||||||
| 249 | =head2 B<verify_with_salt()> | ||||||||||||||||||||
| 250 | |||||||||||||||||||||
| 251 | Verifies a signature given the salt. Takes the same arguments as verify() | ||||||||||||||||||||
| 252 | in addition to B<Salt>, which is a 20-byte string returned by sign() in | ||||||||||||||||||||
| 253 | array context. | ||||||||||||||||||||
| 254 | |||||||||||||||||||||
| 255 | =head1 ERROR HANDLING | ||||||||||||||||||||
| 256 | |||||||||||||||||||||
| 257 | See ERROR HANDLING in Crypt::RSA(3) manpage. | ||||||||||||||||||||
| 258 | |||||||||||||||||||||
| 259 | =head1 BIBLIOGRAPHY | ||||||||||||||||||||
| 260 | |||||||||||||||||||||
| 261 | See BIBLIOGRAPHY in Crypt::RSA(3) manpage. | ||||||||||||||||||||
| 262 | |||||||||||||||||||||
| 263 | =head1 AUTHOR | ||||||||||||||||||||
| 264 | |||||||||||||||||||||
| 265 | Vipul Ved Prakash, E<lt>mail@vipul.netE<gt> | ||||||||||||||||||||
| 266 | |||||||||||||||||||||
| 267 | =head1 SEE ALSO | ||||||||||||||||||||
| 268 | |||||||||||||||||||||
| 269 | Crypt::RSA(3), Crypt::RSA::Primitives(3), Crypt::RSA::Keys(3), | ||||||||||||||||||||
| 270 | Crypt::RSA::EME::OAEP(3) | ||||||||||||||||||||
| 271 | |||||||||||||||||||||
| 272 | =cut | ||||||||||||||||||||
| 273 | |||||||||||||||||||||
| 274 | |||||||||||||||||||||