Click here to Skip to main content
15,879,348 members
Articles / Programming Languages / C#

Password Safe Database Reader Library in C# for .NET

Rate me:
Please Sign up or sign in to vote.
4.57/5 (8 votes)
16 Oct 2007GPL32 min read 60.6K   918   29  
An independent library implementation to read Password Safe Password Manager V3 database files
#region License
/*
 *  PasswordSafe Database Reader/Writer
 *
 *  Copyright (C) 2007 Svante Seleborg
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * 
 *  If you'd like to license this program under any other terms than the
 *  above, please contact the author and copyright holder.
 *
 *  Contact: mailto:svante@axantum.com
 */
#endregion

using System;

namespace Axantum.PasswordSafe
{
    /// <summary>
    /// The field types in a database record
    /// </summary>
    internal enum PasswordSafeRecordTypeCode
    {
        /// <summary>
        /// The first code
        /// </summary>
        START = 0x00,
        /// <summary>
        /// The name of entry
        /// </summary>
        NAME = 0x00,
        /// <summary>
        /// The Guid of the entry - used for sync
        /// </summary>
        UUID = 0x01,
        /// <summary>
        /// The Group
        /// </summary>
        GROUP = 0x02,
        /// <summary>
        /// The title
        /// </summary>
        TITLE = 0x03,
        /// <summary>
        /// The username associated with the entry
        /// </summary>
        USER = 0x04,
        /// <summary>
        /// The notes associated with the entry
        /// </summary>
        NOTES = 0x05,
        /// <summary>
        /// The current password associated with the entry
        /// </summary>
        PASSWORD = 0x06,
        /// <summary>
        /// The time this entry was created
        /// </summary>
        CTIME = 0x07,
        /// <summary>
        /// The time the password was last modified
        /// </summary>
        PMTIME = 0x08,
        /// <summary>
        /// The time the entry was last accessed
        /// </summary>
        ATIME = 0x09,
        /// <summary>
        /// The time the password expires
        /// </summary>
        LTIME = 0x0a,
        /// <summary>
        /// Not implemented
        /// </summary>
        POLICY = 0x0b,
        /// <summary>
        /// The time the record itself was last modified
        /// </summary>
        RMTIME = 0x0c,
        /// <summary>
        /// The URL associated with the entry
        /// </summary>
        URL = 0x0d,
        /// <summary>
        /// An autotype string - be careful here...
        /// </summary>
        AUTOTYPE = 0x0e,
        /// <summary>
        /// A string encoded history of passwords
        /// </summary>
        PWHIST = 0x0f,
        /// <summary>
        /// The last valid code marker
        /// </summary>
        LAST,
        /// <summary>
        /// The end of fields marker
        /// </summary>
        END = 0xff
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Web Developer Axantum Software AB
Sweden Sweden
I've been working with all aspects of software development since 1979 - from compiler construction to management. Currently I'm an independent consultant mostly specializing in computer security. Please see my homepage for contact details.

I speak C like a native, and have a pretty good grasp of C++. The most recent five years C# has been the main development language. Traditionally Unix has been the dominating environment, but currently the scales have tipped over to Windows, due to market demands but I'm equally at home developing in both environments.

When I'm not coding I'm usually sitting on one of my 4 bikes, indoors or outdoors, on the road or in the woods.

Comments and Discussions