Crypt-OpenSSL-CA

 view release on metacpan or  search on metacpan

lib/Crypt/OpenSSL/CA.pm  view on Meta::CPAN

specification myself; L</PATCHES WELCOME>.

=head1 SEE ALSO

L<Crypt::OpenSSL::CA::Resources>, L<Crypt::OpenSSL::CA::Inline::C>.

=head1 AUTHOR

Dominique QUATRAVAUX, C<< <domq at cpan.org> >>

=head1 PATCHES WELCOME

If you feel that a key feature is missing in I<Crypt::OpenSSL::CA>,
please feel free to send me patches; I'll gladly apply them and
re-release the whole module within a short time.  The only thing I
require is that the patch cover all three of documentation, unit tests
and code; and that tests pass successfully afterwards, of course, at
least on your own machine.  In particular, this means that patches
that only add code will be declined, no matter how desirable the new
features are.

=head1 BUGS

Please report any bugs or feature requests to C<bug-crypt-openssl-ca at
rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Crypt-OpenSSL-CA>.  I
will be notified, and then you'll automatically be notified of
progress on your bug as I make changes.

=head1 SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Crypt::OpenSSL::CA

You can also look for information at:

=over

=item * AnnoCPAN: Annotated CPAN documentation

L<http://annocpan.org/dist/Crypt-OpenSSL-CA>

=item * CPAN Ratings

L<http://cpanratings.perl.org/d/Crypt-OpenSSL-CA>

=item * RT: CPAN's request tracker

L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Crypt-OpenSSL-CA>

=item * Search CPAN

L<http://search.cpan.org/dist/Crypt-OpenSSL-CA>

=back

=head1 ACKNOWLEDGEMENTS

IDEALX (L<http://www.idealx.com/>) is the company that put food on my
family's table for 5 years while I was busy coding IDX-PKI.  I owe
them pretty much everything I know about PKIX, and a great deal of my
todays' Perl-fu.  However, the implementation of this module is
original and does not re-use any code in IDX-PKI.

=head1 COPYRIGHT & LICENSE


Copyright (C) 2007 Siemens Business Services France SAS, all rights
reserved.

This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.

=cut

use Crypt::OpenSSL::CA::Inline::C "__END__";

require My::Tests::Below unless caller();
1;

__END__

=begin testsuite

=head1 TEST SUITE

=cut

use Test2::V0;
use Crypt::OpenSSL::CA::Test;
use Data::Dumper;

=head2 ASN1_INTEGER tests

=cut

use Math::BigInt;

subtest "parse and serialize" => sub {
    my $serial = Crypt::OpenSSL::CA::ASN1_INTEGER->parse(0);
    is($serial->serialize, "0x0");

    $serial = Crypt::OpenSSL::CA::ASN1_INTEGER->parse(1);
    is($serial->serialize, "0x1");

    $serial = Crypt::OpenSSL::CA::ASN1_INTEGER->parse(-1);
    is($serial->serialize, "-0x1");

    $serial = Crypt::OpenSSL::CA::ASN1_INTEGER->parse("-0x1");
    is($serial->serialize, "-0x1");

    $serial = Crypt::OpenSSL::CA::ASN1_INTEGER->parse(0x33);
    is($serial->serialize, "0x33");

    $serial = Crypt::OpenSSL::CA::ASN1_INTEGER->parse("0xdeadbeef1234");
    is($serial->serialize, "0xdeadbeef1234");

    $serial = Crypt::OpenSSL::CA::ASN1_INTEGER->parse(
        -Math::BigInt->from_hex("deadbeef" x 5));
    is($serial->serialize, "-0x" . ("deadbeef" x 5));



( run in 2.456 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )