]> Dogcows Code - chaz/p5-File-KDBX/blob - lib/File/KDBX/Dumper/Raw.pm
00205c85a7f6c89ead00768259dc42684d361464
[chaz/p5-File-KDBX] / lib / File / KDBX / Dumper / Raw.pm
1 package File::KDBX::Dumper::Raw;
2 # ABSTRACT: A no-op dumper that dumps content as-is
3
4 use warnings;
5 use strict;
6
7 use parent 'File::KDBX::Dumper';
8
9 our $VERSION = '999.999'; # VERSION
10
11 sub _dump {
12 my $self = shift;
13 my $fh = shift;
14
15 $self->_write_body($fh);
16 }
17
18 sub _write_headers { '' }
19
20 sub _write_body {
21 my $self = shift;
22 my $fh = shift;
23
24 $self->_write_inner_body($fh);
25 }
26
27 sub _write_inner_body {
28 my $self = shift;
29 my $fh = shift;
30
31 $fh->print($self->kdbx->raw);
32 }
33
34 1;
35 __END__
36
37 =head1 SYNOPSIS
38
39 use File::KDBX::Dumper;
40 use File::KDBX;
41
42 my $kdbx = File::KDBX->new;
43 $kdbx->raw("Secret file contents\n");
44
45 $kdbx->dump_file('file.kdbx', $key, inner_format => 'Raw');
46 # OR
47 File::KDBX::Dumper->dump_file('file.kdbx', $key,
48 kdbx => $kdbx,
49 inner_format => 'Raw',
50 );
51
52 =head1 DESCRIPTION
53
54 A typical KDBX file is made up of an outer section (with headers) and an inner section (with the body). The
55 inner section is usually dumped using L<File::KDBX::Dumper::XML>, but you can use the
56 B<File::KDBX::Dumper::Raw> dumper to just write some arbitrary data as the body content. The result won't
57 necessarily be parseable by typical KeePass implementations, but it can be read back using
58 L<File::KDBX::Loader::Raw>. It's a way to encrypt any file with the same high level of security as a KDBX
59 database.
60
61 =cut
This page took 0.030351 seconds and 3 git commands to generate.