]> Dogcows Code - chaz/p5-File-KDBX/blob - lib/File/KDBX/Constants.pm
Version 0.900
[chaz/p5-File-KDBX] / lib / File / KDBX / Constants.pm
1 package File::KDBX::Constants;
2 # ABSTRACT: All the KDBX-related constants you could ever want
3
4 # HOW TO add new constants:
5 # 1. Add it to the %CONSTANTS structure below.
6 # 2. List it in the pod at the bottom of this file in the section corresponding to its tag.
7 # 3. There is no step three.
8
9 use warnings;
10 use strict;
11
12 use Exporter qw(import);
13 use Scalar::Util qw(dualvar);
14 use namespace::clean -except => 'import';
15
16 our $VERSION = '0.900'; # VERSION
17
18 BEGIN {
19 my %CONSTANTS = (
20 magic => {
21 __prefix => 'KDBX',
22 SIG1 => 0x9aa2d903,
23 SIG1_FIRST_BYTE => 0x03,
24 SIG2_1 => 0xb54bfb65,
25 SIG2_2 => 0xb54bfb67,
26 },
27 version => {
28 __prefix => 'KDBX_VERSION',
29 _2_0 => 0x00020000,
30 _3_0 => 0x00030000,
31 _3_1 => 0x00030001,
32 _4_0 => 0x00040000,
33 _4_1 => 0x00040001,
34 OLDEST => 0x00020000,
35 LATEST => 0x00040001,
36 MAJOR_MASK => 0xffff0000,
37 MINOR_MASK => 0x0000ffff,
38 },
39 header => {
40 __prefix => 'HEADER',
41 END => dualvar( 0, 'end'),
42 COMMENT => dualvar( 1, 'comment'),
43 CIPHER_ID => dualvar( 2, 'cipher_id'),
44 COMPRESSION_FLAGS => dualvar( 3, 'compression_flags'),
45 MASTER_SEED => dualvar( 4, 'master_seed'),
46 TRANSFORM_SEED => dualvar( 5, 'transform_seed'),
47 TRANSFORM_ROUNDS => dualvar( 6, 'transform_rounds'),
48 ENCRYPTION_IV => dualvar( 7, 'encryption_iv'),
49 INNER_RANDOM_STREAM_KEY => dualvar( 8, 'inner_random_stream_key'),
50 STREAM_START_BYTES => dualvar( 9, 'stream_start_bytes'),
51 INNER_RANDOM_STREAM_ID => dualvar( 10, 'inner_random_stream_id'),
52 KDF_PARAMETERS => dualvar( 11, 'kdf_parameters'),
53 PUBLIC_CUSTOM_DATA => dualvar( 12, 'public_custom_data'),
54 },
55 compression => {
56 __prefix => 'COMPRESSION',
57 NONE => dualvar( 0, 'none'),
58 GZIP => dualvar( 1, 'gzip'),
59 },
60 cipher => {
61 __prefix => 'CIPHER',
62 UUID_AES128 => "\x61\xab\x05\xa1\x94\x64\x41\xc3\x8d\x74\x3a\x56\x3d\xf8\xdd\x35",
63 UUID_AES256 => "\x31\xc1\xf2\xe6\xbf\x71\x43\x50\xbe\x58\x05\x21\x6a\xfc\x5a\xff",
64 UUID_CHACHA20 => "\xd6\x03\x8a\x2b\x8b\x6f\x4c\xb5\xa5\x24\x33\x9a\x31\xdb\xb5\x9a",
65 UUID_SALSA20 => "\x71\x6e\x1c\x8a\xee\x17\x4b\xdc\x93\xae\xa9\x77\xb8\x82\x83\x3a",
66 UUID_SERPENT => "\x09\x85\x63\xff\xdd\xf7\x4f\x98\x86\x19\x80\x79\xf6\xdb\x89\x7a",
67 UUID_TWOFISH => "\xad\x68\xf2\x9f\x57\x6f\x4b\xb9\xa3\x6a\xd4\x7a\xf9\x65\x34\x6c",
68 },
69 kdf => {
70 __prefix => 'KDF',
71 UUID_AES => "\xc9\xd9\xf3\x9a\x62\x8a\x44\x60\xbf\x74\x0d\x08\xc1\x8a\x4f\xea",
72 UUID_AES_CHALLENGE_RESPONSE => "\x7c\x02\xbb\x82\x79\xa7\x4a\xc0\x92\x7d\x11\x4a\x00\x64\x82\x38",
73 UUID_ARGON2D => "\xef\x63\x6d\xdf\x8c\x29\x44\x4b\x91\xf7\xa9\xa4\x03\xe3\x0a\x0c",
74 UUID_ARGON2ID => "\x9e\x29\x8b\x19\x56\xdb\x47\x73\xb2\x3d\xfc\x3e\xc6\xf0\xa1\xe6",
75 PARAM_UUID => '$UUID',
76 PARAM_AES_ROUNDS => 'R',
77 PARAM_AES_SEED => 'S',
78 PARAM_ARGON2_SALT => 'S',
79 PARAM_ARGON2_PARALLELISM => 'P',
80 PARAM_ARGON2_MEMORY => 'M',
81 PARAM_ARGON2_ITERATIONS => 'I',
82 PARAM_ARGON2_VERSION => 'V',
83 PARAM_ARGON2_SECRET => 'K',
84 PARAM_ARGON2_ASSOCDATA => 'A',
85 DEFAULT_AES_ROUNDS => 100_000,
86 DEFAULT_ARGON2_ITERATIONS => 10,
87 DEFAULT_ARGON2_MEMORY => 1 << 16,
88 DEFAULT_ARGON2_PARALLELISM => 2,
89 DEFAULT_ARGON2_VERSION => 0x13,
90 },
91 random_stream => {
92 __prefix => 'STREAM',
93 ID_RC4_VARIANT => 1,
94 ID_SALSA20 => 2,
95 ID_CHACHA20 => 3,
96 SALSA20_IV => "\xe8\x30\x09\x4b\x97\x20\x5d\x2a",
97
98 },
99 variant_map => {
100 __prefix => 'VMAP',
101 VERSION => 0x0100,
102 VERSION_MAJOR_MASK => 0xff00,
103 TYPE_END => 0x00,
104 TYPE_UINT32 => 0x04,
105 TYPE_UINT64 => 0x05,
106 TYPE_BOOL => 0x08,
107 TYPE_INT32 => 0x0C,
108 TYPE_INT64 => 0x0D,
109 TYPE_STRING => 0x18,
110 TYPE_BYTEARRAY => 0x42,
111 },
112 inner_header => {
113 __prefix => 'INNER_HEADER',
114 END => dualvar( 0, 'end'),
115 INNER_RANDOM_STREAM_ID => dualvar( 1, 'inner_random_stream_id'),
116 INNER_RANDOM_STREAM_KEY => dualvar( 2, 'inner_random_stream_key'),
117 BINARY => dualvar( 3, 'binary'),
118 BINARY_FLAG_PROTECT => 1,
119 },
120 key_file => {
121 __prefix => 'KEY_FILE',
122 TYPE_BINARY => dualvar( 1, 'binary'),
123 TYPE_HASHED => dualvar( 3, 'hashed'),
124 TYPE_HEX => dualvar( 2, 'hex'),
125 TYPE_XML => dualvar( 4, 'xml'),
126 },
127 history => {
128 __prefix => 'HISTORY',
129 DEFAULT_MAX_AGE => 365,
130 DEFAULT_MAX_ITEMS => 10,
131 DEFAULT_MAX_SIZE => 6_291_456, # 6 MiB
132 },
133 iteration => {
134 ITERATION_BFS => dualvar(1, 'bfs'),
135 ITERATION_DFS => dualvar(2, 'dfs'),
136 ITERATION_IDS => dualvar(3, 'ids'),
137 },
138 icon => {
139 __prefix => 'ICON',
140 PASSWORD => dualvar( 0, 'Password'),
141 PACKAGE_NETWORK => dualvar( 1, 'Package_Network'),
142 MESSAGEBOX_WARNING => dualvar( 2, 'MessageBox_Warning'),
143 SERVER => dualvar( 3, 'Server'),
144 KLIPPER => dualvar( 4, 'Klipper'),
145 EDU_LANGUAGES => dualvar( 5, 'Edu_Languages'),
146 KCMDF => dualvar( 6, 'KCMDF'),
147 KATE => dualvar( 7, 'Kate'),
148 SOCKET => dualvar( 8, 'Socket'),
149 IDENTITY => dualvar( 9, 'Identity'),
150 KONTACT => dualvar( 10, 'Kontact'),
151 CAMERA => dualvar( 11, 'Camera'),
152 IRKICKFLASH => dualvar( 12, 'IRKickFlash'),
153 KGPG_KEY3 => dualvar( 13, 'KGPG_Key3'),
154 LAPTOP_POWER => dualvar( 14, 'Laptop_Power'),
155 SCANNER => dualvar( 15, 'Scanner'),
156 MOZILLA_FIREBIRD => dualvar( 16, 'Mozilla_Firebird'),
157 CDROM_UNMOUNT => dualvar( 17, 'CDROM_Unmount'),
158 DISPLAY => dualvar( 18, 'Display'),
159 MAIL_GENERIC => dualvar( 19, 'Mail_Generic'),
160 MISC => dualvar( 20, 'Misc'),
161 KORGANIZER => dualvar( 21, 'KOrganizer'),
162 ASCII => dualvar( 22, 'ASCII'),
163 ICONS => dualvar( 23, 'Icons'),
164 CONNECT_ESTABLISHED => dualvar( 24, 'Connect_Established'),
165 FOLDER_MAIL => dualvar( 25, 'Folder_Mail'),
166 FILESAVE => dualvar( 26, 'FileSave'),
167 NFS_UNMOUNT => dualvar( 27, 'NFS_Unmount'),
168 MESSAGE => dualvar( 28, 'Message'),
169 KGPG_TERM => dualvar( 29, 'KGPG_Term'),
170 KONSOLE => dualvar( 30, 'Konsole'),
171 FILEPRINT => dualvar( 31, 'FilePrint'),
172 FSVIEW => dualvar( 32, 'FSView'),
173 RUN => dualvar( 33, 'Run'),
174 CONFIGURE => dualvar( 34, 'Configure'),
175 KRFB => dualvar( 35, 'KRFB'),
176 ARK => dualvar( 36, 'Ark'),
177 KPERCENTAGE => dualvar( 37, 'KPercentage'),
178 SAMBA_UNMOUNT => dualvar( 38, 'Samba_Unmount'),
179 HISTORY => dualvar( 39, 'History'),
180 MAIL_FIND => dualvar( 40, 'Mail_Find'),
181 VECTORGFX => dualvar( 41, 'VectorGfx'),
182 KCMMEMORY => dualvar( 42, 'KCMMemory'),
183 TRASHCAN_FULL => dualvar( 43, 'Trashcan_Full'),
184 KNOTES => dualvar( 44, 'KNotes'),
185 CANCEL => dualvar( 45, 'Cancel'),
186 HELP => dualvar( 46, 'Help'),
187 KPACKAGE => dualvar( 47, 'KPackage'),
188 FOLDER => dualvar( 48, 'Folder'),
189 FOLDER_BLUE_OPEN => dualvar( 49, 'Folder_Blue_Open'),
190 FOLDER_TAR => dualvar( 50, 'Folder_Tar'),
191 DECRYPTED => dualvar( 51, 'Decrypted'),
192 ENCRYPTED => dualvar( 52, 'Encrypted'),
193 APPLY => dualvar( 53, 'Apply'),
194 SIGNATURE => dualvar( 54, 'Signature'),
195 THUMBNAIL => dualvar( 55, 'Thumbnail'),
196 KADDRESSBOOK => dualvar( 56, 'KAddressBook'),
197 VIEW_TEXT => dualvar( 57, 'View_Text'),
198 KGPG => dualvar( 58, 'KGPG'),
199 PACKAGE_DEVELOPMENT => dualvar( 59, 'Package_Development'),
200 KFM_HOME => dualvar( 60, 'KFM_Home'),
201 SERVICES => dualvar( 61, 'Services'),
202 TUX => dualvar( 62, 'Tux'),
203 FEATHER => dualvar( 63, 'Feather'),
204 APPLE => dualvar( 64, 'Apple'),
205 W => dualvar( 65, 'W'),
206 MONEY => dualvar( 66, 'Money'),
207 CERTIFICATE => dualvar( 67, 'Certificate'),
208 SMARTPHONE => dualvar( 68, 'Smartphone'),
209 },
210 bool => {
211 FALSE => !1,
212 TRUE => 1,
213 },
214 time => {
215 __prefix => 'TIME',
216 SECONDS_AD1_TO_UNIX_EPOCH => 62_135_596_800,
217 },
218 yubikey => {
219 YUBICO_VID => dualvar( 0x1050, 'Yubico'),
220 YUBIKEY_PID => dualvar( 0x0010, 'YubiKey 1/2'),
221 NEO_OTP_PID => dualvar( 0x0110, 'YubiKey NEO OTP'),
222 NEO_OTP_CCID_PID => dualvar( 0x0111, 'YubiKey NEO OTP+CCID'),
223 NEO_CCID_PID => dualvar( 0x0112, 'YubiKey NEO CCID'),
224 NEO_U2F_PID => dualvar( 0x0113, 'YubiKey NEO FIDO'),
225 NEO_OTP_U2F_PID => dualvar( 0x0114, 'YubiKey NEO OTP+FIDO'),
226 NEO_U2F_CCID_PID => dualvar( 0x0115, 'YubiKey NEO FIDO+CCID'),
227 NEO_OTP_U2F_CCID_PID => dualvar( 0x0116, 'YubiKey NEO OTP+FIDO+CCID'),
228 YK4_OTP_PID => dualvar( 0x0401, 'YubiKey 4/5 OTP'),
229 YK4_U2F_PID => dualvar( 0x0402, 'YubiKey 4/5 FIDO'),
230 YK4_OTP_U2F_PID => dualvar( 0x0403, 'YubiKey 4/5 OTP+FIDO'),
231 YK4_CCID_PID => dualvar( 0x0404, 'YubiKey 4/5 CCID'),
232 YK4_OTP_CCID_PID => dualvar( 0x0405, 'YubiKey 4/5 OTP+CCID'),
233 YK4_U2F_CCID_PID => dualvar( 0x0406, 'YubiKey 4/5 FIDO+CCID'),
234 YK4_OTP_U2F_CCID_PID => dualvar( 0x0407, 'YubiKey 4/5 OTP+FIDO+CCID'),
235 PLUS_U2F_OTP_PID => dualvar( 0x0410, 'YubiKey Plus OTP+FIDO'),
236
237 ONLYKEY_VID => dualvar( 0x1d50, 'OnlyKey'),
238 ONLYKEY_PID => dualvar( 0x60fc, 'OnlyKey'),
239
240 YK_EUSBERR => dualvar( 0x01, 'USB error'),
241 YK_EWRONGSIZ => dualvar( 0x02, 'wrong size'),
242 YK_EWRITEERR => dualvar( 0x03, 'write error'),
243 YK_ETIMEOUT => dualvar( 0x04, 'timeout'),
244 YK_ENOKEY => dualvar( 0x05, 'no yubikey present'),
245 YK_EFIRMWARE => dualvar( 0x06, 'unsupported firmware version'),
246 YK_ENOMEM => dualvar( 0x07, 'out of memory'),
247 YK_ENOSTATUS => dualvar( 0x08, 'no status structure given'),
248 YK_ENOTYETIMPL => dualvar( 0x09, 'not yet implemented'),
249 YK_ECHECKSUM => dualvar( 0x0a, 'checksum mismatch'),
250 YK_EWOULDBLOCK => dualvar( 0x0b, 'operation would block'),
251 YK_EINVALIDCMD => dualvar( 0x0c, 'invalid command for operation'),
252 YK_EMORETHANONE => dualvar( 0x0d, 'expected only one YubiKey but serveral present'),
253 YK_ENODATA => dualvar( 0x0e, 'no data returned from device'),
254
255 CONFIG1_VALID => 0x01,
256 CONFIG2_VALID => 0x02,
257 CONFIG1_TOUCH => 0x04,
258 CONFIG2_TOUCH => 0x08,
259 CONFIG_LED_INV => 0x10,
260 CONFIG_STATUS_MASK => 0x1f,
261 },
262 );
263
264 our %EXPORT_TAGS;
265 my %seen;
266 no strict 'refs'; ## no critic (ProhibitNoStrict)
267 while (my ($tag, $constants) = each %CONSTANTS) {
268 my $prefix = delete $constants->{__prefix};
269 while (my ($name, $value) = each %$constants) {
270 my $val = $value;
271 $val = $val+0 if $tag eq 'icon'; # TODO
272 $name =~ s/^_+//;
273 my $full_name = $prefix ? "${prefix}_${name}" : $name;
274 die "Duplicate constant: $full_name\n" if $seen{$full_name};
275 *{$full_name} = sub() { $value };
276 push @{$EXPORT_TAGS{$tag} //= []}, $full_name;
277 $seen{$full_name}++;
278 }
279 }
280 }
281
282 our %EXPORT_TAGS;
283 push @{$EXPORT_TAGS{header}}, 'to_header_constant';
284 push @{$EXPORT_TAGS{compression}}, 'to_compression_constant';
285 push @{$EXPORT_TAGS{inner_header}}, 'to_inner_header_constant';
286 push @{$EXPORT_TAGS{icon}}, 'to_icon_constant';
287
288 $EXPORT_TAGS{all} = [map { @$_ } values %EXPORT_TAGS];
289 our @EXPORT_OK = sort @{$EXPORT_TAGS{all}};
290
291 my %HEADER;
292 for my $header (
293 HEADER_END, HEADER_COMMENT, HEADER_CIPHER_ID, HEADER_COMPRESSION_FLAGS,
294 HEADER_MASTER_SEED, HEADER_TRANSFORM_SEED, HEADER_TRANSFORM_ROUNDS,
295 HEADER_ENCRYPTION_IV, HEADER_INNER_RANDOM_STREAM_KEY, HEADER_STREAM_START_BYTES,
296 HEADER_INNER_RANDOM_STREAM_ID, HEADER_KDF_PARAMETERS, HEADER_PUBLIC_CUSTOM_DATA,
297 ) {
298 $HEADER{$header} = $HEADER{0+$header} = $header;
299 }
300 sub to_header_constant { $HEADER{$_[0] // ''} }
301
302 my %COMPRESSION;
303 for my $compression (COMPRESSION_NONE, COMPRESSION_GZIP) {
304 $COMPRESSION{$compression} = $COMPRESSION{0+$compression} = $compression;
305 }
306 sub to_compression_constant { $COMPRESSION{$_[0] // ''} }
307
308 my %INNER_HEADER;
309 for my $inner_header (
310 INNER_HEADER_END, INNER_HEADER_INNER_RANDOM_STREAM_ID,
311 INNER_HEADER_INNER_RANDOM_STREAM_KEY, INNER_HEADER_BINARY,
312 ) {
313 $INNER_HEADER{$inner_header} = $INNER_HEADER{0+$inner_header} = $inner_header;
314 }
315 sub to_inner_header_constant { $INNER_HEADER{$_[0] // ''} }
316
317 my %ICON;
318 for my $icon (
319 ICON_PASSWORD, ICON_PACKAGE_NETWORK, ICON_MESSAGEBOX_WARNING, ICON_SERVER, ICON_KLIPPER,
320 ICON_EDU_LANGUAGES, ICON_KCMDF, ICON_KATE, ICON_SOCKET, ICON_IDENTITY, ICON_KONTACT, ICON_CAMERA,
321 ICON_IRKICKFLASH, ICON_KGPG_KEY3, ICON_LAPTOP_POWER, ICON_SCANNER, ICON_MOZILLA_FIREBIRD,
322 ICON_CDROM_UNMOUNT, ICON_DISPLAY, ICON_MAIL_GENERIC, ICON_MISC, ICON_KORGANIZER, ICON_ASCII, ICON_ICONS,
323 ICON_CONNECT_ESTABLISHED, ICON_FOLDER_MAIL, ICON_FILESAVE, ICON_NFS_UNMOUNT, ICON_MESSAGE, ICON_KGPG_TERM,
324 ICON_KONSOLE, ICON_FILEPRINT, ICON_FSVIEW, ICON_RUN, ICON_CONFIGURE, ICON_KRFB, ICON_ARK,
325 ICON_KPERCENTAGE, ICON_SAMBA_UNMOUNT, ICON_HISTORY, ICON_MAIL_FIND, ICON_VECTORGFX, ICON_KCMMEMORY,
326 ICON_TRASHCAN_FULL, ICON_KNOTES, ICON_CANCEL, ICON_HELP, ICON_KPACKAGE, ICON_FOLDER,
327 ICON_FOLDER_BLUE_OPEN, ICON_FOLDER_TAR, ICON_DECRYPTED, ICON_ENCRYPTED, ICON_APPLY, ICON_SIGNATURE,
328 ICON_THUMBNAIL, ICON_KADDRESSBOOK, ICON_VIEW_TEXT, ICON_KGPG, ICON_PACKAGE_DEVELOPMENT, ICON_KFM_HOME,
329 ICON_SERVICES, ICON_TUX, ICON_FEATHER, ICON_APPLE, ICON_W, ICON_MONEY, ICON_CERTIFICATE, ICON_SMARTPHONE,
330 ) {
331 $ICON{$icon} = $ICON{0+$icon} = $icon;
332 }
333 sub to_icon_constant { $ICON{$_[0] // ''} // ICON_PASSWORD }
334
335 1;
336
337 __END__
338
339 =pod
340
341 =encoding UTF-8
342
343 =head1 NAME
344
345 File::KDBX::Constants - All the KDBX-related constants you could ever want
346
347 =head1 VERSION
348
349 version 0.900
350
351 =head1 SYNOPSIS
352
353 use File::KDBX::Constants qw(:all);
354
355 say KDBX_VERSION_4_1;
356
357 =head1 DESCRIPTION
358
359 This module provides importable constants related to KDBX. Constants can be imported individually or in groups
360 (by tag). The available tags are:
361
362 =over 4
363
364 =item *
365
366 L</:magic>
367
368 =item *
369
370 L</:version>
371
372 =item *
373
374 L</:header>
375
376 =item *
377
378 L</:compression>
379
380 =item *
381
382 L</:cipher>
383
384 =item *
385
386 L</:random_stream>
387
388 =item *
389
390 L</:kdf>
391
392 =item *
393
394 L</:variant_map>
395
396 =item *
397
398 L</:inner_header>
399
400 =item *
401
402 L</:key_file>
403
404 =item *
405
406 L</:history>
407
408 =item *
409
410 L</:icon>
411
412 =item *
413
414 L</:bool>
415
416 =item *
417
418 L</:time>
419
420 =item *
421
422 L</:yubikey>
423
424 =item *
425
426 C<:all> - All of the above
427
428 =back
429
430 View the source of this module to see the constant values (but really you shouldn't care).
431
432 =head1 FUNCTIONS
433
434 =head2 to_header_constant
435
436 $constant = to_header_constant($number);
437 $constant = to_header_constant($string);
438
439 Get a header constant from an integer or string value.
440
441 =head2 to_compression_constant
442
443 $constant = to_compression_constant($number);
444 $constant = to_compression_constant($string);
445
446 Get a compression constant from an integer or string value.
447
448 =head2 to_inner_header_constant
449
450 $constant = to_inner_header_constant($number);
451 $constant = to_inner_header_constant($string);
452
453 Get an inner header constant from an integer or string value.
454
455 =head2 to_icon_constant
456
457 $constant = to_icon_constant($number);
458 $constant = to_icon_constant($string);
459
460 Get an icon constant from an integer or string value.
461
462 =head1 CONSTANTS
463
464 =head2 :magic
465
466 Constants related to identifying the file types:
467
468 =over 4
469
470 =item C<KDBX_SIG1>
471
472 =item C<KDBX_SIG1_FIRST_BYTE>
473
474 =item C<KDBX_SIG2_1>
475
476 =item C<KDBX_SIG2_2>
477
478 =back
479
480 =head2 :version
481
482 Constants related to identifying the format version of a file:
483
484 =over 4
485
486 =item C<KDBX_VERSION_2_0>
487
488 =item C<KDBX_VERSION_3_0>
489
490 =item C<KDBX_VERSION_3_1>
491
492 =item C<KDBX_VERSION_4_0>
493
494 =item C<KDBX_VERSION_4_1>
495
496 =item C<KDBX_VERSION_OLDEST>
497
498 =item C<KDBX_VERSION_LATEST>
499
500 =item C<KDBX_VERSION_MAJOR_MASK>
501
502 =item C<KDBX_VERSION_MINOR_MASK>
503
504 =back
505
506 =head2 :header
507
508 Constants related to parsing and generating KDBX file headers:
509
510 =over 4
511
512 =item C<HEADER_END>
513
514 =item C<HEADER_COMMENT>
515
516 =item C<HEADER_CIPHER_ID>
517
518 =item C<HEADER_COMPRESSION_FLAGS>
519
520 =item C<HEADER_MASTER_SEED>
521
522 =item C<HEADER_TRANSFORM_SEED>
523
524 =item C<HEADER_TRANSFORM_ROUNDS>
525
526 =item C<HEADER_ENCRYPTION_IV>
527
528 =item C<HEADER_INNER_RANDOM_STREAM_KEY>
529
530 =item C<HEADER_STREAM_START_BYTES>
531
532 =item C<HEADER_INNER_RANDOM_STREAM_ID>
533
534 =item C<HEADER_KDF_PARAMETERS>
535
536 =item C<HEADER_PUBLIC_CUSTOM_DATA>
537
538 =back
539
540 =head2 :compression
541
542 Constants related to identifying the compression state of a file:
543
544 =over 4
545
546 =item C<COMPRESSION_NONE>
547
548 =item C<COMPRESSION_GZIP>
549
550 =back
551
552 =head2 :cipher
553
554 Constants related ciphers:
555
556 =over 4
557
558 =item C<CIPHER_UUID_AES128>
559
560 =item C<CIPHER_UUID_AES256>
561
562 =item C<CIPHER_UUID_CHACHA20>
563
564 =item C<CIPHER_UUID_SALSA20>
565
566 =item C<CIPHER_UUID_SERPENT>
567
568 =item C<CIPHER_UUID_TWOFISH>
569
570 =back
571
572 =head2 :random_stream
573
574 Constants related to memory protection stream ciphers:
575
576 =over 4
577
578 =item C<STREAM_ID_RC4_VARIANT>
579
580 This is insecure and not implemented.
581
582 =item C<STREAM_ID_SALSA20>
583
584 =item C<STREAM_ID_CHACHA20>
585
586 =item C<STREAM_SALSA20_IV>
587
588 =back
589
590 =head2 :kdf
591
592 Constants related to key derivation functions and configuration:
593
594 =over 4
595
596 =item C<KDF_UUID_AES>
597
598 =item C<KDF_UUID_AES_CHALLENGE_RESPONSE>
599
600 This is what KeePassXC calls C<KDF_AES_KDBX4>.
601
602 =item C<KDF_UUID_ARGON2D>
603
604 =item C<KDF_UUID_ARGON2ID>
605
606 =item C<KDF_PARAM_UUID>
607
608 =item C<KDF_PARAM_AES_ROUNDS>
609
610 =item C<KDF_PARAM_AES_SEED>
611
612 =item C<KDF_PARAM_ARGON2_SALT>
613
614 =item C<KDF_PARAM_ARGON2_PARALLELISM>
615
616 =item C<KDF_PARAM_ARGON2_MEMORY>
617
618 =item C<KDF_PARAM_ARGON2_ITERATIONS>
619
620 =item C<KDF_PARAM_ARGON2_VERSION>
621
622 =item C<KDF_PARAM_ARGON2_SECRET>
623
624 =item C<KDF_PARAM_ARGON2_ASSOCDATA>
625
626 =item C<KDF_DEFAULT_AES_ROUNDS>
627
628 =item C<KDF_DEFAULT_ARGON2_ITERATIONS>
629
630 =item C<KDF_DEFAULT_ARGON2_MEMORY>
631
632 =item C<KDF_DEFAULT_ARGON2_PARALLELISM>
633
634 =item C<KDF_DEFAULT_ARGON2_VERSION>
635
636 =back
637
638 =head2 :variant_map
639
640 Constants related to parsing and generating KDBX4 variant maps:
641
642 =over 4
643
644 =item C<VMAP_VERSION>
645
646 =item C<VMAP_VERSION_MAJOR_MASK>
647
648 =item C<VMAP_TYPE_END>
649
650 =item C<VMAP_TYPE_UINT32>
651
652 =item C<VMAP_TYPE_UINT64>
653
654 =item C<VMAP_TYPE_BOOL>
655
656 =item C<VMAP_TYPE_INT32>
657
658 =item C<VMAP_TYPE_INT64>
659
660 =item C<VMAP_TYPE_STRING>
661
662 =item C<VMAP_TYPE_BYTEARRAY>
663
664 =back
665
666 =head2 :inner_header
667
668 Constants related to parsing and generating KDBX4 inner headers:
669
670 =over 4
671
672 =item C<INNER_HEADER_END>
673
674 =item C<INNER_HEADER_INNER_RANDOM_STREAM_ID>
675
676 =item C<INNER_HEADER_INNER_RANDOM_STREAM_KEY>
677
678 =item C<INNER_HEADER_BINARY>
679
680 =item C<INNER_HEADER_BINARY_FLAG_PROTECT>
681
682 =back
683
684 =head2 :key_file
685
686 Constants related to identifying key file types:
687
688 =over 4
689
690 =item C<KEY_FILE_TYPE_BINARY>
691
692 =item C<KEY_FILE_TYPE_HASHED>
693
694 =item C<KEY_FILE_TYPE_HEX>
695
696 =item C<KEY_FILE_TYPE_XML>
697
698 =back
699
700 =head2 :history
701
702 Constants for history-related default values:
703
704 =over 4
705
706 =item C<HISTORY_DEFAULT_MAX_AGE>
707
708 =item C<HISTORY_DEFAULT_MAX_ITEMS>
709
710 =item C<HISTORY_DEFAULT_MAX_SIZE>
711
712 =back
713
714 =head2 :iteration
715
716 Constants for searching algorithms.
717
718 =over 4
719
720 =item C<ITERATION_IDS> - Iterative deepening search
721
722 =item C<ITERATION_BFS> - Breadth-first search
723
724 =item C<ITERATION_DFS> - Depth-first search
725
726 =back
727
728 =head2 :icon
729
730 Constants for default icons used by KeePass password safe implementations:
731
732 =over 4
733
734 =item C<ICON_PASSWORD>
735
736 =item C<ICON_PACKAGE_NETWORK>
737
738 =item C<ICON_MESSAGEBOX_WARNING>
739
740 =item C<ICON_SERVER>
741
742 =item C<ICON_KLIPPER>
743
744 =item C<ICON_EDU_LANGUAGES>
745
746 =item C<ICON_KCMDF>
747
748 =item C<ICON_KATE>
749
750 =item C<ICON_SOCKET>
751
752 =item C<ICON_IDENTITY>
753
754 =item C<ICON_KONTACT>
755
756 =item C<ICON_CAMERA>
757
758 =item C<ICON_IRKICKFLASH>
759
760 =item C<ICON_KGPG_KEY3>
761
762 =item C<ICON_LAPTOP_POWER>
763
764 =item C<ICON_SCANNER>
765
766 =item C<ICON_MOZILLA_FIREBIRD>
767
768 =item C<ICON_CDROM_UNMOUNT>
769
770 =item C<ICON_DISPLAY>
771
772 =item C<ICON_MAIL_GENERIC>
773
774 =item C<ICON_MISC>
775
776 =item C<ICON_KORGANIZER>
777
778 =item C<ICON_ASCII>
779
780 =item C<ICON_ICONS>
781
782 =item C<ICON_CONNECT_ESTABLISHED>
783
784 =item C<ICON_FOLDER_MAIL>
785
786 =item C<ICON_FILESAVE>
787
788 =item C<ICON_NFS_UNMOUNT>
789
790 =item C<ICON_MESSAGE>
791
792 =item C<ICON_KGPG_TERM>
793
794 =item C<ICON_KONSOLE>
795
796 =item C<ICON_FILEPRINT>
797
798 =item C<ICON_FSVIEW>
799
800 =item C<ICON_RUN>
801
802 =item C<ICON_CONFIGURE>
803
804 =item C<ICON_KRFB>
805
806 =item C<ICON_ARK>
807
808 =item C<ICON_KPERCENTAGE>
809
810 =item C<ICON_SAMBA_UNMOUNT>
811
812 =item C<ICON_HISTORY>
813
814 =item C<ICON_MAIL_FIND>
815
816 =item C<ICON_VECTORGFX>
817
818 =item C<ICON_KCMMEMORY>
819
820 =item C<ICON_TRASHCAN_FULL>
821
822 =item C<ICON_KNOTES>
823
824 =item C<ICON_CANCEL>
825
826 =item C<ICON_HELP>
827
828 =item C<ICON_KPACKAGE>
829
830 =item C<ICON_FOLDER>
831
832 =item C<ICON_FOLDER_BLUE_OPEN>
833
834 =item C<ICON_FOLDER_TAR>
835
836 =item C<ICON_DECRYPTED>
837
838 =item C<ICON_ENCRYPTED>
839
840 =item C<ICON_APPLY>
841
842 =item C<ICON_SIGNATURE>
843
844 =item C<ICON_THUMBNAIL>
845
846 =item C<ICON_KADDRESSBOOK>
847
848 =item C<ICON_VIEW_TEXT>
849
850 =item C<ICON_KGPG>
851
852 =item C<ICON_PACKAGE_DEVELOPMENT>
853
854 =item C<ICON_KFM_HOME>
855
856 =item C<ICON_SERVICES>
857
858 =item C<ICON_TUX>
859
860 =item C<ICON_FEATHER>
861
862 =item C<ICON_APPLE>
863
864 =item C<ICON_W>
865
866 =item C<ICON_MONEY>
867
868 =item C<ICON_CERTIFICATE>
869
870 =item C<ICON_SMARTPHONE>
871
872 =back
873
874 =head2 :bool
875
876 Boolean values:
877
878 =over 4
879
880 =item C<FALSE>
881
882 =item C<TRUE>
883
884 =back
885
886 =head2 :time
887
888 Constants related to time:
889
890 =over 4
891
892 =item C<TIME_SECONDS_AD1_TO_UNIX_EPOCH>
893
894 =back
895
896 =head2 :yubikey
897
898 Constants related to working with YubiKeys:
899
900 =over 4
901
902 =item C<YUBICO_VID>
903
904 =item C<YUBIKEY_PID>
905
906 =item C<NEO_OTP_PID>
907
908 =item C<NEO_OTP_CCID_PID>
909
910 =item C<NEO_CCID_PID>
911
912 =item C<NEO_U2F_PID>
913
914 =item C<NEO_OTP_U2F_PID>
915
916 =item C<NEO_U2F_CCID_PID>
917
918 =item C<NEO_OTP_U2F_CCID_PID>
919
920 =item C<YK4_OTP_PID>
921
922 =item C<YK4_U2F_PID>
923
924 =item C<YK4_OTP_U2F_PID>
925
926 =item C<YK4_CCID_PID>
927
928 =item C<YK4_OTP_CCID_PID>
929
930 =item C<YK4_U2F_CCID_PID>
931
932 =item C<YK4_OTP_U2F_CCID_PID>
933
934 =item C<PLUS_U2F_OTP_PID>
935
936 =item C<ONLYKEY_VID>
937
938 =item C<ONLYKEY_PID>
939
940 =item C<YK_EUSBERR>
941
942 =item C<YK_EWRONGSIZ>
943
944 =item C<YK_EWRITEERR>
945
946 =item C<YK_ETIMEOUT>
947
948 =item C<YK_ENOKEY>
949
950 =item C<YK_EFIRMWARE>
951
952 =item C<YK_ENOMEM>
953
954 =item C<YK_ENOSTATUS>
955
956 =item C<YK_ENOTYETIMPL>
957
958 =item C<YK_ECHECKSUM>
959
960 =item C<YK_EWOULDBLOCK>
961
962 =item C<YK_EINVALIDCMD>
963
964 =item C<YK_EMORETHANONE>
965
966 =item C<YK_ENODATA>
967
968 =item C<CONFIG1_VALID>
969
970 =item C<CONFIG2_VALID>
971
972 =item C<CONFIG1_TOUCH>
973
974 =item C<CONFIG2_TOUCH>
975
976 =item C<CONFIG_LED_INV>
977
978 =item C<CONFIG_STATUS_MASK>
979
980 =back
981
982 =head1 BUGS
983
984 Please report any bugs or feature requests on the bugtracker website
985 L<https://github.com/chazmcgarvey/File-KDBX/issues>
986
987 When submitting a bug or request, please include a test-file or a
988 patch to an existing test-file that illustrates the bug or desired
989 feature.
990
991 =head1 AUTHOR
992
993 Charles McGarvey <ccm@cpan.org>
994
995 =head1 COPYRIGHT AND LICENSE
996
997 This software is copyright (c) 2022 by Charles McGarvey.
998
999 This is free software; you can redistribute it and/or modify it under
1000 the same terms as the Perl 5 programming language system itself.
1001
1002 =cut
This page took 0.096962 seconds and 4 git commands to generate.