Authen-NZRealMe
view release on metacpan or search on metacpan
lib/Authen/NZRealMe/XMLSig.pm view on Meta::CPAN
return @nodes;
}
sub ignore_bad_signatures { # Called if skip_signature_check is enabled
shift->{signed_fragment_paths} = [ '/' ];
}
sub create_detached_signature {
my($self, $plaintext, $eol) = @_;
$eol //= "\n";
my $algorithm = $self->_find_sig_alg($self->signature_algorithm);
my $b64_sig = $self->_create_signature($algorithm, $plaintext);
$b64_sig =~ s/\s+/$eol/g;
return $b64_sig;
}
sub verify_detached_signature {
my($self, $plaintext, $b64_sig) = @_;
my $algorithm = $self->_find_sig_alg($self->signature_algorithm);
return $self->_verify_signature($algorithm, $plaintext, $b64_sig);
}
lib/Authen/NZRealMe/XMLSig.pm view on Meta::CPAN
my $refs = [
{ ref_uri => $first_uri_value },
{ ref_uri => $second_uri_value },
];
$signer->sign($xml, undef, references => $ref);
Each reference can include a list of namespace prefixes to be included in the
canonicalisation transform.
=head2 create_detached_signature( $plaintext, $eol )
Takes a plaintext string, calculates a signature using the private key (and
optionally the signarture algorithm) passed to the constructor and returns a
base64-encoded string. The C<$eol> parameter can be used to specify the
line-ending character used in the base64 encoding process (default: \n).
=head2 verify_detached_signature( $plaintext, $base64_sig )
Takes a plaintext string, and a base64-encoded signature. Verifies the
signature using the public key or certificate supplied to the constructor.
Returns true if the signature is valid, and false otherwise.
=head2 verify( $xml, $selector_xpath, @namespaces )
( run in 1.741 second using v1.01-cache-2.11-cpan-98e64b0badf )