]> Dogcows Code - chaz/p5-File-KDBX/blob - lib/File/KDBX/Dumper/Raw.pm
Version 0.900
[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 File::KDBX::Util qw(:class);
8 use namespace::clean;
9
10 extends 'File::KDBX::Dumper';
11
12 our $VERSION = '0.900'; # VERSION
13
14 sub _dump {
15 my $self = shift;
16 my $fh = shift;
17
18 $self->_write_body($fh);
19 }
20
21 sub _write_headers { '' }
22
23 sub _write_body {
24 my $self = shift;
25 my $fh = shift;
26
27 $self->_write_inner_body($fh);
28 }
29
30 sub _write_inner_body {
31 my $self = shift;
32 my $fh = shift;
33
34 $fh->print($self->kdbx->raw);
35 }
36
37 1;
38
39 __END__
40
41 =pod
42
43 =encoding UTF-8
44
45 =head1 NAME
46
47 File::KDBX::Dumper::Raw - A no-op dumper that dumps content as-is
48
49 =head1 VERSION
50
51 version 0.900
52
53 =head1 SYNOPSIS
54
55 use File::KDBX::Dumper;
56 use File::KDBX;
57
58 my $kdbx = File::KDBX->new;
59 $kdbx->raw("Secret file contents\n");
60
61 $kdbx->dump_file('file.kdbx', $key, inner_format => 'Raw');
62 # OR
63 File::KDBX::Dumper->dump_file('file.kdbx', $key,
64 kdbx => $kdbx,
65 inner_format => 'Raw',
66 );
67
68 =head1 DESCRIPTION
69
70 A typical KDBX file is made up of an outer section (with headers) and an inner section (with the body). The
71 inner section is usually dumped using L<File::KDBX::Dumper::XML>, but you can use the
72 B<File::KDBX::Dumper::Raw> dumper to just write some arbitrary data as the body content. The result won't
73 necessarily be parseable by typical KeePass implementations, but it can be read back using
74 L<File::KDBX::Loader::Raw>. It's a way to encrypt any file with the same high level of security as a KDBX
75 database.
76
77 =head1 BUGS
78
79 Please report any bugs or feature requests on the bugtracker website
80 L<https://github.com/chazmcgarvey/File-KDBX/issues>
81
82 When submitting a bug or request, please include a test-file or a
83 patch to an existing test-file that illustrates the bug or desired
84 feature.
85
86 =head1 AUTHOR
87
88 Charles McGarvey <ccm@cpan.org>
89
90 =head1 COPYRIGHT AND LICENSE
91
92 This software is copyright (c) 2022 by Charles McGarvey.
93
94 This is free software; you can redistribute it and/or modify it under
95 the same terms as the Perl 5 programming language system itself.
96
97 =cut
This page took 0.03952 seconds and 4 git commands to generate.