ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Convert-BER-XS/XS.pm
(Generate patch)

Comparing Convert-BER-XS/XS.pm (file contents):
Revision 1.6 by root, Fri Apr 19 20:38:38 2019 UTC vs.
Revision 1.7 by root, Fri Apr 19 20:42:12 2019 UTC

64 64
65 my $buf = ber_encode $ber; 65 my $buf = ber_encode $ber;
66 66
67=head1 DESCRIPTION 67=head1 DESCRIPTION
68 68
69WARNING: Before release 1.0, the API is not considered stable in any way.
70
69This module implements a I<very> low level BER/DER en-/decoder. 71This module implements a I<very> low level BER/DER en-/decoder.
70 72
71If is tuned for low memory and high speed, while still maintaining some 73If is tuned for low memory and high speed, while still maintaining some
72level of user-friendlyness. 74level of user-friendlyness.
73 75
164Thus, you can always decode a BER data structure and at worst you get a 166Thus, you can always decode a BER data structure and at worst you get a
165string in place of some nice decoded value. 167string in place of some nice decoded value.
166 168
167See the SYNOPSIS for an example of such an encoded tuple representation. 169See the SYNOPSIS for an example of such an encoded tuple representation.
168 170
171=head2 DECODING AND ENCODING
172
173=over
174
175=item $tuple = ber_decoded $bindata
176
177Decodes binary BER data in C<$bindata> and returns the resulting BER
178tuple. Croaks on any decoding error, so the returned C<$tuple> is always
179valid.
180
181=item $bindata = ber_encode $tuple
182
183Encodes the BER tuple into a BER/DER data structure.
184
185=back
186
169=head2 HELPER FUNCTIONS 187=head2 HELPER FUNCTIONS
170 188
171Working with a 4-tuple for every value can be annoying. Or, rather, I<is> 189Working with a 4-tuple for every value can be annoying. Or, rather, I<is>
172annoying. To reduce this a bit, this module defines a number of helper 190annoying. To reduce this a bit, this module defines a number of helper
173functions, both to match BER tuples and to conmstruct BER tuples: 191functions, both to match BER tuples and to conmstruct BER tuples:
269use common::sense; 287use common::sense;
270 288
271use XSLoader (); 289use XSLoader ();
272use Exporter qw(import); 290use Exporter qw(import);
273 291
274our $VERSION = 0.1; 292our $VERSION = 0.2;
275 293
276XSLoader::load __PACKAGE__, $VERSION; 294XSLoader::load __PACKAGE__, $VERSION;
277 295
278our %EXPORT_TAGS = ( 296our %EXPORT_TAGS = (
279 const => [qw( 297 const => [qw(

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines