The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

App::Raps2 - A Password safe

SYNOPSIS

    use App::Raps2;

    my $raps2 = App::Raps2->new();

DESCRIPTION

App::Raps2 is the backend for raps2, a simple commandline password safe.

VERSION

This manual documents App::Raps2 version 0.50

METHODS

$raps2 = App::Raps2->new( %conf )

Returns a new App::Raps2 object.

Accepted configuration parameters are:

cost => int

cost of key setup, passed on to App::Raps2::Password(3pm).

no_cli => bool

If set to true, App::Raps2 assumes it will not be used as a CLI. It won't initialize its Term::ReadLine object and won't try to read anything from the terminal.

$raps2->get_master_password( [$password] )

Sets the master password used to encrypt all accounts. Uses password if specified, otherwise it asks the user via App::Raps2::UI(3pm).

$raps2->pw_load( file => file | name => name )

Load a password from file (or account name), requires get_master_password to have been called before.

Returns a hashref containing its url, login, salt and decrypted password and extra.

$raps2->pw_load_info( file => file | name => name )

Load all unencrypted data from file (or account name). Unlike pw_load, this method does not require a prior call to get_master_password.

Returns a hashref with url, login and salt.

$raps2->pw_save( %data )

Write an account as specified by data to the store. Requires get_master_password to have been called before.

The following data keys are supported:

password => password to encrypt (mandatory)
salt => salt
file => file | name => name (one must be set)
url => url (optional)
login => login (optional)
extra => extra (optiona)
$raps2->ui()

Returns the App::Raps2::UI(3pm) object.

INTERNAL

You usually don't need to call these methods by yourself.

$raps2->create_config()

Creates a default config and asks the user to set a master password.

$raps2->load_config()

Load config. Automatically called by new.

$raps2->pw()

Returns the App::Raps2::Password(3pm) object.

$raps2->file_to_hash( $file )

Reads $file (lines with key/value separated by whitespace) and returns a hashref with its key/value pairs.

$raps2->sanity_check()

Create working directories (~/.config/raps2 and ~/.local/share/raps2, or the respective XDG environment variable contents), if they don't exist yet. Automatically called by new.

Calls create_config if no raps2 config was found.

DIAGNOSTICS

If anything goes wrong, App::Raps2 will die with a backtrace (using confess from Carp(3pm)).

DEPENDENCIES

App::Raps2::Password(3pm), App::Raps2::UI(3pm), File::BaseDir(3pm), File::Slurp(3pm).

BUGS AND LIMITATIONS

Be aware that the password handling API is not yet stable.

AUTHOR

Copyright (C) 2011 by Daniel Friesel <derf@finalrewind.org>

LICENSE

  0. You just DO WHAT THE FUCK YOU WANT TO.