Index: /applications/editors/josm/plugins/native-password-manager/LICENSE
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/LICENSE	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/LICENSE	(revision 26335)
@@ -0,0 +1,6 @@
+
+The source files in src/org/netbeans have headers indicating their license.
+
+The code in src/org/openstreetmap is released under the GNU General 
+Public License v2 or later.
+
Index: /applications/editors/josm/plugins/native-password-manager/README
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/README	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/README	(revision 26335)
@@ -0,0 +1,27 @@
+
+Native Password Manager Plugin
+==============================
+
+Prevents JOSM from saving passwords as plain text to the JOSM preferences file. Instead, uses a password manager to store the data in encrypted form.
+Supported password managers are gnome-keyring and KWallet. Apple Keychain and Windows data encryption may work, but are untested so far.
+
+The following preference keys are managed:
+    osm-server.username         // API login username
+    osm-server.password         // API login password
+    proxy.user                  // Proxy username
+    proxy.pass                  // Proxy password
+    oauth.access-token.key      // OAuth key
+    oauth.access-token.secret   // OAuth secret
+
+The keyring code from the Netbeans project is used to access the individual Password Managers. It is slightly patched, to remove Netbeans
+specific dependencies. 
+
+Original code:
+    http://hg.netbeans.org/main/file/524f40b94a30/keyring.impl  and
+    http://hg.netbeans.org/main/file/524f40b94a30/keyring
+Patch:
+    netbeans-keyring-patches.diff
+
+We use the GPL-v2-"classpath exception" License of Netbeans, which allows linking against code of other licenses.
+
+Author: Paul Hartmann <phaaurlt@googlemail.com>
Index: /applications/editors/josm/plugins/native-password-manager/build.xml
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/build.xml	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/build.xml	(revision 26335)
@@ -0,0 +1,262 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+** This is a template build file for a JOSM  plugin.
+**
+** Maintaining versions
+** ====================
+** see README.template
+**
+** Usage
+** =====
+** To build it run
+**
+**    > ant  dist
+**
+** To install the generated plugin locally (in you default plugin directory) run
+**
+**    > ant  install
+**
+** The generated plugin jar is not automatically available in JOSMs plugin configuration
+** dialog. You have to check it in first.
+**
+** Use the ant target 'publish' to check in the plugin and make it available to other
+** JOSM users:
+**    set the properties commit.message and plugin.main.version
+** and run
+**    > ant  publish
+**
+**
+-->
+<project name="native_password_manager" default="dist" basedir=".">
+
+    <!-- enter the SVN commit message -->
+    <property name="commit.message" value="Commit message" />
+    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
+    <property name="plugin.main.version" value="4249" />
+
+
+    <!--
+      ************************************************
+      ** should not be necessary to change the following properties
+     -->
+    <property name="josm"                   location="../../core/dist/josm-custom.jar"/>
+    <property name="plugin.build.dir"       value="build"/>
+    <property name="plugin.src.dir"         value="src"/>
+    <property name="plugin.lib.dir"         value="lib"/>
+    <!-- this is the directory where the plugin jar is copied to -->
+    <property name="plugin.dist.dir"        value="../../dist"/>
+    <property name="ant.build.javac.target" value="1.5"/>
+    <property name="plugin.jar"             value="${plugin.dist.dir}/${ant.project.name}.jar"/>
+
+	<!-- classpath -->
+	<path id="classpath">
+		<fileset dir="${plugin.lib.dir}" includes="**/*.jar" />
+		<pathelement path="${josm}"/>
+	</path>
+
+    <!--
+    **********************************************************
+    ** init - initializes the build
+    **********************************************************
+    -->
+    <target name="init">
+        <mkdir dir="${plugin.build.dir}"/>
+    </target>
+
+    <!--
+    **********************************************************
+    ** compile - complies the source tree
+    **********************************************************
+    -->
+    <target name="compile" depends="init">
+        <echo message="compiling sources for  ${plugin.jar} ... "/>
+        <javac srcdir="src" classpathref="classpath" debug="true" destdir="${plugin.build.dir}">
+            <compilerarg value="-Xlint:deprecation"/>
+            <compilerarg value="-Xlint:unchecked"/>
+        </javac>
+    </target>
+
+    <!--
+    **********************************************************
+    ** dist - creates the plugin jar
+    **********************************************************
+    -->
+    <target name="dist" depends="compile,revision">
+        <echo message="creating ${ant.project.name}.jar ... "/>
+        <copy todir="${plugin.build.dir}/images">
+            <fileset dir="images"/>
+        </copy>
+        <copy todir="${plugin.build.dir}">
+            <fileset dir=".">
+                <include name="README" />
+                <include name="LICENSE" />
+            </fileset>
+        </copy>
+        <jar destfile="${plugin.jar}" basedir="${plugin.build.dir}">
+            <!--
+        ************************************************
+        ** configure these properties. Most of them will be copied to the plugins
+        ** manifest file. Property values will also show up in the list available
+        ** plugins: http://josm.openstreetmap.de/wiki/Plugins.
+        **
+        ************************************************
+    -->
+            <manifest>
+                <attribute name="Author" value="Paul Hartmann"/>
+                <attribute name="Plugin-Class" value="org.openstreetmap.josm.plugins.npm.NPMPlugin"/>
+                <attribute name="Main-Class" value="org.openstreetmap.josm.plugins.npm.NPMPlugin"/>
+                <attribute name="Plugin-Date" value="${version.entry.commit.date}"/>
+                <attribute name="Plugin-Description" value="Use your system''s password manager to store the API username and password. (KWallet and gnome-keyring are supported.)"/>
+                <attribute name="Plugin-Icon" value="images/lock24x24.png"/>
+                <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/wiki/JOSM/Plugins/Native_Password_Manager"/>
+                <attribute name="Plugin-Mainversion" value="${plugin.main.version}"/>
+                <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
+            </manifest>
+			<zipfileset src="${plugin.lib.dir}/jna.jar" />
+        </jar>
+    </target>
+
+    <!--
+    **********************************************************
+    ** revision - extracts the current revision number for the
+    **    file build.number and stores it in the XML property
+    **    version.*
+    **********************************************************
+    -->
+    <target name="revision">
+
+        <exec append="false" output="REVISION" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="info"/>
+            <arg value="--xml"/>
+            <arg value="."/>
+        </exec>
+        <xmlproperty file="REVISION" prefix="version" keepRoot="false" collapseAttributes="true"/>
+        <delete file="REVISION"/>
+    </target>
+
+    <!--
+    **********************************************************
+    ** clean - clean up the build environment
+    **********************************************************
+    -->
+    <target name="clean">
+        <delete dir="${plugin.build.dir}"/>
+        <delete file="${plugin.jar}"/>
+    </target>
+
+    <!--
+    **********************************************************
+    ** install - install the plugin in your local JOSM installation
+    **********************************************************
+    -->
+    <target name="install" depends="dist">
+        <property environment="env"/>
+        <condition property="josm.plugins.dir" value="${env.APPDATA}/JOSM/plugins" else="${user.home}/.josm/plugins">
+            <and>
+                <os family="windows"/>
+            </and>
+        </condition>
+        <copy file="${plugin.jar}" todir="${josm.plugins.dir}"/>
+    </target>
+
+
+    <!--
+    ************************** Publishing the plugin *********************************** 
+    -->
+    <!--
+        ** extracts the JOSM release for the JOSM version in ../core and saves it in the 
+        ** property ${coreversion.info.entry.revision}
+        **
+        -->
+    <target name="core-info">
+        <exec append="false" output="core.info.xml" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="info"/>
+            <arg value="--xml"/>
+            <arg value="../../core"/>
+        </exec>
+        <xmlproperty file="core.info.xml" prefix="coreversion" keepRoot="true" collapseAttributes="true"/>
+        <echo>Building against core revision ${coreversion.info.entry.revision}.</echo>
+        <echo>Plugin-Mainversion is set to ${plugin.main.version}.</echo>
+        <delete file="core.info.xml" />
+    </target>
+
+    <!--
+        ** commits the source tree for this plugin
+        -->
+    <target name="commit-current">
+        <echo>Commiting the plugin source with message '${commit.message}' ...</echo>
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="commit"/>
+            <arg value="-m '${commit.message}'"/>
+            <arg value="."/>
+        </exec>
+    </target>
+
+    <!--
+        ** updates (svn up) the source tree for this plugin
+        -->
+    <target name="update-current">
+        <echo>Updating plugin source ...</echo>
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="up"/>
+            <arg value="."/>
+        </exec>
+        <echo>Updating ${plugin.jar} ...</echo>
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="up"/>
+            <arg value="../dist/${plugin.jar}"/>
+        </exec>
+    </target>
+
+    <!--
+        ** commits the plugin.jar 
+        -->
+    <target name="commit-dist">
+        <echo>
+    ***** Properties of published ${plugin.jar} *****
+    Commit message    : '${commit.message}'                    
+    Plugin-Mainversion: ${plugin.main.version}
+    JOSM build version: ${coreversion.info.entry.revision}
+    Plugin-Version    : ${version.entry.commit.revision}
+    ***** / Properties of published ${plugin.jar} *****                    
+                        
+    Now commiting ${plugin.jar} ...
+    </echo>
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false">
+            <env key="LANG" value="C"/>
+            <arg value="-m '${commit.message}'"/>
+            <arg value="commit"/>
+            <arg value="${plugin.jar}"/>
+        </exec>
+    </target>
+
+    <!-- ** make sure svn is present as a command line tool ** -->
+    <target name="ensure-svn-present">
+        <exec append="true" output="svn.log" executable="svn" failifexecutionfails="false" failonerror="false" resultproperty="svn.exit.code">
+            <env key="LANG" value="C" />
+            <arg value="--version" />
+        </exec>
+        <fail message="Fatal: command 'svn --version' failed. Please make sure svn is installed on your system.">
+            <!-- return code not set at all? Most likely svn isn't installed -->
+            <condition>
+                <not>
+                    <isset property="svn.exit.code" />
+                </not>
+            </condition>
+        </fail>
+        <fail message="Fatal: command 'svn --version' failed. Please make sure a working copy of svn is installed on your system.">
+            <!-- error code from SVN? Most likely svn is not what we are looking on this system -->
+            <condition>
+                <isfailure code="${svn.exit.code}" />
+            </condition>
+        </fail>
+    </target>
+
+    <target name="publish" depends="ensure-svn-present,core-info,commit-current,update-current,clean,dist,commit-dist">
+    </target>
+</project>
Index: /applications/editors/josm/plugins/native-password-manager/gpl-2-cp.txt
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/gpl-2-cp.txt	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/gpl-2-cp.txt	(revision 26335)
@@ -0,0 +1,425 @@
+The GNU General Public License (GPL)
+Version 2, June 1991
+
+ Copyright 1989, 1991 Free Software Foundation, Inc.
+ 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim
+ copies of this license document, but changing it is not
+ allowed.
+
+                      Preamble
+
+The licenses for most software are designed to take away
+your freedom to share and change it. By contrast, the GNU
+General Public License is intended to guarantee your freedom
+to share and change free software--to make sure the software
+is free for all its users. This General Public License
+applies to most of the Free Software Foundation's software
+and to any other program whose authors commit to using it.
+(Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can
+apply it to your programs, too.
+
+When we speak of free software, we are referring to freedom,
+not price. Our General Public Licenses are designed to make
+sure that you have the freedom to distribute copies of free
+software (and charge for this service if you wish), that you
+receive source code or can get it if you want it, that you
+can change the software or use pieces of it in new free
+programs; and that you know you can do these things.
+
+To protect your rights, we need to make restrictions that
+forbid anyone to deny you these rights or to ask you to
+surrender the rights. These restrictions translate to
+certain responsibilities for you if you distribute copies of
+the software, or if you modify it.
+
+For example, if you distribute copies of such a program,
+whether gratis or for a fee, you must give the recipients
+all the rights that you have. You must make sure that they,
+too, receive or can get the source code. And you must show
+them these terms so they know their rights.
+
+We protect your rights with two steps: (1) copyright the
+software, and (2) offer you this license which gives you
+legal permission to copy, distribute and/or modify the
+software.
+
+Also, for each author's protection and ours, we want to make
+certain that everyone understands that there is no warranty
+for this free software. If the software is modified by
+someone else and passed on, we want its recipients to know
+that what they have is not the original, so that any
+problems introduced by others will not reflect on the
+original authors' reputations.
+
+Finally, any free program is threatened constantly by
+software patents. We wish to avoid the danger that
+redistributors of a free program will individually obtain
+patent licenses, in effect making the program proprietary.
+To prevent this, we have made it clear that any patent must
+be licensed for everyone's free use or not licensed at all.
+
+The precise terms and conditions for copying, distribution
+and modification follow.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND
+MODIFICATION
+
+0. This License applies to any program or other work which
+contains a notice placed by the copyright holder saying it
+may be distributed under the terms of this General Public
+License. The "Program", below, refers to any such program or
+work, and a "work based on the Program" means either the
+Program or any derivative work under copyright law: that is
+to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into
+another language. (Hereinafter, translation is included
+without limitation in the term "modification".) Each
+licensee is addressed as "you".
+
+Activities other than copying, distribution and modification
+are not covered by this License; they are outside its scope.
+The act of running the Program is not restricted, and the
+output from the Program is covered only if its contents
+constitute a work based on the Program (independent of
+having been made by running the Program). Whether that is
+true depends on what the Program does.
+
+1. You may copy and distribute verbatim copies of the
+Program's source code as you receive it, in any medium,
+provided that you conspicuously and appropriately publish on
+each copy an appropriate copyright notice and disclaimer of
+warranty; keep intact all the notices that refer to this
+License and to the absence of any warranty; and give any
+other recipients of the Program a copy of this License along
+with the Program.
+
+You may charge a fee for the physical act of transferring a
+copy, and you may at your option offer warranty protection
+in exchange for a fee.
+
+2. You may modify your copy or copies of the Program or any
+portion of it, thus forming a work based on the Program, and
+copy and distribute such modifications or work under the
+terms of Section 1 above, provided that you also meet all of
+these conditions:
+
+    a) You must cause the modified files to carry prominent
+    notices stating that you changed the files and the date
+    of any change.
+
+    b) You must cause any work that you distribute or
+    publish, that in whole or in part contains or is derived
+    from the Program or any part thereof, to be licensed as
+    a whole at no charge to all third parties under the
+    terms of this License.
+
+    c) If the modified program normally reads commands
+    interactively when run, you must cause it, when started
+    running for such interactive use in the most ordinary
+    way, to print or display an announcement including an
+    appropriate copyright notice and a notice that there is
+    no warranty (or else, saying that you provide a
+    warranty) and that users may redistribute the program
+    under these conditions, and telling the user how to view
+    a copy of this License. (Exception: if the Program
+    itself is interactive but does not normally print such
+    an announcement, your work based on the Program is not
+    required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the
+Program, and can be reasonably considered independent and
+separate works in themselves, then this License, and its
+terms, do not apply to those sections when you distribute
+them as separate works. But when you distribute the same
+sections as part of a whole which is a work based on the
+Program, the distribution of the whole must be on the terms
+of this License, whose permissions for other licensees
+extend to the entire whole, and thus to each and every part
+regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights
+or contest your rights to work written entirely by you;
+rather, the intent is to exercise the right to control the
+distribution of derivative or collective works based on the
+Program.
+
+In addition, mere aggregation of another work not based on
+the Program with the Program (or with a work based on the
+Program) on a volume of a storage or distribution medium
+does not bring the other work under the scope of this
+License.
+
+3. You may copy and distribute the Program (or a work based
+on it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you
+also do one of the following:
+
+    a) Accompany it with the complete corresponding
+    machine-readable source code, which must be distributed
+    under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least
+    three years, to give any third party, for a charge no
+    more than your cost of physically performing source
+    distribution, a complete machine-readable copy of the
+    corresponding source code, to be distributed under the
+    terms of Sections 1 and 2 above on a medium customarily
+    used for software interchange; or,
+
+    c) Accompany it with the information you received as to
+    the offer to distribute corresponding source code. (This
+    alternative is allowed only for noncommercial
+    distribution and only if you received the program in
+    object code or executable form with such an offer, in
+    accord with Subsection b above.)
+
+The source code for a work means the preferred form of the
+work for making modifications to it. For an executable work,
+complete source code means all the source code for all
+modules it contains, plus any associated interface
+definition files, plus the scripts used to control
+compilation and installation of the executable. However, as
+a special exception, the source code distributed need not
+include anything that is normally distributed (in either
+source or binary form) with the major components (compiler,
+kernel, and so on) of the operating system on which the
+executable runs, unless that component itself accompanies
+the executable.
+
+If distribution of executable or object code is made by
+offering access to copy from a designated place, then
+offering equivalent access to copy the source code from the
+same place counts as distribution of the source code, even
+though third parties are not compelled to copy the source
+along with the object code.
+
+4. You may not copy, modify, sublicense, or distribute the
+Program except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense or distribute
+the Program is void, and will automatically terminate your
+rights under this License. However, parties who have
+received copies, or rights, from you under this License will
+not have their licenses terminated so long as such parties
+remain in full compliance.
+
+5. You are not required to accept this License, since you
+have not signed it. However, nothing else grants you
+permission to modify or distribute the Program or its
+derivative works. These actions are prohibited by law if you
+do not accept this License. Therefore, by modifying or
+distributing the Program (or any work based on the Program),
+you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or
+modifying the Program or works based on it.
+
+6. Each time you redistribute the Program (or any work based
+on the Program), the recipient automatically receives a
+license from the original licensor to copy, distribute or
+modify the Program subject to these terms and conditions.
+You may not impose any further restrictions on the
+recipients' exercise of the rights granted herein. You are
+not responsible for enforcing compliance by third parties to
+this License.
+
+7. If, as a consequence of a court judgment or allegation of
+patent infringement or for any other reason (not limited to
+patent issues), conditions are imposed on you (whether by
+court order, agreement or otherwise) that contradict the
+conditions of this License, they do not excuse you from the
+conditions of this License. If you cannot distribute so as
+to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a
+consequence you may not distribute the Program at all. For
+example, if a patent license would not permit royalty-free
+redistribution of the Program by all those who receive
+copies directly or indirectly through you, then the only way
+you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or
+unenforceable under any particular circumstance, the balance
+of the section is intended to apply and the section as a
+whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to
+infringe any patents or other property right claims or to
+contest validity of any such claims; this section has the
+sole purpose of protecting the integrity of the free
+software distribution system, which is implemented by public
+license practices. Many people have made generous
+contributions to the wide range of software distributed
+through that system in reliance on consistent application of
+that system; it is up to the author/donor to decide if he or
+she is willing to distribute software through any other
+system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is
+believed to be a consequence of the rest of this License.
+
+8. If the distribution and/or use of the Program is
+restricted in certain countries either by patents or by
+copyrighted interfaces, the original copyright holder who
+places the Program under this License may add an explicit
+geographical distribution limitation excluding those
+countries, so that distribution is permitted only in or
+among countries not thus excluded. In such case, this
+License incorporates the limitation as if written in the
+body of this License.
+
+9. The Free Software Foundation may publish revised and/or
+new versions of the General Public License from time to
+time. Such new versions will be similar in spirit to the
+present version, but may differ in detail to address new
+problems or concerns.
+
+Each version is given a distinguishing version number. If
+the Program specifies a version number of this License which
+applies to it and "any later version", you have the option
+of following the terms and conditions either of that version
+or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number
+of this License, you may choose any version ever published
+by the Free Software Foundation.
+
+10. If you wish to incorporate parts of the Program into
+other free programs whose distribution conditions are
+different, write to the author to ask for permission. For
+software which is copyrighted by the Free Software
+Foundation, write to the Free Software Foundation; we
+sometimes make exceptions for this. Our decision will be
+guided by the two goals of preserving the free status of all
+derivatives of our free software and of promoting the
+sharing and reuse of software generally.
+
+NO WARRANTY
+
+11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS
+NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE
+COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM
+"AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
+IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE
+OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
+DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED
+TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY
+WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED
+ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL,
+SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF
+THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT
+LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
+LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE
+PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH
+HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+              END OF TERMS AND CONDITIONS
+
+       How to Apply These Terms to Your New Programs
+
+If you develop a new program, and you want it to be of the
+greatest possible use to the public, the best way to achieve
+this is to make it free software which everyone can
+redistribute and change under these terms.
+
+To do so, attach the following notices to the program. It is
+safest to attach them to the start of each source file to
+most effectively convey the exclusion of warranty; and each
+file should have at least the "copyright" line and a pointer
+to where the full notice is found.
+
+    One line to give the program's name and a brief idea of
+    what it does. Copyright (C) <year> <name of author>
+
+    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 2 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, write to
+    the Free Software Foundation, Inc., 59 Temple Place,
+    Suite 330, Boston, MA 02111-1307 USA
+
+Also add information on how to contact you by electronic and
+paper mail.
+
+If the program is interactive, make it output a short notice
+like this when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of
+    author Gnomovision comes with ABSOLUTELY NO WARRANTY;
+    for details type `show w'. This is free software, and
+    you are welcome to redistribute it under certain
+    conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show
+the appropriate parts of the General Public License. Of
+course, the commands you use may be called something other
+than `show w' and `show c'; they could even be mouse-clicks
+or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a
+programmer) or your school, if any, to sign a "copyright
+disclaimer" for the program, if necessary. Here is a sample;
+alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in
+  the program `Gnomovision' (which makes passes at
+  compilers) written by James Hacker.
+
+  signature of Ty Coon, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating
+your program into proprietary programs. If your program is a
+subroutine library, you may consider it more useful to
+permit linking proprietary applications with the library. If
+this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
+"CLASSPATH" EXCEPTION TO THE GPL VERSION 2
+
+
+Certain source files distributed by Sun Microsystems, Inc.
+are subject to the following clarification and special
+exception to the GPL, but only where Sun has expressly
+included in the particular source file's header the words
+"Sun designates this particular file as subject to the
+"Classpath" exception as provided by Sun in the LICENSE file
+that accompanied this code."
+
+Linking this library statically or dynamically with other
+modules is making a combined work based on this library.
+Thus, the terms and conditions of the GNU General Public
+License cover the whole combination.
+
+As a special exception, the copyright holders of this
+library give you permission to link this library with
+independent modules to produce an executable, regardless of
+the license terms of these independent modules, and to copy
+and distribute the resulting executable under terms of your
+choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license
+of that module. An independent module is a module which is
+not derived from or based on this library. If you modify
+this library, you may extend this exception to your version
+of the library, but you are not obligated to do so. If you
+do not wish to do so, delete this exception statement from
+your version.
Index: /applications/editors/josm/plugins/native-password-manager/gpl-2.txt
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/gpl-2.txt	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/gpl-2.txt	(revision 26335)
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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 2 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, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
Index: /applications/editors/josm/plugins/native-password-manager/gpl-3.txt
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/gpl-3.txt	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/gpl-3.txt	(revision 26335)
@@ -0,0 +1,674 @@
+                    GNU GENERAL PUBLIC LICENSE
+                       Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                            Preamble
+
+  The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+  The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.  We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors.  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+  To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights.  Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received.  You must make sure that they, too, receive
+or can get the source code.  And you must show them these terms so they
+know their rights.
+
+  Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+  For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+  Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so.  This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software.  The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable.  Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products.  If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+  Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary.  To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                       TERMS AND CONDITIONS
+
+  0. Definitions.
+
+  "This License" refers to version 3 of the GNU General Public License.
+
+  "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+  "The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+  To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+  A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+  To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+  To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+  An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+  1. Source Code.
+
+  The "source code" for a work means the preferred form of the work
+for making modifications to it.  "Object code" means any non-source
+form of a work.
+
+  A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+  The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+  The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+  The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+  The Corresponding Source for a work in source code form is that
+same work.
+
+  2. Basic Permissions.
+
+  All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+  You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+  Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+  No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+  When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+  4. Conveying Verbatim Copies.
+
+  You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+  You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+  5. Conveying Modified Source Versions.
+
+  You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+    a) The work must carry prominent notices stating that you modified
+    it, and giving a relevant date.
+
+    b) The work must carry prominent notices stating that it is
+    released under this License and any conditions added under section
+    7.  This requirement modifies the requirement in section 4 to
+    "keep intact all notices".
+
+    c) You must license the entire work, as a whole, under this
+    License to anyone who comes into possession of a copy.  This
+    License will therefore apply, along with any applicable section 7
+    additional terms, to the whole of the work, and all its parts,
+    regardless of how they are packaged.  This License gives no
+    permission to license the work in any other way, but it does not
+    invalidate such permission if you have separately received it.
+
+    d) If the work has interactive user interfaces, each must display
+    Appropriate Legal Notices; however, if the Program has interactive
+    interfaces that do not display Appropriate Legal Notices, your
+    work need not make them do so.
+
+  A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+  6. Conveying Non-Source Forms.
+
+  You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+    a) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by the
+    Corresponding Source fixed on a durable physical medium
+    customarily used for software interchange.
+
+    b) Convey the object code in, or embodied in, a physical product
+    (including a physical distribution medium), accompanied by a
+    written offer, valid for at least three years and valid for as
+    long as you offer spare parts or customer support for that product
+    model, to give anyone who possesses the object code either (1) a
+    copy of the Corresponding Source for all the software in the
+    product that is covered by this License, on a durable physical
+    medium customarily used for software interchange, for a price no
+    more than your reasonable cost of physically performing this
+    conveying of source, or (2) access to copy the
+    Corresponding Source from a network server at no charge.
+
+    c) Convey individual copies of the object code with a copy of the
+    written offer to provide the Corresponding Source.  This
+    alternative is allowed only occasionally and noncommercially, and
+    only if you received the object code with such an offer, in accord
+    with subsection 6b.
+
+    d) Convey the object code by offering access from a designated
+    place (gratis or for a charge), and offer equivalent access to the
+    Corresponding Source in the same way through the same place at no
+    further charge.  You need not require recipients to copy the
+    Corresponding Source along with the object code.  If the place to
+    copy the object code is a network server, the Corresponding Source
+    may be on a different server (operated by you or a third party)
+    that supports equivalent copying facilities, provided you maintain
+    clear directions next to the object code saying where to find the
+    Corresponding Source.  Regardless of what server hosts the
+    Corresponding Source, you remain obligated to ensure that it is
+    available for as long as needed to satisfy these requirements.
+
+    e) Convey the object code using peer-to-peer transmission, provided
+    you inform other peers where the object code and Corresponding
+    Source of the work are being offered to the general public at no
+    charge under subsection 6d.
+
+  A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+  A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+  "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+  If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+  The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+  Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+  7. Additional Terms.
+
+  "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+  When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+  Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+    a) Disclaiming warranty or limiting liability differently from the
+    terms of sections 15 and 16 of this License; or
+
+    b) Requiring preservation of specified reasonable legal notices or
+    author attributions in that material or in the Appropriate Legal
+    Notices displayed by works containing it; or
+
+    c) Prohibiting misrepresentation of the origin of that material, or
+    requiring that modified versions of such material be marked in
+    reasonable ways as different from the original version; or
+
+    d) Limiting the use for publicity purposes of names of licensors or
+    authors of the material; or
+
+    e) Declining to grant rights under trademark law for use of some
+    trade names, trademarks, or service marks; or
+
+    f) Requiring indemnification of licensors and authors of that
+    material by anyone who conveys the material (or modified versions of
+    it) with contractual assumptions of liability to the recipient, for
+    any liability that these contractual assumptions directly impose on
+    those licensors and authors.
+
+  All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+  If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+  Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+  8. Termination.
+
+  You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+  However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+  Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+  Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+  9. Acceptance Not Required for Having Copies.
+
+  You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+  10. Automatic Licensing of Downstream Recipients.
+
+  Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+  An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+  You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+  11. Patents.
+
+  A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+  A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+  Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+  In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+  If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+  If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+  A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+  Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+  12. No Surrender of Others' Freedom.
+
+  If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+  13. Use with the GNU Affero General Public License.
+
+  Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+  14. Revised Versions of this License.
+
+  The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+  Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+  If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+  Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+  15. Disclaimer of Warranty.
+
+  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. Limitation of Liability.
+
+  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+  17. Interpretation of Sections 15 and 16.
+
+  If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+                     END OF TERMS AND CONDITIONS
+
+            How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    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/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+    <program>  Copyright (C) <year>  <name of author>
+    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
Index: /applications/editors/josm/plugins/native-password-manager/images_nodist/lock.svg
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/images_nodist/lock.svg	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/images_nodist/lock.svg	(revision 26335)
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="288.31223"
+   height="338.99783"
+   id="svg3432"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   version="1.0"
+   sodipodi:docname="lockey.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs3434">
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient3389">
+      <stop
+         style="stop-color:#fff6d5;stop-opacity:1;"
+         offset="0"
+         id="stop3391" />
+      <stop
+         style="stop-color:#fff6d5;stop-opacity:0;"
+         offset="1"
+         id="stop3393" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3389"
+       id="linearGradient3421"
+       gradientUnits="userSpaceOnUse"
+       x1="286.68277"
+       y1="514.80005"
+       x2="361.53314"
+       y2="570.55762" />
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3346"
+       id="linearGradient3419"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="matrix(0.396081,0,0,0.396081,248.57108,410.85288)"
+       x1="268.67896"
+       y1="592.75702"
+       x2="329.15332"
+       y2="638.5448" />
+    <linearGradient
+       inkscape:collect="always"
+       id="linearGradient3346">
+      <stop
+         style="stop-color:#ffeeaa;stop-opacity:1;"
+         offset="0"
+         id="stop3348" />
+      <stop
+         style="stop-color:#ffeeaa;stop-opacity:0;"
+         offset="1"
+         id="stop3350" />
+    </linearGradient>
+    <linearGradient
+       inkscape:collect="always"
+       xlink:href="#linearGradient3346"
+       id="linearGradient3417"
+       gradientUnits="userSpaceOnUse"
+       gradientTransform="translate(0.8639194,-0.8639194)"
+       x1="268.67896"
+       y1="592.75702"
+       x2="329.15332"
+       y2="638.5448" />
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective3440" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.35"
+     inkscape:cx="375"
+     inkscape:cy="520"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="640"
+     inkscape:window-height="669"
+     inkscape:window-x="161"
+     inkscape:window-y="95" />
+  <metadata
+     id="metadata3437">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Livello 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(-230.84389,-362.86327)">
+    <path
+       style="fill:#ffd42a;fill-rule:evenodd;stroke:#ffef76;stroke-width:2;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       d="M 518.15611,649.03749 C 516.43984,643.88621 517.27433,637.06501 513.42724,632.13631 C 509.08556,630.99731 508.12898,629.58081 503.39414,635.59208 C 499.46298,620.7968 493.70624,629.85966 488.51081,638.42617 C 486.83484,629.50127 487.13632,625.14262 477.77814,632.25557 C 470.86334,623.60659 466.32191,626.94282 463.07148,637.66871 C 457.97429,626.71522 458.17696,628.99537 455.69504,629.49777 C 450.6132,637.1967 447.18162,646.79031 423.82166,639.15602 C 410.4087,630.8777 412.98508,612.91949 394.94772,604.53323 C 380.29098,599.47584 361.72476,602.7096 351.79041,615.21494 C 337.62854,648.59732 341.01042,680.39793 355.40404,693.08092 C 375.98386,712.15631 406.20328,692.49504 419.34343,673.36193 C 418.21913,661.51112 453.07713,658.64339 466.41825,658.34165 C 477.54977,658.31514 488.65676,657.81825 499.78539,657.57011 C 506.6115,657.06487 514.27199,655.2371 518.15611,649.03749 z M 372.11491,655.86357 C 370.78983,660.25053 368.32583,663.50482 365.38883,664.20897 C 360.68964,665.33562 356.53614,659.48361 356.11019,651.14175 C 355.68424,642.79991 359.15729,635.11364 363.85649,633.98699 C 368.55566,632.86034 372.70918,638.71235 373.13513,647.0542 C 373.29485,650.18239 372.90996,653.23141 372.11491,655.86357 z"
+       id="path3290"
+       sodipodi:nodetypes="ccccccccccccccccssssc" />
+    <g
+       id="g3397"
+       transform="translate(-40.368785,-162.03383)">
+      <path
+         sodipodi:nodetypes="ccccccccc"
+         id="path2467"
+         d="M 271.21268,647.6366 C 276.49124,624.52298 288.1134,602.57705 305.63392,586.4263 C 335.5376,577.68347 365.5467,569.1482 395.82621,561.8479 C 416.12728,558.35939 436.15883,552.72026 456.76676,551.43017 C 470.01944,549.94476 481.03638,559.5032 486.4435,570.79196 C 493.81386,586.05954 497.11985,602.87289 502.57751,618.85515 C 506.94805,634.86673 511.81669,651.0832 513.24328,667.60556 C 510.51878,684.25879 498.43637,702.7852 488.91904,715.42017 C 483.60726,720.84437 332.64459,749.43774 325.17608,751.37663"
+         style="fill:#aa8800;fill-rule:evenodd" />
+      <path
+         id="rect2437"
+         d="M 399.24085,524.8971 C 392.27249,525.10315 385.21367,528.25023 378.2096,529.4596 C 361.05622,533.80082 343.78371,537.36442 326.7096,542.2096 C 318.77956,545.64034 311.57808,557.45151 313.24085,569.42835 C 313.73302,576.56166 314.92451,587.95265 315.74085,597.30335 C 317.13524,598.39716 318.79618,599.06659 320.86585,599.1471 C 323.34892,599.24374 325.20261,598.3483 326.9596,597.8971 L 326.8971,597.3971 C 328.2234,597.23039 329.31928,596.68656 329.3971,595.7096 C 329.44794,593.13342 328.16451,590.82872 327.3346,588.4596 C 326.90667,586.55312 324.92725,580.63111 324.36585,576.86585 C 324.33184,575.98741 324.31051,575.12457 324.30335,574.2721 C 324.21905,564.24129 326.23142,556.18196 335.8346,554.11585 C 335.83461,554.11589 390.90312,538.4349 393.0221,538.7096 C 402.20429,539.89998 402.50219,554.6 403.3346,565.7096 L 404.61585,577.55335 C 406.58371,578.4922 408.73818,578.80526 411.1471,578.0846 C 414.12298,577.1943 415.18628,576.1029 417.42835,574.7721 C 417.50005,574.72954 417.54596,574.65066 417.61585,574.5846 C 416.04527,559.52254 414.4125,544.29427 413.8971,538.86585 C 412.11433,530.57086 406.3459,525.86371 400.3971,525.0221 C 400.00049,524.96599 399.63762,524.91869 399.24085,524.8971 z M 419.6471,594.55335 C 417.18224,595.72855 414.4222,596.52871 412.4596,597.11585 C 409.88221,597.88689 407.99448,596.94698 406.5221,595.30335 L 408.05335,609.24085 C 410.22913,608.521 418.9552,609.25843 420.86585,608.4596 C 420.71525,605.7793 420.24722,600.7345 419.6471,594.55335 z"
+         style="fill:#806600;fill-opacity:1;stroke:none;stroke-width:5;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <rect
+         transform="matrix(0.9695481,-0.2449011,0.2449011,0.9695481,0,0)"
+         ry="34.428574"
+         rx="40.14286"
+         y="667.30945"
+         x="103.4785"
+         height="154.28572"
+         width="208.57143"
+         id="rect2383"
+         style="fill:#d4aa00;fill-opacity:1;stroke:none;stroke-width:5;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path3276"
+         d="M 363.12909,682.70746 C 357.87868,680.28943 353.38012,674.84599 354.0628,668.7948 C 356.23838,663.48912 360.90142,659.70527 365.18966,656.13445 C 369.66554,653.3783 375.10098,652.95329 380.18745,652.28358 C 385.13805,651.7223 390.1257,654.70192 391.61115,659.50587 C 393.47508,664.99177 393.3683,671.18131 390.91946,676.47448 C 388.43391,681.46162 390.96572,687.29844 395.75852,689.73004 C 400.37874,693.06411 406.07695,695.47057 409.04304,700.60254 C 409.0656,704.91294 403.67625,704.90912 400.55454,705.26286 C 389.17413,706.78536 378.19008,710.24283 367.14183,713.23921 C 361.90294,711.43555 365.75944,704.87181 367.44752,701.65846 C 369.66019,697.17632 374.72222,690.6533 369.83138,686.25437 C 367.89212,684.58313 365.42901,683.74197 363.12909,682.70746 z"
+         style="fill:#2b2200;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccc"
+         id="path3317"
+         d="M 299.78006,728.39237 C 280.18224,693.78928 274.80817,667.89384 280.32805,627.06807 C 296.12108,602.67418 418.47222,574.81648 431.34747,575.81008 C 321.20106,623.43913 314.99932,644.61938 299.78006,728.39237 z"
+         style="fill:url(#linearGradient3417);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cccc"
+         id="path3354"
+         d="M 371.66901,690.78661 C 363.90668,677.08099 358.80785,677.22026 360.99416,661.04995 C 367.24948,651.38799 389.88048,663.82535 407.93891,648.66835 C 364.31201,667.53331 377.69707,657.60573 371.66901,690.78661 z"
+         style="fill:url(#linearGradient3419);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="ccsccccsscc"
+         id="path3378"
+         d="M 372.78693,536.99716 C 349.94997,536.96405 325.67698,540.13165 317.28693,553.09091 C 315.81077,564.00879 312.7148,569.25204 313.34943,571.99716 C 316.98582,587.72659 320.17298,587.24119 325.81818,591.99716 C 326.4706,591.23952 327.02221,590.55748 327.63068,589.84091 C 327.50992,589.53083 327.39607,589.21496 327.28693,588.90341 C 326.85899,586.99693 324.87958,581.07492 324.31818,577.30966 C 324.28416,576.43122 324.26284,575.56838 324.25568,574.71591 C 324.17137,564.6851 326.18375,556.62577 335.78693,554.55966 C 335.78693,554.55969 374.93883,543.40872 388.34943,540.12216 C 388.67785,539.23592 378.53109,537.00549 372.78693,536.99716 z"
+         style="fill:url(#linearGradient3421);fill-opacity:1;stroke:none;stroke-width:5;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+    </g>
+  </g>
+</svg>
Index: /applications/editors/josm/plugins/native-password-manager/netbeans-keyring-patches.diff
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/netbeans-keyring-patches.diff	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/netbeans-keyring-patches.diff	(revision 26335)
@@ -0,0 +1,251 @@
+diff -r src-netbeans-524f40b94a30-origin/org/netbeans/modules/keyring/fallback/FallbackProvider.java src/org/netbeans/modules/keyring/fallback/FallbackProvider.java
+45,47d44
+< import java.util.Arrays;
+< import java.util.HashMap;
+< import java.util.Map;
+49d45
+< import java.util.concurrent.Callable;
+52,54d47
+< import java.util.prefs.BackingStoreException;
+< import java.util.prefs.Preferences;
+< import org.netbeans.api.keyring.Keyring;
+58,63d50
+< import org.openide.DialogDisplayer;
+< import org.openide.NotifyDescriptor;
+< import org.openide.util.Lookup;
+< import org.openide.util.NbBundle;
+< import org.openide.util.NbPreferences;
+< import org.openide.util.lookup.ServiceProvider;
+68,69c55
+< @ServiceProvider(service=KeyringProvider.class, position=1000)
+< public class FallbackProvider implements KeyringProvider, Callable<Void> {
+---
+> public class FallbackProvider implements KeyringProvider {
+76c62,75
+<  
+---
+>     private IPreferences pre;
+>     
+>     // simple interface for a generic preferences store
+>     public interface IPreferences {
+>         String get(String key, String def);
+>         void put(String key, String val);
+>         void remove(String key);
+>     }
+> 
+>     public FallbackProvider(EncryptionProvider encryption, IPreferences pref) {
+>         this.encryption = encryption;
+>         this.pre = pref;
+>     }
+>     
+78,87c77,79
+<         for (EncryptionProvider p : Lookup.getDefault().lookupAll(EncryptionProvider.class)) {
+<             if (p.enabled()) {
+<                 encryption = p;
+<                 Preferences prefs = prefs();
+<                 Utils.goMinusR(prefs);
+<                 p.encryptionChangingCallback(this);
+<                 if (!testSampleKey(prefs)) {
+<                     continue;
+<                 }
+<                 LOG.log(Level.FINE, "Using provider: {0}", p);
+---
+>         if (encryption.enabled()) {
+>             if (testSampleKey()) {
+>                 LOG.log(Level.FINE, "Using provider: {0}", encryption);
+95,106c87,92
+<     private boolean testSampleKey(Preferences prefs) {
+<         byte[] ciphertext = prefs.getByteArray(SAMPLE_KEY, null);
+<         if (ciphertext == null) {
+<             encryption.freshKeyring(true);
+<             if (_save(SAMPLE_KEY, (SAMPLE_KEY + UUID.randomUUID()).toCharArray(),
+<                     NbBundle.getMessage(FallbackProvider.class, "FallbackProvider.sample_key.description"))) {
+<                 LOG.fine("saved sample key");
+<                 return true;
+<             } else {
+<                 LOG.fine("could not save sample key");
+<                 return false;
+<             }
+---
+>     private boolean testSampleKey() {
+>         encryption.freshKeyring(true);
+>         if (_save(SAMPLE_KEY, (SAMPLE_KEY + UUID.randomUUID()).toCharArray(),
+>                 "Sample value ensuring that decryption is working.")) {
+>             LOG.fine("saved sample key");
+>             return true;
+108,143c94,95
+<             encryption.freshKeyring(false);
+<             while (true) {
+<                 try {
+<                     if (new String(encryption.decrypt(ciphertext)).startsWith(SAMPLE_KEY)) {
+<                         LOG.fine("succeeded in decrypting sample key");
+<                         return true;
+<                     } else {
+<                         LOG.fine("wrong result decrypting sample key");
+<                     }
+<                 } catch (Exception x) {
+<                     LOG.log(Level.FINE, "failed to decrypt sample key", x);
+<                 }
+<                 if (!encryption.decryptionFailed()) {
+<                     LOG.fine("sample key decryption failed");
+<                     return promptToDelete(prefs);
+<                 }
+<                 LOG.fine("will retry decryption of sample key");
+<             }
+<         }
+<     }
+< 
+<     private boolean promptToDelete(Preferences prefs) {
+<         Object result = DialogDisplayer.getDefault().notify(new NotifyDescriptor.Confirmation(
+<                 NbBundle.getMessage(FallbackProvider.class, "FallbackProvider.msg_clear_keys"),
+<                 NbBundle.getMessage(FallbackProvider.class, "FallbackProvider.title_clear_keys"),
+<                 NotifyDescriptor.OK_CANCEL_OPTION));
+<         if (result == NotifyDescriptor.OK_OPTION) {
+<             try {
+<                 LOG.log(Level.FINE, "agreed to delete stored passwords: {0}", Arrays.asList(prefs.keys()));
+<                 prefs.clear();
+<                 return testSampleKey(prefs);
+<             } catch (BackingStoreException x) {
+<                 LOG.log(Level.INFO, null, x);
+<             }
+<         } else {
+<             LOG.fine("refused to delete stored passwords");
+---
+>             LOG.fine("could not save sample key");
+>             return false;
+145,149d96
+<         return false;
+<     }
+< 
+<     private Preferences prefs() {
+<         return NbPreferences.forModule(Keyring.class).node(encryption.id());
+153c100,101
+<         byte[] ciphertext = prefs().getByteArray(key, null);
+---
+>         String ciphertext_string = pre.get(key, null);
+>         byte[] ciphertext = ciphertext_string == null ? null : Utils.chars2Bytes(ciphertext_string.toCharArray());
+169d116
+<         Preferences prefs = prefs();
+171c118,120
+<             prefs.putByteArray(key, encryption.encrypt(password));
+---
+>             byte[] encryptedPasswordByteArray = encryption.encrypt(password);
+>             String encryptedPassword = encryptedPasswordByteArray == null ? null : String.valueOf(Utils.bytes2Chars(encryptedPasswordByteArray));
+>             pre.put(key, encryptedPassword);
+178c127
+<             prefs.put(key + DESCRIPTION, description);
+---
+>             pre.put(key + DESCRIPTION, description);
+184,209c133,134
+<         Preferences prefs = prefs();
+<         prefs.remove(key);
+<         prefs.remove(key + DESCRIPTION);
+<     }
+< 
+<     public Void call() throws Exception { // encryption changing
+<         LOG.fine("encryption changing");
+<         Map<String,char[]> saved = new HashMap<String,char[]>();
+<         Preferences prefs = prefs();
+<         for (String k : prefs.keys()) {
+<             if (k.endsWith(DESCRIPTION)) {
+<                 continue;
+<             }
+<             byte[] ciphertext = prefs.getByteArray(k, null);
+<             if (ciphertext == null) {
+<                 continue;
+<             }
+<             saved.put(k, encryption.decrypt(ciphertext));
+<         }
+<         LOG.log(Level.FINE, "reencrypting keys: {0}", saved.keySet());
+<         encryption.encryptionChanged();
+<         for (Map.Entry<String,char[]> entry : saved.entrySet()) {
+<             prefs.putByteArray(entry.getKey(), encryption.encrypt(entry.getValue()));
+<         }
+<         LOG.fine("encryption changing finished");
+<         return null;
+---
+>         pre.remove(key);
+>         pre.remove(key + DESCRIPTION);
+diff -r src-netbeans-524f40b94a30-origin/org/netbeans/modules/keyring/gnome/GnomeProvider.java src/org/netbeans/modules/keyring/gnome/GnomeProvider.java
+46,47d45
+< import java.text.MessageFormat;
+< import java.util.MissingResourceException;
+52,53d49
+< import org.openide.util.NbBundle;
+< import org.openide.util.lookup.ServiceProvider;
+55d50
+< @ServiceProvider(service=KeyringProvider.class, position=100)
+77,84c72
+<         String appName;
+<         try {
+<             appName = MessageFormat.format(
+<                     NbBundle.getBundle("org.netbeans.core.windows.view.ui.Bundle").getString("CTL_MainWindow_Title_No_Project"),
+<                     /*System.getProperty("netbeans.buildnumber")*/"…");
+<         } catch (MissingResourceException x) {
+<             appName = "NetBeans"; // NOI18N
+<         }
+---
+>         String appName = "JOSM";
+diff -r src-netbeans-524f40b94a30-origin/org/netbeans/modules/keyring/kde/KWalletProvider.java src/org/netbeans/modules/keyring/kde/KWalletProvider.java
+48d47
+< import java.text.MessageFormat;
+50d48
+< import java.util.MissingResourceException;
+54,55d51
+< import org.openide.util.NbBundle;
+< import org.openide.util.lookup.ServiceProvider;
+61d56
+< @ServiceProvider(service=KeyringProvider.class, position=99)
+224,230c219
+<         String appName;
+<         try {
+<             appName = MessageFormat.format(NbBundle.getBundle("org.netbeans.core.windows.view.ui.Bundle").getString("CTL_MainWindow_Title_No_Project"),version ? System.getProperty("netbeans.buildnumber"):"");
+<         } catch (MissingResourceException x) {
+<             appName = "NetBeans"+(version? " "+System.getProperty("netbeans.buildnumber"):"");
+<         }
+<         return appName.toCharArray();
+---
+>         return "JOSM".toCharArray();
+diff -r src-netbeans-524f40b94a30-origin/org/netbeans/modules/keyring/mac/MacProvider.java src/org/netbeans/modules/keyring/mac/MacProvider.java
+50,51d49
+< import org.openide.util.Utilities;
+< import org.openide.util.lookup.ServiceProvider;
+53d50
+< @ServiceProvider(service=KeyringProvider.class, position=200)
+59,63c56
+<         if (Boolean.getBoolean("netbeans.keyring.no.native")) {
+<             LOG.fine("native keyring integration disabled");
+<             return false;
+<         }
+<         return Utilities.isMac();
+---
+>         return true; // test elsewhere if we are on a mac
+69c62
+<             byte[] accountName = "NetBeans".getBytes("UTF-8");
+---
+>             byte[] accountName = "JOSM".getBytes("UTF-8");
+89c82
+<             byte[] accountName = "NetBeans".getBytes("UTF-8");
+---
+>             byte[] accountName = "JOSM".getBytes("UTF-8");
+103c96
+<             byte[] accountName = "NetBeans".getBytes("UTF-8");
+---
+>             byte[] accountName = "JOSM".getBytes("UTF-8");
+diff -r src-netbeans-524f40b94a30-origin/org/netbeans/modules/keyring/win32/Win32Protect.java src/org/netbeans/modules/keyring/win32/Win32Protect.java
+57,58d56
+< import org.openide.util.Utilities;
+< import org.openide.util.lookup.ServiceProvider;
+65d62
+< @ServiceProvider(service=EncryptionProvider.class, position=100)
+71,78c68
+<         if (!Utilities.isWindows()) {
+<             LOG.fine("not running on Windows");
+<             return false;
+<         }
+<         if (Boolean.getBoolean("netbeans.keyring.no.native")) {
+<             LOG.fine("native keyring integration disabled");
+<             return false;
+<         }
+---
+>         // asssume, we have windows os
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/fallback/FallbackProvider.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/fallback/FallbackProvider.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/fallback/FallbackProvider.java	(revision 26335)
@@ -0,0 +1,137 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.keyring.fallback;
+
+import java.util.UUID;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.netbeans.modules.keyring.impl.Utils;
+import org.netbeans.modules.keyring.spi.EncryptionProvider;
+import org.netbeans.spi.keyring.KeyringProvider;
+
+/**
+ * Platform-independent keyring provider using a master password and the user directory.
+ */
+public class FallbackProvider implements KeyringProvider {
+
+    private static final Logger LOG = Logger.getLogger(FallbackProvider.class.getName());
+    private static final String DESCRIPTION = ".description";
+    private static final String SAMPLE_KEY = "__sample__";
+
+    private EncryptionProvider encryption;
+    private IPreferences pre;
+    
+    // simple interface for a generic preferences store
+    public interface IPreferences {
+        String get(String key, String def);
+        void put(String key, String val);
+        void remove(String key);
+    }
+
+    public FallbackProvider(EncryptionProvider encryption, IPreferences pref) {
+        this.encryption = encryption;
+        this.pre = pref;
+    }
+    
+    public boolean enabled() {
+        if (encryption.enabled()) {
+            if (testSampleKey()) {
+                LOG.log(Level.FINE, "Using provider: {0}", encryption);
+                return true;
+            }
+        }
+        LOG.fine("No provider");
+        return false;
+    }
+    
+    private boolean testSampleKey() {
+        encryption.freshKeyring(true);
+        if (_save(SAMPLE_KEY, (SAMPLE_KEY + UUID.randomUUID()).toCharArray(),
+                "Sample value ensuring that decryption is working.")) {
+            LOG.fine("saved sample key");
+            return true;
+        } else {
+            LOG.fine("could not save sample key");
+            return false;
+        }
+    }
+
+    public char[] read(String key) {
+        String ciphertext_string = pre.get(key, null);
+        byte[] ciphertext = ciphertext_string == null ? null : Utils.chars2Bytes(ciphertext_string.toCharArray());
+        if (ciphertext == null) {
+            return null;
+        }
+        try {
+            return encryption.decrypt(ciphertext);
+        } catch (Exception x) {
+            LOG.log(Level.FINE, "failed to decrypt password for " + key, x);
+        }
+        return null;
+    }
+
+    public void save(String key, char[] password, String description) {
+        _save(key, password, description);
+    }
+    private boolean _save(String key, char[] password, String description) {
+        try {
+            byte[] encryptedPasswordByteArray = encryption.encrypt(password);
+            String encryptedPassword = encryptedPasswordByteArray == null ? null : String.valueOf(Utils.bytes2Chars(encryptedPasswordByteArray));
+            pre.put(key, encryptedPassword);
+        } catch (Exception x) {
+            LOG.log(Level.FINE, "failed to encrypt password for " + key, x);
+            return false;
+        }
+        if (description != null) {
+            // Preferences interface gives no access to *.properties comments, so:
+            pre.put(key + DESCRIPTION, description);
+        }
+        return true;
+    }
+
+    public void delete(String key) {
+        pre.remove(key);
+        pre.remove(key + DESCRIPTION);
+    }
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/gnome/GnomeKeyringLibrary.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/gnome/GnomeKeyringLibrary.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/gnome/GnomeKeyringLibrary.java	(revision 26335)
@@ -0,0 +1,121 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.keyring.gnome;
+
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+
+/**
+ * JNA wrapper for certain functions from GNOME Keyring API.
+ * #178571: must work against GNOME 2.6 to support JDS 3 (Solaris 10).
+ * @see <a href="http://library.gnome.org/devel/gnome-keyring/stable/">gnome-keyring API Reference</a>
+ */
+public interface GnomeKeyringLibrary extends Library {
+
+    GnomeKeyringLibrary LIBRARY = (GnomeKeyringLibrary) Native.loadLibrary("gnome-keyring", GnomeKeyringLibrary.class);
+
+    boolean gnome_keyring_is_available();
+
+    /*GnomeKeyringItemType*/int GNOME_KEYRING_ITEM_GENERIC_SECRET = 0;
+
+    // GnomeKeyringAttributeList gnome_keyring_attribute_list_new() = g_array_new(FALSE, FALSE, sizeof(GnomeKeyringAttribute))
+    int GnomeKeyringAttribute_SIZE = Pointer.SIZE * 3; // conservatively: 2 pointers + 1 enum
+
+    void gnome_keyring_attribute_list_append_string(
+            /*GnomeKeyringAttributeList*/Pointer attributes,
+            String name,
+            String value);
+
+    void gnome_keyring_attribute_list_free(
+            /*GnomeKeyringAttributeList*/Pointer attributes);
+
+    int gnome_keyring_item_create_sync(
+            String keyring,
+            /*GnomeKeyringItemType*/int type,
+            String display_name,
+            /*GnomeKeyringAttributeList*/Pointer attributes,
+            String secret,
+            boolean update_if_exists,
+            int[] item_id);
+
+    int gnome_keyring_item_delete_sync(
+            String keyring,
+            int id);
+
+    int gnome_keyring_find_items_sync(
+            /*GnomeKeyringItemType*/int type,
+            /*GnomeKeyringAttributeList*/Pointer attributes,
+            /*GList<GnomeKeyringFound>*/Pointer[] found);
+
+    void gnome_keyring_found_list_free(
+            /*GList<GnomeKeyringFound>*/Pointer found_list);
+
+    class GnomeKeyringFound extends Structure {
+        public String keyring;
+        public int item_id;
+        public /*GnomeKeyringAttributeList*/Pointer attributes;
+        public String secret;
+    }
+
+    /** http://library.gnome.org/devel/glib/2.6/glib-Miscellaneous-Utility-Functions.html#g-set-application-name */
+    void g_set_application_name(String name);
+
+    /** http://library.gnome.org/devel/glib/2.6/glib-Arrays.html */
+
+    Pointer g_array_new(
+            /*gboolean*/int zero_terminated,
+            /*gboolean*/int clear,
+            int element_size);
+
+    /** http://library.gnome.org/devel/glib/2.6/glib-Doubly-Linked-Lists.html */
+
+    int g_list_length(
+            Pointer list);
+
+    /*gpointer*/GnomeKeyringFound g_list_nth_data(
+            Pointer list,
+            int n);
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/gnome/GnomeProvider.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/gnome/GnomeProvider.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/gnome/GnomeProvider.java	(revision 26335)
@@ -0,0 +1,182 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.keyring.gnome;
+
+import com.sun.jna.Pointer;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import static org.netbeans.modules.keyring.gnome.GnomeKeyringLibrary.*;
+import org.netbeans.spi.keyring.KeyringProvider;
+
+public class GnomeProvider implements KeyringProvider {
+
+    private static final Logger LOG = Logger.getLogger(GnomeProvider.class.getName());
+    private static final String KEY = "key"; // NOI18N
+
+    public @Override boolean enabled() {
+        if (Boolean.getBoolean("netbeans.keyring.no.native")) {
+            LOG.fine("native keyring integration disabled");
+            return false;
+        }
+        boolean envVarSet = false;
+        for (String key : System.getenv().keySet()) {
+            if (key.startsWith("GNOME_KEYRING_")) { // NOI18N
+                envVarSet = true;
+                break;
+            }
+        }
+        if (!envVarSet) {
+            LOG.fine("no GNOME_KEYRING_* environment variable set");
+            return false;
+        }
+        String appName = "JOSM";
+        try {
+            // Need to do this somewhere, or we get warnings on console.
+            // Also used by confirmation dialogs to give the app access to the login keyring.
+            LIBRARY.g_set_application_name(appName);
+            if (!LIBRARY.gnome_keyring_is_available()) {
+                return false;
+            }
+            // #178571: try to read some key just to make sure gnome_keyring_find_password_sync is bound:
+            read("NoNeXiStEnT"); // NOI18N
+            return true;
+        } catch (Throwable t) {
+            LOG.log(Level.FINE, null, t);
+            return false;
+        }
+    }
+
+    public @Override char[] read(String key) {
+        Pointer[] found = new Pointer[1];
+        Pointer attributes = LIBRARY.g_array_new(0, 0, GnomeKeyringAttribute_SIZE);
+        try {
+            LIBRARY.gnome_keyring_attribute_list_append_string(attributes, KEY, key);
+            error(GnomeKeyringLibrary.LIBRARY.gnome_keyring_find_items_sync(GNOME_KEYRING_ITEM_GENERIC_SECRET, attributes, found));
+        } finally {
+            LIBRARY.gnome_keyring_attribute_list_free(attributes);
+        }
+        if (found[0] != null) {
+            try {
+                if (LIBRARY.g_list_length(found[0]) > 0) {
+                    GnomeKeyringFound result = LIBRARY.g_list_nth_data(found[0], 0);
+                    if (result != null) {
+                        if (result.secret != null) {
+                            return result.secret.toCharArray();
+                        } else {
+                            LOG.warning("#183670: GnomeKeyringFound.secret == null");
+                            delete(key);
+                        }
+                    } else {
+                        LOG.warning("#183670: GList<GnomeKeyringFound>[0].result == null");
+                    }
+                }
+            } finally {
+                LIBRARY.gnome_keyring_found_list_free(found[0]);
+            }
+        }
+        return null;
+    }
+
+    public @Override void save(String key, char[] password, String description) {
+        Pointer attributes = LIBRARY.g_array_new(0, 0, GnomeKeyringAttribute_SIZE);
+        try {
+            LIBRARY.gnome_keyring_attribute_list_append_string(attributes, KEY, key);
+            int[] item_id = new int[1];
+            error(GnomeKeyringLibrary.LIBRARY.gnome_keyring_item_create_sync(
+                    null, GNOME_KEYRING_ITEM_GENERIC_SECRET, description != null ? description : key, attributes, new String(password), true, item_id));
+        } finally {
+            LIBRARY.gnome_keyring_attribute_list_free(attributes);
+        }
+    }
+
+    public @Override void delete(String key) {
+        Pointer[] found = new Pointer[1];
+        Pointer attributes = LIBRARY.g_array_new(0, 0, GnomeKeyringAttribute_SIZE);
+        try {
+            LIBRARY.gnome_keyring_attribute_list_append_string(attributes, KEY, key);
+            error(GnomeKeyringLibrary.LIBRARY.gnome_keyring_find_items_sync(GNOME_KEYRING_ITEM_GENERIC_SECRET, attributes, found));
+        } finally {
+            LIBRARY.gnome_keyring_attribute_list_free(attributes);
+        }
+        if (found[0] == null) {
+            return;
+        }
+        int id;
+        try {
+            if (LIBRARY.g_list_length(found[0]) > 0) {
+                GnomeKeyringFound result = LIBRARY.g_list_nth_data(found[0], 0);
+                id = result.item_id;
+            } else {
+                id = 0;
+            }
+        } finally {
+            LIBRARY.gnome_keyring_found_list_free(found[0]);
+        }
+        if (id > 0) {
+            if ("SunOS".equals(System.getProperty("os.name")) && "5.10".equals(System.getProperty("os.version"))) { // #185698
+                save(key, new char[0], null); // gnome_keyring_item_delete(null, id, null, null, null) does not seem to do anything
+            } else {
+                error(GnomeKeyringLibrary.LIBRARY.gnome_keyring_item_delete_sync(null, id));
+            }
+        }
+    }
+
+    private static String[] ERRORS = {
+        "OK", // NOI18N
+        "DENIED", // NOI18N
+        "NO_KEYRING_DAEMON", // NOI18N
+        "ALREADY_UNLOCKED", // NOI18N
+        "NO_SUCH_KEYRING", // NOI18N
+        "BAD_ARGUMENTS", // NOI18N
+        "IO_ERROR", // NOI18N
+        "CANCELLED", // NOI18N
+        "KEYRING_ALREADY_EXISTS", // NOI18N
+        "NO_MATCH", // NOI18N
+    };
+    private static void error(int code) {
+        if (code != 0 && code != 9) {
+            LOG.log(Level.WARNING, "gnome-keyring error: {0}", ERRORS[code]);
+        }
+    }
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/impl/Utils.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/impl/Utils.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/impl/Utils.java	(revision 26335)
@@ -0,0 +1,85 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.keyring.impl;
+
+import java.io.File;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import java.util.prefs.Preferences;
+
+public class Utils {
+
+    private Utils() {}
+
+    private static final Logger LOG = Logger.getLogger(Utils.class.getName());
+
+    public static byte[] chars2Bytes(char[] chars) {
+        byte[] bytes = new byte[chars.length * 2];
+        for (int i = 0; i < chars.length; i++) {
+            bytes[i * 2] = (byte) (chars[i] / 256);
+            bytes[i * 2 + 1] = (byte) (chars[i] % 256);
+        }
+        return bytes;
+    }
+
+    public static char[] bytes2Chars(byte[] bytes) {
+        char[] result = new char[bytes.length / 2];
+        for (int i = 0; i < result.length; i++) {
+            result[i] = (char) (((int) bytes[i * 2]) * 256 + (int) bytes[i * 2 + 1]);
+        }
+        return result;
+    }
+
+    /** Tries to set permissions on preferences storage file to -rw------- */
+    public static void goMinusR(Preferences p) {
+        File props = new File(System.getProperty("netbeans.user"), ("config/Preferences" + p.absolutePath()).replace('/', File.separatorChar) + ".properties");
+        if (props.isFile()) {
+            props.setReadable(false, false); // seems to be necessary, not sure why
+            props.setReadable(true, true);
+            LOG.log(Level.FINE, "chmod go-r {0}", props);
+        } else {
+            LOG.log(Level.FINE, "no such file to chmod: {0}", props);
+        }
+    }
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/kde/KWalletProvider.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/kde/KWalletProvider.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/kde/KWalletProvider.java	(revision 26335)
@@ -0,0 +1,238 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2010 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.keyring.kde;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.Arrays;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.netbeans.spi.keyring.KeyringProvider;
+
+/**
+ *
+ * @author psychollek, ynov
+ */
+public class KWalletProvider implements KeyringProvider{
+
+    private static final Logger logger = Logger.getLogger(KWalletProvider.class.getName());
+    private char[] handler = "0".toCharArray();
+    private boolean timeoutHappened = false;
+    private char[] defaultLocalWallet = "kdewallet".toCharArray();
+
+    @Override
+    public boolean enabled(){
+        if (Boolean.getBoolean("netbeans.keyring.no.native")) {
+            logger.fine("native keyring integration disabled");
+            return false;
+        }
+        CommandResult result = runCommand("isEnabled");
+        if(new String(result.retVal).equals("true")) {        
+            return updateHandler();
+        }                   
+        return false;
+    };
+
+    @Override
+    public char[] read(String key){
+        if (updateHandler()){
+            CommandResult result = runCommand("readPassword", handler, getApplicationName(), key.toCharArray(), getApplicationName(true));
+            if (result.exitCode != 0){
+                warning("read action returned not 0 exitCode");
+            }
+            return result.retVal.length > 0 ? result.retVal : null;
+        }
+        return null;
+        //throw new KwalletException("read");
+    };
+
+    @Override
+    public void save(String key, char[] password, String description){
+        //description is forgoten ! kdewallet dosen't have any facility to store
+        //it by default and I don't want to do it by adding new fields to kwallet
+        if (updateHandler()){
+            CommandResult result = runCommand("writePassword", handler , getApplicationName()
+                    , key.toCharArray(), password , getApplicationName(true));
+            if (result.exitCode != 0 || (new String(result.retVal)).equals("-1")){
+                warning("save action failed");
+            }
+            return;
+        }
+        //throw new KwalletException("save");
+    };
+
+    @Override
+    public void delete(String key){
+        if (updateHandler()){
+            CommandResult result = runCommand("removeEntry" ,handler,
+            getApplicationName() , key.toCharArray() , getApplicationName(true));
+             if (result.exitCode != 0  || (new String(result.retVal)).equals("-1")){
+                warning("delete action failed");
+            }
+            return;
+        }
+        //throw new KwalletException("delete");
+    };
+
+    private boolean updateHandler(){
+        if(timeoutHappened) {
+            return false;
+        }
+        handler = new String(handler).equals("")? "0".toCharArray() : handler;
+        CommandResult result = runCommand("isOpen",handler);          
+        if(new String(result.retVal).equals("true")){
+            return true;
+        }
+        char[] localWallet = defaultLocalWallet;
+        result = runCommand("localWallet");                      
+        if(result.exitCode == 0) {                    
+            localWallet = result.retVal;
+        }
+            
+        if(new String(localWallet).contains(".service")) {            
+            //Temporary workaround for the bug in kdelibs/kdeui/util/kwallet.cpp
+            //The bug was fixed http://svn.reviewboard.kde.org/r/5885/diff/
+            //but many people currently use buggy kwallet
+            return false;
+        }
+        result = runCommand("open", localWallet , "0".toCharArray(), getApplicationName(true));
+        if(result.exitCode == 2) { 
+            warning("time out happened while accessing KWallet");
+            //don't try to open KWallet anymore until bug https://bugs.kde.org/show_bug.cgi?id=259229 is fixed
+            timeoutHappened = true;
+            return false;
+        }      
+        if(result.exitCode != 0 || new String(result.retVal).equals("-1")) {
+            warning("failed to access KWallet");
+            return false;
+        }         
+        handler = result.retVal;
+        return true;
+    }
+          
+    
+
+    private CommandResult runCommand(String command,char[]... commandArgs) {
+        String[] argv = new String[commandArgs.length+4];
+        argv[0] = "qdbus";
+        argv[1] = "org.kde.kwalletd";
+        argv[2] = "/modules/kwalletd";
+        argv[3] = "org.kde.KWallet."+command;
+        for (int i = 0; i < commandArgs.length; i++) {
+            //unfortunatelly I cannot pass char[] to the exec in any way - so this poses a security issue with passwords in String() !
+            //TODO: find a way to avoid changing char[] into String
+            argv[i+4] = new String(commandArgs[i]);
+        }
+        Runtime rt = Runtime.getRuntime();
+        String retVal = "";
+        String errVal = "";
+        int exitCode = 0;
+        try {
+            if (logger.isLoggable(Level.FINE)) {
+                logger.log(Level.FINE, "executing {0}", Arrays.toString(argv));
+            }
+            Process pr = rt.exec(argv);
+            
+            BufferedReader input = new BufferedReader(new InputStreamReader(pr.getInputStream()));
+
+            String line;
+            while((line = input.readLine()) != null) {
+                if (!retVal.equals("")){
+                    retVal = retVal.concat("\n");
+                }
+                retVal = retVal.concat(line);
+            }            
+            input.close();
+            input = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
+
+            while((line = input.readLine()) != null) {
+                if (!errVal.equals("")){
+                    errVal = errVal.concat("\n");
+                }
+                errVal = errVal.concat(line);
+            }
+            input.close();
+
+            exitCode = pr.waitFor();
+            if (logger.isLoggable(Level.FINE)) {
+                logger.log(Level.FINE, "application exit with code {0} for commandString: {1}; errVal: {2}",
+                            new Object[]{exitCode, Arrays.toString(argv), errVal});
+            }       
+        } catch (InterruptedException ex) {
+            logger.log(Level.FINE,
+                    "exception thrown while invoking the command \""+Arrays.toString(argv)+"\"",
+                    ex);
+        } catch (IOException ex) {
+            logger.log(Level.FINE,
+                    "exception thrown while invoking the command \""+Arrays.toString(argv)+"\"",
+                    ex);
+        }
+        return new CommandResult(exitCode, retVal.trim().toCharArray(), errVal.trim());
+    }    
+
+    private char[] getApplicationName(){
+        return getApplicationName(false);
+    }
+
+    private char[] getApplicationName(boolean version){
+        return "JOSM".toCharArray();
+    }
+
+    private void warning(String descr) {
+        logger.log(Level.WARNING, "Something went wrong: {0}", descr);
+    }      
+  
+    private class CommandResult {
+        private int exitCode;
+        private char[] retVal;
+        private String errVal;
+
+        public CommandResult(int exitCode, char[] retVal, String errVal) {
+            this.exitCode = exitCode;
+            this.retVal = retVal;
+            this.errVal = errVal;
+        }                        
+    }
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/mac/MacProvider.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/mac/MacProvider.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/mac/MacProvider.java	(revision 26335)
@@ -0,0 +1,115 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.keyring.mac;
+
+import com.sun.jna.Pointer;
+import java.io.UnsupportedEncodingException;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.netbeans.spi.keyring.KeyringProvider;
+
+public class MacProvider implements KeyringProvider {
+
+    private static final Logger LOG = Logger.getLogger(MacProvider.class.getName());
+
+    public boolean enabled() {
+        return true; // test elsewhere if we are on a mac
+    }
+
+    public char[] read(String key) {
+        try {
+            byte[] serviceName = key.getBytes("UTF-8");
+            byte[] accountName = "JOSM".getBytes("UTF-8");
+            int[] dataLength = new int[1];
+            Pointer[] data = new Pointer[1];
+            error("find", SecurityLibrary.LIBRARY.SecKeychainFindGenericPassword(null, serviceName.length, serviceName,
+                    accountName.length, accountName, dataLength, data, null));
+            if (data[0] == null) {
+                return null;
+            }
+            byte[] value = data[0].getByteArray(0, dataLength[0]); // XXX ought to call SecKeychainItemFreeContent
+            return new String(value, "UTF-8").toCharArray();
+        } catch (UnsupportedEncodingException x) {
+            LOG.log(Level.WARNING, null, x);
+            return null;
+        }
+    }
+
+    public void save(String key, char[] password, String description) {
+        delete(key); // XXX supposed to use SecKeychainItemModifyContent instead, but this seems like too much work
+        try {
+            byte[] serviceName = key.getBytes("UTF-8");
+            byte[] accountName = "JOSM".getBytes("UTF-8");
+            // Keychain Access seems to expect UTF-8, so do not use Utils.chars2Bytes:
+            byte[] data = new String(password).getBytes("UTF-8");
+            error("save", SecurityLibrary.LIBRARY.SecKeychainAddGenericPassword(null, serviceName.length, serviceName,
+                    accountName.length, accountName, data.length, data, null));
+        } catch (UnsupportedEncodingException x) {
+            LOG.log(Level.WARNING, null, x);
+        }
+        // XXX use description somehow... better to use SecItemAdd with kSecAttrDescription
+    }
+
+    public void delete(String key) {
+        try {
+            byte[] serviceName = key.getBytes("UTF-8");
+            byte[] accountName = "JOSM".getBytes("UTF-8");
+            Pointer[] itemRef = new Pointer[1];
+            error("find (for delete)", SecurityLibrary.LIBRARY.SecKeychainFindGenericPassword(null, serviceName.length, serviceName,
+                    accountName.length, accountName, null, null, itemRef));
+            if (itemRef[0] != null) {
+                error("delete", SecurityLibrary.LIBRARY.SecKeychainItemDelete(itemRef[0]));
+            }
+        } catch (UnsupportedEncodingException x) {
+            LOG.log(Level.WARNING, null, x);
+        }
+    }
+
+    private static void error(String msg, int code) {
+        if (code != 0 && code != /* errSecItemNotFound, always returned from find it seems */-25300) {
+            // XXX translate, but SecCopyErrorMessageString returns weird CFStringRef
+            LOG.warning(msg + ": " + code);
+        }
+    }
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/mac/SecurityLibrary.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/mac/SecurityLibrary.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/mac/SecurityLibrary.java	(revision 26335)
@@ -0,0 +1,82 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.keyring.mac;
+
+import com.sun.jna.Library;
+import com.sun.jna.Native;
+import com.sun.jna.Pointer;
+
+/**
+ * @see <a href="http://developer.apple.com/mac/library/DOCUMENTATION/Security/Reference/keychainservices/Reference/reference.html">Security Framework Reference</a>
+ */
+public interface SecurityLibrary extends Library {
+
+    SecurityLibrary LIBRARY = (SecurityLibrary) Native.loadLibrary("Security", SecurityLibrary.class);
+
+    int SecKeychainAddGenericPassword(
+            Pointer keychain,
+            int serviceNameLength,
+            byte[] serviceName,
+            int accountNameLength,
+            byte[] accountName,
+            int passwordLength,
+            byte[] passwordData,
+            Pointer itemRef
+            );
+
+    int SecKeychainFindGenericPassword(
+            Pointer keychainOrArray,
+            int serviceNameLength,
+            byte[] serviceName,
+            int accountNameLength,
+            byte[] accountName,
+            int[] passwordLength,
+            Pointer[] passwordData,
+            Pointer[] itemRef
+            );
+
+    int SecKeychainItemDelete(
+            Pointer itemRef
+            );
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/spi/EncryptionProvider.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/spi/EncryptionProvider.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/spi/EncryptionProvider.java	(revision 26335)
@@ -0,0 +1,125 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.keyring.spi;
+
+import java.util.concurrent.Callable;
+import org.netbeans.spi.keyring.KeyringProvider;
+
+/**
+ * A weaker version of {@link KeyringProvider} which can only encrypt passwords securely.
+ * Rather than managing the complete storage of the keyring, a NetBeans-specific keyring
+ * is used, but this provider can encrypt the sensitive contents.
+ * The encryption is assumed to be symmetric but the encryption key should be secured.
+ * If the NetBeans {@link KeyringProvider} is used, the first encryption provider to be found
+ * in global lookup which claims to be enabled will be used;
+ * a standard implementation exists (at position 1000) which uses a simple master password.
+ */
+public interface EncryptionProvider {
+
+    /**
+     * Check whether this provider can be used in the current JVM session.
+     * If integrating a native library, this should attempt to load it.
+     * This method will be called at most once per JVM session,
+     * prior to any other methods in this interface being called.
+     * @return true if this provider should be used, false if not
+     */
+    boolean enabled();
+
+    /**
+     * Define a unique ID for this encryption provider, so that if the same userdir
+     * is reused on machines of different architecture the encrypted passwords will not conflict.
+     * @return an arbitrary ID specific to the algorithm
+     */
+    String id();
+
+    /**
+     * Encrypt a password or other sensitive data so that only the current user can decrypt it.
+     * @param cleartext some data (may be nulled out after this call)
+     * @return encrypted data
+     * @throws Exception if anything goes wrong
+     */
+    byte[] encrypt(char[] cleartext) throws Exception;
+
+    /**
+     * Decrypt a password or other sensitive data.
+     * @param ciphertext encrypted data
+     * @return cleartext (may be nulled out after this call)
+     * @throws Exception if anything goes wrong
+     */
+    char[] decrypt(byte[] ciphertext) throws Exception;
+
+    /**
+     * Called if {@link #decrypt} produced incorrect results on a sample key.
+     * The provider can react by prompting again for a master password, for example.
+     * <p>Implementations which do not support dynamic changes to the encryption
+     * key or method should return false from this method.
+     * @return true if an attempt was made to correct the encryption, false if nothing has changed
+     */
+    boolean decryptionFailed();
+
+    /**
+     * Offers a callback in case the encryption needs to change.
+     * For example, this may be employed if the user asks to change a master password.
+     * During the callback, the provider will be asked to decrypt existing secrets
+     * using the old encryption key; then {@link #encryptionChanged}
+     * will be called; finally the secrets will be reencrypted using the new encryption key.
+     * <p>Implementations which do not support dynamic changes to the encryption
+     * key or method may ignore this method.
+     * @param callback a callback which the provider may store and later call
+     */
+    void encryptionChangingCallback(Callable<Void> callback);
+
+    /**
+     * See {@link #encryptionChangingCallback} for description.
+     * <p>Implementations which do not support dynamic changes to the encryption
+     * key or method may ignore this method.
+     */
+    void encryptionChanged();
+
+    /**
+     * Tells the provider whether this is a new, empty keyring.
+     * @param fresh true if this is a new keyring, false if it has been used before
+     */
+    void freshKeyring(boolean fresh);
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/win32/Win32Protect.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/win32/Win32Protect.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/modules/keyring/win32/Win32Protect.java	(revision 26335)
@@ -0,0 +1,165 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.modules.keyring.win32;
+
+import com.sun.jna.Memory;
+import com.sun.jna.Native;
+import com.sun.jna.Pointer;
+import com.sun.jna.Structure;
+import com.sun.jna.WString;
+import com.sun.jna.win32.StdCallLibrary;
+import java.util.Arrays;
+import java.util.concurrent.Callable;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import org.netbeans.modules.keyring.impl.Utils;
+import org.netbeans.modules.keyring.spi.EncryptionProvider;
+
+/**
+ * Data protection utility for Microsoft Windows.
+ * XXX org.tmatesoft.svn.core.internal.util.jna.SVNWinCrypt is a possibly more robust implementation
+ * (though it seems to set CRYPTPROTECT_UI_FORBIDDEN which we do not necessarily want).
+ */
+public class Win32Protect implements EncryptionProvider {
+
+    private static final Logger LOG = Logger.getLogger(Win32Protect.class.getName());
+    
+    public @Override boolean enabled() {
+        // asssume, we have windows os
+        try {
+            if (CryptLib.INSTANCE == null) {
+                LOG.fine("loadLibrary -> null");
+                return false;
+            }
+            return true;
+        } catch (Throwable t) {
+            LOG.log(Level.FINE, null, t);
+            return false;
+        }
+    }
+
+    public @Override String id() {
+        return "win32"; // NOI18N
+    }
+
+    public @Override byte[] encrypt(char[] cleartext) throws Exception {
+        byte[] cleartextB = Utils.chars2Bytes(cleartext);
+        CryptIntegerBlob input = new CryptIntegerBlob();
+        input.store(cleartextB);
+        Arrays.fill(cleartextB, (byte) 0);
+        CryptIntegerBlob output = new CryptIntegerBlob();
+        if (!CryptLib.INSTANCE.CryptProtectData(input, null, null, null, null, 0, output)) {
+            throw new Exception("CryptProtectData failed: " + Native.getLastError());
+        }
+        input.zero();
+        return output.load();
+    }
+
+    public @Override char[] decrypt(byte[] ciphertext) throws Exception {
+        CryptIntegerBlob input = new CryptIntegerBlob();
+        input.store(ciphertext);
+        CryptIntegerBlob output = new CryptIntegerBlob();
+        if (!CryptLib.INSTANCE.CryptUnprotectData(input, null, null, null, null, 0, output)) {
+            throw new Exception("CryptUnprotectData failed: " + Native.getLastError());
+        }
+        byte[] result = output.load();
+        // XXX gives CCE because not a Memory: output.zero();
+        char[] cleartext = Utils.bytes2Chars(result);
+        Arrays.fill(result, (byte) 0);
+        return cleartext;
+    }
+
+    public @Override boolean decryptionFailed() {
+        return false; // not much to do about it
+    }
+
+    public @Override void encryptionChangingCallback(Callable<Void> callback) {}
+
+    public @Override void encryptionChanged() {
+        assert false;
+    }
+
+    public @Override void freshKeyring(boolean fresh) {}
+
+    public interface CryptLib extends StdCallLibrary {
+        CryptLib INSTANCE = (CryptLib) Native.loadLibrary("Crypt32", CryptLib.class); // NOI18N
+        /** @see <a href="http://msdn.microsoft.com/en-us/library/aa380261(VS.85,printer).aspx">Reference</a> */
+        boolean CryptProtectData(
+                CryptIntegerBlob pDataIn,
+                WString szDataDescr,
+                CryptIntegerBlob pOptionalEntropy,
+                Pointer pvReserved,
+                Pointer pPromptStruct,
+                int dwFlags,
+                CryptIntegerBlob pDataOut
+        )/* throws LastErrorException*/;
+        /** @see <a href="http://msdn.microsoft.com/en-us/library/aa380882(VS.85,printer).aspx">Reference</a> */
+        boolean CryptUnprotectData(
+                CryptIntegerBlob pDataIn,
+                WString[] ppszDataDescr,
+                CryptIntegerBlob pOptionalEntropy,
+                Pointer pvReserved,
+                Pointer pPromptStruct,
+                int dwFlags,
+                CryptIntegerBlob pDataOut
+        )/* throws LastErrorException*/;
+    }
+    
+    public static class CryptIntegerBlob extends Structure {
+        public int cbData;
+        public /*byte[]*/Pointer pbData;
+        byte[] load() {
+            return pbData.getByteArray(0, cbData);
+            // XXX how to free pbData? [Kernel32]LocalFree?
+        }
+        void store(byte[] data) {
+            cbData = data.length;
+            pbData = new Memory(data.length);
+            pbData.write(0, data, 0, cbData);
+        }
+        void zero() {
+            ((Memory) pbData).clear();
+        }
+    }
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/spi/keyring/KeyringProvider.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/spi/keyring/KeyringProvider.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/netbeans/spi/keyring/KeyringProvider.java	(revision 26335)
@@ -0,0 +1,91 @@
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2010 Oracle and/or its affiliates. All rights reserved.
+ *
+ * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
+ * Other names may be trademarks of their respective owners.
+ *
+ * The contents of this file are subject to the terms of either the GNU
+ * General Public License Version 2 only ("GPL") or the Common
+ * Development and Distribution License("CDDL") (collectively, the
+ * "License"). You may not use this file except in compliance with the
+ * License. You can obtain a copy of the License at
+ * http://www.netbeans.org/cddl-gplv2.html
+ * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
+ * specific language governing permissions and limitations under the
+ * License.  When distributing the software, include this License Header
+ * Notice in each file and include the License file at
+ * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the GPL Version 2 section of the License file that
+ * accompanied this code. If applicable, add the following below the
+ * License Header, with the fields enclosed by brackets [] replaced by
+ * your own identifying information:
+ * "Portions Copyrighted [year] [name of copyright owner]"
+ *
+ * If you wish your version of this file to be governed by only the CDDL
+ * or only the GPL Version 2, indicate your decision by adding
+ * "[Contributor] elects to include this software in this distribution
+ * under the [CDDL or GPL Version 2] license." If you do not indicate a
+ * single choice of license, a recipient has the option to distribute
+ * your version of this file under either the CDDL, the GPL Version 2 or
+ * to extend the choice of license to its licensees as provided above.
+ * However, if you add GPL Version 2 code and therefore, elected the GPL
+ * Version 2 license, then the option applies only if the new code is
+ * made subject to such option by the copyright holder.
+ *
+ * Contributor(s):
+ *
+ * Portions Copyrighted 2009 Sun Microsystems, Inc.
+ */
+
+package org.netbeans.spi.keyring;
+
+/**
+ * Provider for a keyring.
+ * Should be registered in global lookup.
+ * Providers will be searched in the order in which they are encountered
+ * until one which is {@link #enabled} is found.
+ * There is a default platform-independent implementation at position 1000
+ * which should always be enabled.
+ * <p>All SPI calls are made from one thread at a time, so providers need not be synchronized.
+ */
+public interface KeyringProvider {
+
+    /**
+     * Check whether this provider can be used in the current JVM session.
+     * If integrating a native keyring, this should attempt to load related
+     * libraries and check whether they can be found.
+     * This method will be called at most once per JVM session,
+     * prior to any other methods in this interface being called.
+     * @return true if this provider should be used, false if not
+     */
+    boolean enabled();
+
+    /**
+     * Read a key from the ring.
+     * @param key the identifier of the key
+     * @return its value if found (elements may be later nulled out), else null if not present
+     */
+    char[] read(String key);
+
+    /**
+     * Save a key to the ring.
+     * If it could not be saved, do nothing.
+     * If the key already existed, overwrite the password.
+     * @param key a key identifier
+     * @param password the password or other sensitive information associated with the key
+     *                 (elements will be later nulled out)
+     * @param description a user-visible description of the key (may be null)
+     */
+    void save(String key, char[] password, String description);
+
+    /**
+     * Delete a key from the ring.
+     * If the key was not in the ring to begin with, do nothing.
+     * @param key a key identifier
+     */
+    void delete(String key);
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/InitializationWizard.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/InitializationWizard.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/InitializationWizard.java	(revision 26335)
@@ -0,0 +1,554 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.npm;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.BorderLayout;
+import java.awt.CardLayout;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.net.Authenticator.RequestorType;
+import java.net.PasswordAuthentication;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.BorderFactory;
+import javax.swing.Box;
+import javax.swing.BoxLayout;
+import javax.swing.ButtonGroup;
+import javax.swing.GroupLayout;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JSeparator;
+import javax.swing.KeyStroke;
+import javax.swing.SwingConstants;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.EtchedBorder;
+
+import org.netbeans.spi.keyring.KeyringProvider;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.oauth.OAuthToken;
+import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel;
+import org.openstreetmap.josm.gui.widgets.HtmlPanel;
+import org.openstreetmap.josm.io.auth.CredentialsAgentException;
+import org.openstreetmap.josm.io.auth.CredentialsManager;
+import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.PlatformHookOsx;
+import org.openstreetmap.josm.tools.PlatformHookUnixoid;
+import org.openstreetmap.josm.tools.PlatformHookWindows;
+import org.openstreetmap.josm.tools.WindowGeometry;
+
+public class InitializationWizard extends JDialog {
+
+    protected boolean canceled = false;
+    protected JButton btnCancel, btnBack, btnNext;
+    protected Action nextAction, finishAction;
+    protected JPanel cardPanel;
+    
+    List<WizardPanel> panels = new ArrayList<WizardPanel>();
+    int panelIndex;
+    
+    private CardLayout cardLayout;
+    
+    public InitializationWizard() {
+        super(JOptionPane.getFrameForComponent(Main.parent), tr("Native password manager plugin"), ModalityType.DOCUMENT_MODAL);
+        build();
+        NPMType npm = detectNativePasswordManager();
+        WizardPanel firstPanel;
+        if (npm == null) {
+            firstPanel = new NothingFoundPanel();
+        } else {
+            firstPanel = new SelectionPanel(npm, this);
+        }
+        panelIndex = 0;
+        panels.add(firstPanel);
+        cardPanel.add(firstPanel.getPanel(), firstPanel.getId());
+        
+        updateButtons();
+    }
+    
+    private void build() {
+        Container c = getContentPane();
+        c.setLayout(new BorderLayout());
+        addWindowListener(new WindowEventHandler());
+
+        getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "cancel");
+        getRootPane().getActionMap().put("cancel", new CancelAction());
+
+        cardLayout = new CardLayout();
+        cardPanel = new JPanel(cardLayout);
+        cardPanel.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
+        c.add(cardPanel, BorderLayout.CENTER);
+        
+        nextAction = new NextAction();
+        finishAction = new FinishAction();
+        btnCancel = new JButton(new CancelAction());
+        btnBack = new JButton(new BackAction());
+        btnNext = new JButton(nextAction);
+        
+        Box buttonsBox = new Box(BoxLayout.X_AXIS);
+        buttonsBox.setBorder(new EmptyBorder(new Insets(5, 10, 5, 10)));
+        buttonsBox.add(btnCancel);
+        buttonsBox.add(Box.createHorizontalStrut(30));
+        buttonsBox.add(btnBack);
+        buttonsBox.add(Box.createHorizontalStrut(10));
+        buttonsBox.add(btnNext);
+        
+        JPanel buttonsPanel = new JPanel(new BorderLayout());
+        buttonsPanel.add(new JSeparator(), BorderLayout.NORTH);
+        buttonsPanel.add(buttonsBox, BorderLayout.EAST);
+        c.add(buttonsPanel, BorderLayout.SOUTH);
+    }
+        
+    private void updateButtons() {
+        btnBack.setEnabled(panelIndex > 0);
+        if (panels.get(panelIndex).isLast()) {
+            btnNext.setAction(finishAction);
+        } else {
+            btnNext.setAction(nextAction);
+        }
+    }
+    
+    /**
+     * A WizardPanel represents one page in the wizard dialog.
+     * The user usually proceeds from one panel to the next, but can go back as well.
+     */
+    public interface WizardPanel {
+        /* unique id */
+        String getId();
+        
+        /* get the Panel Compoment */
+        JPanel getPanel();
+        
+        /* return true if this page is the last and the 'next' button should change into 'finish' */
+        boolean isLast();
+        
+        /* Provide the next WizardPanel. 
+         * Not called when isLast() returns true. */
+        WizardPanel provideNext();
+        
+        /* The action to execute, when the user finall hits 'OK' and not 'Cancel' */
+        void onOkAction();
+    }
+    
+    abstract private static class AbstractWizardPanel implements WizardPanel {
+        
+        /**
+         * Put a logo to the left, as is customary for wizard dialogs
+         */
+        @Override
+        public JPanel getPanel() {
+            JPanel p = new JPanel(new BorderLayout());
+            JLabel image = new JLabel(ImageProvider.get("lock-large"));
+            image.setBorder(
+                    BorderFactory.createCompoundBorder(
+                        BorderFactory.createEtchedBorder(EtchedBorder.RAISED),
+                        BorderFactory.createEmptyBorder(10, 10, 10, 10)));
+            image.setVerticalAlignment(SwingConstants.TOP);
+            p.add(image, BorderLayout.WEST);
+            
+            JPanel content = getContentPanel();
+            content.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
+            p.add(content, BorderLayout.CENTER);
+            
+            return p;
+        }
+        
+        @Override
+        public String getId() {
+            return getClass().getCanonicalName();
+        }
+
+        abstract protected JPanel getContentPanel();
+    }
+    
+    private static class NothingFoundPanel extends AbstractWizardPanel {
+
+        JCheckBox cbDoNotShowAgain;
+        
+        @Override
+        public boolean isLast() {
+            return true;
+        }
+        
+        @Override
+        public WizardPanel provideNext() {
+            return null;
+        }
+
+        @Override
+        public void onOkAction() {
+            if (cbDoNotShowAgain.isSelected()) {
+                NPMPlugin.turnOffPermanently();
+            }
+        }
+
+        @Override
+        protected JPanel getContentPanel() {
+            JPanel p = new JPanel();
+            GroupLayout layout = new GroupLayout(p);
+            p.setLayout(layout);
+
+            HtmlPanel intro = new HtmlPanel("<html>"+
+                    tr("No native password manager could be found!")+"<br>"+
+                    tr("Depending on your Operating Stystem / Distribution, you may have to create a default keyring / wallet first.")+
+                    "</html>");
+
+            cbDoNotShowAgain = new JCheckBox("Do not show this wizard again on next start");
+            layout.setHorizontalGroup(
+                layout.createParallelGroup()
+                    .addComponent(intro)
+                    .addComponent(cbDoNotShowAgain)
+            );
+
+            layout.setVerticalGroup(
+                layout.createSequentialGroup()
+                    .addComponent(intro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(cbDoNotShowAgain)
+            );
+            
+            return p;
+        }
+    }
+    
+    private static class SelectionPanel extends AbstractWizardPanel implements ActionListener {
+        
+        private NPMType type;
+        private InitializationWizard wizard;
+        
+        private JRadioButton rbManage, rbPlain;
+                
+        public SelectionPanel(NPMType type, InitializationWizard wizard) {
+            this.type = type;
+            this.wizard = wizard;
+        }
+        
+        @Override
+        public boolean isLast() {
+            return (rbPlain != null && rbPlain.isSelected()) || !hasUnprotectedCedentials();
+        }
+
+        @Override
+        public WizardPanel provideNext() {
+            return new DeleteOldCredentialsPanel();
+        }
+        
+        @Override
+        protected JPanel getContentPanel() {
+            JPanel p = new JPanel();
+            GroupLayout layout = new GroupLayout(p);
+            p.setLayout(layout);
+
+            HtmlPanel intro = new HtmlPanel("<html><b>"+type.getIntroText()+"</b></html>");
+            rbManage = new JRadioButton("<html>"+type.getSelectionText()+"</html>");
+            rbPlain = new JRadioButton("<html>"+tr("No thanks, use JOSM's plain text preferences storage")+"</html>");
+            rbManage.addActionListener(this);
+            rbPlain.addActionListener(this);
+            
+            rbManage.setSelected(true);
+            ButtonGroup group = new ButtonGroup();
+            group.add(rbManage);
+            group.add(rbPlain);
+
+            layout.setHorizontalGroup(
+                layout.createParallelGroup()
+                    .addComponent(intro)
+                    .addComponent(rbManage)
+                    .addComponent(rbPlain)
+            );
+
+            layout.setVerticalGroup(
+                layout.createSequentialGroup()
+                    .addComponent(intro, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(rbManage)
+                    .addComponent(rbPlain)
+            );
+            
+            return p;
+        }
+        
+        @Override
+        public void onOkAction() {
+            if (rbManage.isSelected()) {
+                NPMPlugin.selectAndSave(type);
+            } else {
+                wizard.setCanceled(true);
+                NPMPlugin.turnOffPermanently();
+            }
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent e) {
+            wizard.updateButtons();
+        }
+    }
+
+    private static class DeleteOldCredentialsPanel extends AbstractWizardPanel {
+        
+        private JRadioButton rbClear, rbKeep;
+        
+        @Override
+        public boolean isLast() {
+            return true;
+        }
+
+        @Override
+        public WizardPanel provideNext() {
+            return null;
+        }
+
+        @Override
+        public JPanel getContentPanel() {
+            JPanel p = new JPanel();
+            GroupLayout layout = new GroupLayout(p);
+            p.setLayout(layout);
+
+            HtmlPanel l = new HtmlPanel();
+            l.setText("<html><b>"+tr("Found sensitive data that is still saved"
+                    + " in JOSM's preference file (plain text).")+"<b></html>");
+            rbClear = new JRadioButton("<html>"+tr("Erase and transfer to password manager")+"</html>");
+            rbKeep = new JRadioButton("<html>"+tr("No, just keep it")+"</html>");
+            rbClear.setSelected(true);
+            ButtonGroup group = new ButtonGroup();
+            group.add(rbClear);
+            group.add(rbKeep);
+
+            layout.setHorizontalGroup(
+                layout.createParallelGroup()
+                    .addComponent(l)
+                    .addComponent(rbClear)
+                    .addComponent(rbKeep)
+            );
+
+            layout.setVerticalGroup(
+                layout.createSequentialGroup()
+                    .addComponent(l, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                    .addComponent(rbClear)
+                    .addComponent(rbKeep)
+            );
+            
+            return p;
+        }
+
+        @Override
+        public void onOkAction() {
+            
+            CredentialsManager cm = CredentialsManager.getInstance();
+            
+            String server_username = Main.pref.get("osm-server.username", null);
+            String server_password = Main.pref.get("osm-server.password", null);
+            if (server_username != null || server_password != null) {
+                try {
+                    cm.store(RequestorType.SERVER, new PasswordAuthentication(string(server_username), toCharArray(server_password)));
+                    if (rbClear.isSelected()) {
+                        Main.pref.put("osm-server.username", null);
+                        Main.pref.put("osm-server.password", null);
+                    }
+                } catch (CredentialsAgentException ex) {
+                    ex.printStackTrace();
+                }
+            }
+            
+            String proxy_username = Main.pref.get(ProxyPreferencesPanel.PROXY_USER, null);
+            String proxy_password = Main.pref.get(ProxyPreferencesPanel.PROXY_PASS, null);
+            if (proxy_username != null || proxy_password != null) {
+                try {
+                    cm.store(RequestorType.PROXY, new PasswordAuthentication(string(proxy_username), toCharArray(proxy_password)));
+                    if (rbClear.isSelected()) {
+                        Main.pref.put(ProxyPreferencesPanel.PROXY_USER, null);
+                        Main.pref.put(ProxyPreferencesPanel.PROXY_PASS, null);
+                    }
+                } catch (CredentialsAgentException ex) {
+                    ex.printStackTrace();
+                }
+            }
+            
+            String oauth_key = Main.pref.get("oauth.access-token.key", null);
+            String oauth_secret = Main.pref.get("oauth.access-token.secret", null);
+            if (oauth_key != null || oauth_secret != null) {
+                try {
+                    cm.storeOAuthAccessToken(new OAuthToken(string(oauth_key), string(oauth_secret)));
+                    if (rbClear.isSelected()) {
+                        Main.pref.put("oauth.access-token.key", null);
+                        Main.pref.put("oauth.access-token.secret", null);
+                    }
+                } catch (CredentialsAgentException ex) {
+                    ex.printStackTrace();
+                }
+            }
+        }
+    }
+
+    private final static String NPM = "Native Password Manager Plugin: ";
+
+    private static NPMType detectNativePasswordManager() {
+        NPMType[] potentialManagers;
+        
+        if (Main.platform instanceof PlatformHookUnixoid) {
+            potentialManagers = new NPMType[] { NPMType.GNOME_KEYRING, NPMType.KWALLET };
+        } else if (Main.platform instanceof PlatformHookOsx) {
+            potentialManagers = new NPMType[] { NPMType.KEYCHAIN };
+        } else if (Main.platform instanceof PlatformHookWindows) {
+            potentialManagers = new NPMType[] { NPMType.CRYPT32 };
+        } else
+            throw new AssertionError();
+            
+        for (NPMType manager : potentialManagers) {
+            System.out.println(NPM + "Looking for " + manager.getName());
+            KeyringProvider provider = manager.getProvider();
+            if (provider.enabled()) {
+                System.out.println(NPM + "Found " + manager.getName());
+                return manager;
+            }
+        }
+        return null;
+    }
+    
+    private static boolean hasUnprotectedCedentials() {
+        return 
+            Main.pref.get("osm-server.username", null) != null ||
+            Main.pref.get("osm-server.password", null) != null ||
+            Main.pref.get(ProxyPreferencesPanel.PROXY_USER, null) != null ||
+            Main.pref.get(ProxyPreferencesPanel.PROXY_PASS, null) != null ||
+            Main.pref.get("oauth.access-token.key", null) != null ||
+            Main.pref.get("oauth.access-token.secret", null) != null;
+    }
+    
+    public void showDialog() {
+        pack();
+        setVisible(true);
+    }
+    
+    @Override
+    public void setVisible(boolean visible) {
+        if (visible) {
+            new WindowGeometry(
+                    getClass().getName() + ".geometry",
+                    WindowGeometry.centerInWindow(
+                            getParent(),
+                            new Dimension(600,400)
+                    )
+            ).applySafe(this);
+        } else if (!visible && isShowing()){
+            new WindowGeometry(this).remember(getClass().getName() + ".geometry");
+        }
+        super.setVisible(visible);
+    }
+    
+    public boolean isCanceled() {
+        return canceled;
+    }
+
+    protected void setCanceled(boolean canceled) {
+        this.canceled = canceled;
+    }
+
+    class CancelAction extends AbstractAction {
+        public CancelAction() {
+            putValue(NAME, tr("Cancel"));
+            putValue(SMALL_ICON, ImageProvider.get("cancel"));
+            putValue(SHORT_DESCRIPTION, tr("Close the dialog and discard all changes"));
+        }
+
+        public void cancel() {
+            setCanceled(true);
+            setVisible(false);
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent evt) {
+            cancel();
+        }
+    }
+
+    class BackAction extends AbstractAction {
+        public BackAction() {
+            putValue(NAME, tr("Back"));
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "previous"));
+            putValue(SHORT_DESCRIPTION, tr("Go to the previous page"));
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent evt) {
+            if (panelIndex <= 0)
+                throw new RuntimeException();
+            panelIndex--;
+            cardLayout.show(cardPanel, panels.get(panelIndex).getId());
+            updateButtons();
+        }
+    }
+    
+    class NextAction extends AbstractAction {
+        public NextAction() {
+            putValue(NAME, tr("Next"));
+            putValue(SMALL_ICON, ImageProvider.get("dialogs", "next"));
+            putValue(SHORT_DESCRIPTION, tr("Proceed and go to the next page"));
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent evt) {
+            if (panelIndex == panels.size() - 1) {
+                WizardPanel next = panels.get(panelIndex).provideNext();
+                cardPanel.add(next.getPanel(), next.getId());
+                panels.add(next);
+            }
+            panelIndex++;
+            cardLayout.show(cardPanel, panels.get(panelIndex).getId());
+            updateButtons();
+        }
+    }
+
+    class FinishAction extends AbstractAction {
+        public FinishAction() {
+            putValue(NAME, tr("Finish"));
+            putValue(SMALL_ICON, ImageProvider.get("ok"));
+            putValue(SHORT_DESCRIPTION, tr("Confirm the setup and close this dialog"));
+        }
+
+        @Override
+        public void actionPerformed(ActionEvent evt) {
+            for (int i=0; i<=panelIndex; ++i) {
+                if (isCanceled()) {
+                    break;
+                }
+                panels.get(i).onOkAction();
+            }
+            setVisible(false);
+        }
+    }
+
+    class WindowEventHandler extends WindowAdapter {
+        @Override
+        public void windowClosing(WindowEvent arg0) {
+            new CancelAction().cancel();
+        }
+    }
+
+    public static char[] toCharArray(String s) {
+        if (s == null)
+            return new char[0];
+        else
+            return s.toCharArray();
+    }
+    
+    public static String string(String s) {
+        if (s == null)
+            return "";
+        else
+            return s;
+    }
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgent.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgent.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgent.java	(revision 26335)
@@ -0,0 +1,249 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.npm;
+
+import java.awt.Component;
+import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.Utils.equal;
+
+import java.net.Authenticator.RequestorType;
+import java.net.PasswordAuthentication;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.zip.CRC32;
+import javax.swing.text.html.HTMLEditorKit;
+
+import org.netbeans.spi.keyring.KeyringProvider;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.oauth.OAuthToken;
+import org.openstreetmap.josm.gui.preferences.server.OsmApiUrlInputPanel;
+import org.openstreetmap.josm.gui.preferences.server.ProxyPreferencesPanel;
+import org.openstreetmap.josm.gui.widgets.HtmlPanel;
+import org.openstreetmap.josm.io.auth.AbstractCredentialsAgent;
+import org.openstreetmap.josm.io.auth.CredentialsAgentException;
+import org.openstreetmap.josm.tools.Utils;
+
+public class NPMCredentialsAgent extends AbstractCredentialsAgent {
+
+    private KeyringProvider provider;
+    private NPMType type;
+    
+    /**
+     * Cache the results since there might be pop ups and password prompts from
+     * the native manager. This can get annoying, if it shows too often.
+     * 
+     * Yes, there is another cache in AbstractCredentialsAgent. It is used
+     * to avoid prompting the user for login multiple times in one session,
+     * when they decide not to save the credentials.
+     * In contrast, this cache avoids read request the the backend in general.
+     */
+    private Map<RequestorType, PasswordAuthentication> credentialsCache = new HashMap<RequestorType, PasswordAuthentication>();
+    private OAuthToken oauthCache;
+    
+    public NPMCredentialsAgent(NPMType type) {
+        this.type = type;
+    }
+    
+    private KeyringProvider getProvider() {
+        if (provider == null) {
+            provider = type.getProvider();
+        }
+        return provider;
+    }
+    
+    protected String getServerDescriptor() {
+        String pref = Main.pref.getPreferenceFile().getAbsolutePath();
+        
+        String url =  Main.pref.get("osm-server.url", null);
+        if (url == null) {
+            url = OsmApiUrlInputPanel.defaulturl;
+        }
+        
+        CRC32 id = new CRC32();
+        id.update((pref+"/"+url).getBytes());
+        
+        String hash = Integer.toHexString((int)id.getValue());
+
+        return "JOSM.native-password-manager-plugin.api."+hash;
+    }
+    
+    protected String getProxyDescriptor() {
+        String pref = Main.pref.getPreferenceFile().getAbsolutePath();
+        String host = Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_HOST, "");
+        String port = Main.pref.get(ProxyPreferencesPanel.PROXY_HTTP_PORT, "");
+        
+        CRC32 id = new CRC32();
+        id.update((pref+"/"+host+"/"+port).getBytes());
+
+        String hash = Integer.toHexString((int)id.getValue());
+
+        return "JOSM.native-password-manager-plugin.proxy."+hash;
+    }
+    
+    protected String getOAuthDescriptor() {
+        String pref = Main.pref.getPreferenceFile().getAbsolutePath();
+        // TODO: put more identifying data here
+        
+        CRC32 id = new CRC32();
+        id.update((pref).getBytes());
+
+        String hash = Integer.toHexString((int)id.getValue());
+
+        return "JOSM.native-password-manager-plugin.oauth."+hash;
+    }
+    
+    @Override
+    public PasswordAuthentication lookup(RequestorType rt) throws CredentialsAgentException {
+        PasswordAuthentication cache = credentialsCache.get(rt);
+        if (cache != null) 
+            return cache;
+        String user;
+        char[] password;
+        PasswordAuthentication auth;
+        switch(rt) {
+            case SERVER:
+                user = stringNotNull(getProvider().read(getServerDescriptor()+".username"));
+                password = getProvider().read(getServerDescriptor()+".password");
+                auth = new PasswordAuthentication(user, password == null ? new char[0] : password);
+                break;
+            case PROXY:
+                user = stringNotNull(getProvider().read(getProxyDescriptor()+".username"));
+                password = getProvider().read(getProxyDescriptor()+".password");
+                auth = new PasswordAuthentication(user, password == null ? new char[0] : password);
+                break;
+            default: throw new IllegalStateException();
+        }
+        credentialsCache.put(rt, auth);
+        return auth;
+    }
+
+    @Override
+    public void store(RequestorType rt, PasswordAuthentication credentials) throws CredentialsAgentException {
+        char[] username, password;
+        if (credentials == null) {
+            username = null;
+            password = null;
+        } else {
+            username = credentials.getUserName() == null ? null : credentials.getUserName().toCharArray();
+            password = credentials.getPassword();
+        }
+        if (username != null && username.length == 0) {
+            username = null;
+        }
+        // password could be empty string in theory, so don't set to null if empty
+        String prefix, usernameDescription, passwordDescription;
+        switch(rt) {
+            case SERVER:
+                prefix = getServerDescriptor();
+                usernameDescription = tr("JOSM/OSM API/Username");
+                passwordDescription = tr("JOSM/OSM API/Password");
+                break;
+            case PROXY:
+                prefix = getProxyDescriptor();
+                usernameDescription = tr("JOSM/Proxy/Username");
+                passwordDescription = tr("JOSM/Proxy/Password");
+                break;
+            default: throw new IllegalStateException();
+        }
+        if (username == null) {
+            getProvider().delete(prefix+".username");
+            getProvider().delete(prefix+".password");
+            credentialsCache.remove(rt);
+        } else {
+            getProvider().save(prefix+".username", username, usernameDescription);
+            if (password == null) {
+                getProvider().delete(prefix+".password");
+            } else {
+                getProvider().save(prefix+".password", password, passwordDescription);
+            }
+            credentialsCache.put(rt, new PasswordAuthentication(stringNotNull(username), password));
+        }
+    }
+
+    @Override
+    public OAuthToken lookupOAuthAccessToken() throws CredentialsAgentException {
+        if (oauthCache != null)
+            return oauthCache;
+        String prolog = getOAuthDescriptor();
+        char[] key = getProvider().read(prolog+".key");
+        char[] secret = getProvider().read(prolog+".secret");
+        return new OAuthToken(stringNotNull(key), stringNotNull(secret));
+    }
+
+    @Override
+    public void storeOAuthAccessToken(OAuthToken oat) throws CredentialsAgentException {
+        String key, secret;
+        if (oat == null) {
+            key = null;
+            secret = null;
+        }
+        else {
+            key = oat.getKey();
+            secret = oat.getSecret();
+        }
+        String prolog = getOAuthDescriptor();
+        if (key == null || equal(key, "") || secret == null || equal(secret, "")) {
+            getProvider().delete(prolog+".key");
+            getProvider().delete(prolog+".secret");
+            oauthCache = null;
+        } else {
+            getProvider().save(prolog+".key", key.toCharArray(), tr("JOSM/OAuth/OSM API/Key"));
+            getProvider().save(prolog+".secret", secret.toCharArray(), tr("JOSM/OAuth/OSM API/Secret"));
+            oauthCache = new OAuthToken(key, secret);
+        }
+    }
+
+    private static String stringNotNull(char[] charData) {
+        if (charData == null)
+            return "";
+        return String.valueOf(charData);
+    }
+
+    @Override
+    public Component getPreferencesDecorationPanel() {
+        HtmlPanel pnlMessage = new HtmlPanel();
+        HTMLEditorKit kit = (HTMLEditorKit)pnlMessage.getEditorPane().getEditorKit();
+        kit.getStyleSheet().addRule(".warning-body {background-color:rgb(253,255,221);padding: 10pt; border-color:rgb(128,128,128);border-style: solid;border-width: 1px;}");
+        StringBuilder text = new StringBuilder();
+        text.append("<html><body>"
+                    + "<p class=\"warning-body\">"
+                    + "<strong>"+tr("Native Password Manager Plugin")+"</strong><br>"
+                    + tr("The username and password is protected by {0}.", type.getName())
+        );
+        List<String> sensitive = new ArrayList<String>();
+        if (Main.pref.get("osm-server.username", null) != null) {
+            sensitive.add(tr("username"));
+        }
+        if (Main.pref.get("osm-server.password", null) != null) {
+            sensitive.add(tr("password"));
+        }
+        if (Main.pref.get(ProxyPreferencesPanel.PROXY_USER, null) != null) {
+            sensitive.add(tr("proxy username"));
+        }
+        if (Main.pref.get(ProxyPreferencesPanel.PROXY_PASS, null) != null) {
+            sensitive.add(tr("proxy password"));
+        }
+        if (Main.pref.get("oauth.access-token.key", null) != null) {
+            sensitive.add(tr("oauth key"));
+        }
+        if (Main.pref.get("oauth.access-token.secret", null) != null) {
+            sensitive.add(tr("oauth secret"));
+        }
+        if (!sensitive.isEmpty()) {
+            text.append(tr("<br><strong>Warning:</strong> There may be sensitive data left in your preference file. (")
+                    + Utils.join(", ", sensitive)
+                    + ")"
+            );
+        }
+        pnlMessage.setText(text.toString());
+        return pnlMessage;
+    }
+    
+    @Override
+    public String getSaveUsernameAndPasswordCheckboxText() {
+        return tr("Save user and password ({0})", type.getName());
+    }
+
+    
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgentFactory.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgentFactory.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMCredentialsAgentFactory.java	(revision 26335)
@@ -0,0 +1,24 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.npm;
+
+import org.openstreetmap.josm.io.auth.CredentialsAgent;
+import org.openstreetmap.josm.io.auth.CredentialsManager.CredentialsAgentFactory;
+
+public class NPMCredentialsAgentFactory implements CredentialsAgentFactory {
+    private CredentialsAgent instance;
+        
+    private NPMType type;
+
+    public NPMCredentialsAgentFactory(NPMType type) {
+        this.type = type;
+    }
+
+    @Override
+    public CredentialsAgent getCredentialsAgent() {
+        if (instance == null) {
+            instance = new NPMCredentialsAgent(type);
+        }
+        return instance;
+    }
+
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMPlugin.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMPlugin.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMPlugin.java	(revision 26335)
@@ -0,0 +1,49 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.npm;
+
+import javax.swing.SwingUtilities;
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.io.auth.CredentialsManager;
+
+import org.openstreetmap.josm.plugins.Plugin;
+import org.openstreetmap.josm.plugins.PluginInformation;
+
+public class NPMPlugin extends Plugin {
+    
+    public final static String NPMPLUGIN_KEY = "plugins.native-password-manager.";
+    
+    public NPMPlugin(PluginInformation info) {
+        super(info);
+        initialize();
+    }
+    
+    private void initialize() {
+        String pref = Main.pref.get(NPMPLUGIN_KEY+"agent", null);
+        if ("off".equals(pref)) return;
+        NPMType sel = NPMType.fromPrefString(pref);
+        if (sel != null) {
+            CredentialsManager.registerCredentialsAgentFactory(
+                    new NPMCredentialsAgentFactory(sel)
+            );
+        } else {
+            SwingUtilities.invokeLater(new Runnable() {
+                @Override
+                public void run() {
+                        final InitializationWizard wizard = new InitializationWizard();
+                        wizard.showDialog();
+                }
+            });
+        }
+    }
+
+    public static void selectAndSave(NPMType type) {
+        CredentialsManager.registerCredentialsAgentFactory(
+                new NPMCredentialsAgentFactory(type)
+        );
+        Main.pref.put(NPMPLUGIN_KEY+"agent", type.toPrefString());
+    }
+    
+    public static void turnOffPermanently() {
+        Main.pref.put(NPMPLUGIN_KEY+"agent", "off");
+    }
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMType.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMType.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/NPMType.java	(revision 26335)
@@ -0,0 +1,101 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.npm;
+
+import org.netbeans.modules.keyring.gnome.GnomeProvider;
+import org.netbeans.modules.keyring.kde.KWalletProvider;
+import org.netbeans.modules.keyring.mac.MacProvider;
+import org.netbeans.spi.keyring.KeyringProvider;
+import static org.openstreetmap.josm.tools.I18n.tr;
+import static org.openstreetmap.josm.tools.Utils.equal;
+
+public enum NPMType {
+    PLAIN(
+            "josm-standard",
+            null,
+            "default",
+            tr("Plain text, JOSM default")
+    ),
+    GNOME_KEYRING(
+            "gnome-keyring",
+            GnomeProvider.class,
+            "gnome-keyring",
+            tr("Use {0}", "gnome-keyring")
+    ),
+    KWALLET(
+            "kwallet",
+            KWalletProvider.class,
+            "KWallet",
+            tr("Use {0}", "KWallet")),
+    KEYCHAIN(
+            "keychain",
+            MacProvider.class,
+            "Apple Keychain",
+            tr("Use {0}", "Mac OS X Keychain")),
+    CRYPT32(
+            "crypt32", 
+            Win32Provider.class,
+            "Windows data encryption",
+            tr("Encrypt data with Windows logon credentials")
+    );
+    
+    private static String genericIntro(String name) {
+        return tr("The native password manager plugin detected {0} on your system.", name);
+//                + "You can let {1} handle your sensitive data from now on. "
+//                + "This means your username and password is no longer saved in plain text in your preferences file. "
+//                + "(It is still transferred over the network unencrypted, though.)", name, name);
+    }
+    
+    private final String prefString;
+    private final Class<? extends KeyringProvider> providerClass;
+    private final String name;
+    private KeyringProvider provider;
+    private final String introText;
+    private final String selectionText;
+
+    NPMType(String prefString, Class<? extends KeyringProvider> providerClass, String name, String selectionText) {
+        this.prefString = prefString;
+        this.providerClass = providerClass;
+        this.name = name;
+        this.introText = genericIntro(name);
+        this.selectionText = selectionText;
+    }
+
+    public static NPMType fromPrefString(String pref) {
+        for (NPMType t : NPMType.values()) {
+            if (equal(pref, t.prefString)) {
+                return t;
+            }
+        }
+        return null;
+    }
+
+    public String toPrefString() {
+        return prefString;
+    }
+
+    public String getSelectionText() {
+        return selectionText;
+    }
+
+    public String getIntroText() {
+        return introText;
+    }
+
+    public String getName() {
+        return name;
+    }
+    
+    public KeyringProvider getProvider() {
+        if (providerClass == null) return null;
+        if (provider == null) {
+            try {
+                provider = providerClass.newInstance();
+            } catch (InstantiationException ex) {
+                throw new RuntimeException();
+            } catch (IllegalAccessException ex) {
+                throw new RuntimeException();
+            }
+        }
+        return provider;
+    }
+}
Index: /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/Win32Provider.java
===================================================================
--- /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/Win32Provider.java	(revision 26335)
+++ /applications/editors/josm/plugins/native-password-manager/src/org/openstreetmap/josm/plugins/npm/Win32Provider.java	(revision 26335)
@@ -0,0 +1,27 @@
+// License: GPL. For details, see LICENSE file.
+package org.openstreetmap.josm.plugins.npm;
+
+import org.netbeans.modules.keyring.fallback.FallbackProvider;
+import org.netbeans.modules.keyring.win32.Win32Protect;
+import org.openstreetmap.josm.Main;
+
+public class Win32Provider extends FallbackProvider {
+    
+    private static class JOSMPreferences implements IPreferences {
+        @Override public String get(String key, String def) {
+            return Main.pref.get(key, def);
+        }
+
+        @Override public void put(String key, String val) {
+            Main.pref.put(key, val);
+        }
+
+        @Override public void remove(String key) {
+            Main.pref.put(key, null);
+        }
+    }
+    
+    public Win32Provider() {
+        super(new Win32Protect(), new JOSMPreferences());
+    }
+}
