Crypt::PWSafe3::Record(3)

NAME
Crypt::PWSafe3::Record - Represents a Passwordsafe v3 data record

SYNOPSIS
 use Crypt::PWSafe3;
 my $record = $vault->getrecord($uuid);
 $record->title('t2');
 $record->passwd('foobar');
 print $record->notes;

DESCRIPTION
Crypt::PWSafe3::Record represents a Passwordsafe v3 data record. Each record consists of a number of fields of type Crypt::PWSafe3::Field. The class provides get/set methods to access the values of those fields.

It is also possible to access the raw unencoded values of the fields by accessing them directly, refer to Crypt::PWSafe3::Field for more details on this.

If the record object has been created by Crypt::PWSafe3 (and fetched with Crypt::PWSafe3::getrecord), then it's still associated with the Crypt::PWSafe3 parent object. Changes to the record will therefore automatically populated back into the parent object (the vault). This is not the case if you created the record object yourself.

METHODS

  uuid([string])
Returns the UUID without argument. Sets the UUID if an argument is given. Must be a hex representation of an Data::UUID object.

This will be generated automatically for new records, so you normally don't have to cope with.

  user([string])
Returns the username without argument. Sets the username if an argument is given.

  title([string])
Returns the title without argument. Sets the title if an argument is given.

  passwd([string])
Returns the password without argument. Sets the password if an argument is given.

  notes([string])
Returns the notes without argument. Sets the notes if an argument is given.

  group([string])
Returns the group without argument. Sets the group if an argument is given.

Group hierarchy can be done by separating subgroups by dot, eg:

 $record->group('accounts.banking');

  ctime([time_t])
Returns the creation time without argument. Sets the creation time if an argument is given. Argument must be an integer timestamp as returned by time().

This will be generated automatically for new records, so you normally don't have to cope with.

  atime([time_t])
Returns the access time without argument. Sets the access time if an argument is given. Argument must be an integer timestamp as returned by time().

Crypt::PWSafe3 doesn't update the atime field currently. So if you mind, do it yourself.

  mtime([time_t])
Returns the modification time of the passwd field without argument. Sets the modification time if an argument is given. Argument must be an integer timestamp as returned by time().

This will be generated automatically for modified records if the passwd field changed, so you normally don't have to cope with.

  lastmod([string])
Returns the modification time without argument. Sets the modification time if an argument is given. Argument must be an integer timestamp as returned by time().

This will be generated automatically for modified records, so you normally don't have to cope with.

  url([string])
Returns the url without argument. Sets the url if an argument is given. The url must be in the well known notation as:

 proto://host/path

  pwhist([string])
Returns the password history without argument. Sets the password history if an argument is given.

Crypt::PWSafe3 doesn't update the pwhist field currently. So if you mind, do it yourself. Refer to Crypt::PWSafe3::Databaseformat for more details.

  pwpol([string])
Returns the password policy without argument. Sets the password policy if an argument is given.

This is the raw encoded policy string. If you want to access it, use the policy() method, see below.

  policy([Crypt::PWSafe3::PasswordPolicy object])
If called without arguments, returns a Crypt::PWSafe3::PasswordPolicy object. See Crypt::PWSafe3::PasswordPolicy for details, how to access it.

To modify the password policy, create new Crypt::PWSafe3::PasswordPolicy object or modify the existing one and pass it as argument to the policy method.

  pwexp([string])
Returns the password expire time without argument. Sets the password expire time if an argument is given.

Crypt::PWSafe3 doesn't update the pwexp field currently. So if you mind, do it yourself. Refer to Crypt::PWSafe3::Databaseformat for more details.

MANDATORY FIELDS
Crypt::PWSafe3::Record creates the following fields automatically on creation, because those fields are mandatory:

uuid will be generated using Data::UUID.

user, password, title will be set to the empty string.

ctime, atime, mtime, lastmod will be set to current time of creation time.

SEE ALSO
Crypt::PWSafe3

AUTHOR
T.v.Dein <tlinden@cpan.org>

COPYRIGHT
Copyright (c) 2011-2015 by T.v.Dein <tlinden@cpan.org>. All rights reserved.

LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms of the Artistic License 2.0, see: <http://www.perlfoundation.org/artistic_license_2_0>