Compare commits

..

3 Commits

Author SHA1 Message Date
thayes%netscape.com
e275f0f89d Initial version for AIM branch.
git-svn-id: svn://10.0.0.236/branches/THAYES_AIM_V1_BRANCH@101565 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 23:52:08 +00:00
thayes%netscape.com
ccfff9e735 Initial version.
git-svn-id: svn://10.0.0.236/branches/THAYES_AIM_V1_BRANCH@101563 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-21 23:49:52 +00:00
(no author)
4ebaeeab22 This commit was manufactured by cvs2svn to create branch
'THAYES_AIM_V1_BRANCH'.

git-svn-id: svn://10.0.0.236/branches/THAYES_AIM_V1_BRANCH@101226 18797224-902f-48f8-a5cc-f745e15eee43
2001-08-16 18:50:58 +00:00
433 changed files with 28373 additions and 105982 deletions

View File

@@ -0,0 +1,94 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Brian Ryner <bryner@netscape.com>
#
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
ifeq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
LOADABLE_ROOT_MODULE = nssckbi$(DLL_SUFFIX)
else
LOADABLE_ROOT_MODULE = libnssckbi$(DLL_SUFFIX)
endif
FREEBL_PURE32_MODULE = libfreebl_pure32_3$(DLL_SUFFIX)
FREEBL_HYBRID_MODULE = libfreebl_hybrid_3$(DLL_SUFFIX)
# NSS makefiles are not safe for parallel execution.
DEFAULT_GMAKE_FLAGS = MAKE="$(MAKE) -j1" -j1
DEFAULT_GMAKE_FLAGS += MOZILLA_INCLUDES="-I$(MOZ_BUILD_ROOT)/dist/include/nspr -I$(MOZ_BUILD_ROOT)/dist/include/dbm"
DEFAULT_GMAKE_FLAGS += SOURCE_MD_DIR=$(MOZ_BUILD_ROOT)/dist
DEFAULT_GMAKE_FLAGS += DIST=$(MOZ_BUILD_ROOT)/dist
DEFAULT_GMAKE_FLAGS += MOZILLA_CLIENT=1
DEFAULT_GMAKE_FLAGS += NO_MDUPDATE=1
ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
DEFAULT_GMAKE_FLAGS += BUILD_TREE=$(MOZ_BUILD_ROOT)
endif
ifndef MOZ_DEBUG
DEFAULT_GMAKE_FLAGS += BUILD_OPT=1
endif
ifdef GNU_CC
DEFAULT_GMAKE_FLAGS += NS_USE_GCC=1 NS_USE_NATIVE=
else
DEFAULT_GMAKE_FLAGS += NS_USE_GCC= NS_USE_NATIVE=1
endif
ifdef USE_N32
# It is not really necessary to specify USE_PTHREADS=1. USE_PTHREADS
# merely adds _PTH to coreconf's OBJDIR name.
DEFAULT_GMAKE_FLAGS += USE_N32=1 USE_PTHREADS=1
endif
ifdef HAVE_64BIT_OS
DEFAULT_GMAKE_FLAGS += USE_64=1
endif
SUBMAKEFILES = ssl/Makefile pki/Makefile
include $(topsrcdir)/config/rules.mk
depend dependclean export::
$(MAKE) -C ssl $@
$(MAKE) -C pki $@
install::
$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS)
cd $(DIST)/lib; cp -f libmozdbm_s.$(LIB_SUFFIX) libdbm.$(LIB_SUFFIX)
$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS)
$(INSTALL) -m 755 $(DIST)/lib/$(LOADABLE_ROOT_MODULE) $(DIST)/bin
ifneq (,$(filter SunOS HP-UX,$(OS_ARCH)))
ifneq ($(OS_TEST),i86pc)
ifndef HAVE_64BIT_OS
$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_PURE32_MODULE) $(DIST)/bin
$(INSTALL) -m 755 $(DIST)/lib/$(FREEBL_HYBRID_MODULE) $(DIST)/bin
endif
endif
endif
$(MAKE) -C ssl $@
$(MAKE) -C pki $@
clean clobber clobber_all realclean distclean::
$(MAKE) -C ssl $@
$(MAKE) -C pki $@
$(MAKE) -C $(topsrcdir)/security/coreconf $(DEFAULT_GMAKE_FLAGS) clean
$(MAKE) -C $(topsrcdir)/security/nss/lib $(DEFAULT_GMAKE_FLAGS) clean

View File

@@ -0,0 +1,41 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
DEPTH=..\..
include <$(DEPTH)/config/config.mak>
DIRS = ssl pki
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,30 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Terry Hayes <thayes@netscape.com>
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
DIRS = public resources src
include $(topsrcdir)/config/rules.mk

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Terry Hayes <thayes@netscape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
DEPTH=..\..\..
include <$(DEPTH)/config/config.mak>
DIRS = public src resources
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,49 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo <javi@netscape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
MODULE = pippki
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
XPIDLSRCS = \
nsIPKIParamBlock.idl \
nsIASN1Outliner.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,57 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
MODULE = pippki
DEPTH=..\..\..\..
IGNORE_MANIFEST=1
DLLNAME = pippki
PDBFILE = $(DLLNAME).pdb
MAPFILE = $(DLLNAME).map
DLL = .\$(OBJDIR)\$(DLLNAME).dll
MAKE_OBJ_TYPE = DLL
include <$(DEPTH)/config/config.mak>
XPIDL_INCLUDES=-I$(DEPTH)\dist\idl
XPIDLSRCS= \
.\nsIPKIParamBlock.idl \
.\nsIASN1Outliner.idl \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Ian McGreer <mcgreer@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "nsISupports.idl"
#include "nsIOutlinerView.idl"
#include "nsIX509Cert.idl"
[scriptable, uuid(c727b2f2-1dd1-11b2-95df-f63c15b4cd35)]
interface nsIASN1Outliner : nsIOutlinerView {
void loadASN1Structure(in nsIASN1Object asn1Object);
wstring getDisplayData(in unsigned long index);
};
%{C++
#define NS_ASN1OUTLINER_CONTRACTID "@mozilla.org/security/nsASN1Outliner;1"
%}

View File

@@ -0,0 +1,54 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Ian McGreer <mcgreer@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "nsISupports.idl"
#include "nsIOutlinerView.idl"
#include "nsIX509Cert.idl"
[scriptable, uuid(c727b2f2-1dd1-11b2-95df-f63c15b4cd35)]
interface nsIASN1Outliner : nsIOutlinerView {
void loadASN1Structure(in nsIASN1Object asn1Object);
wstring getDisplayData(in unsigned long index);
};
%{C++
#define NS_ASN1OUTLINER_CONTRACTID "@mozilla.org/security/nsASN1Outliner;1"
%}

View File

@@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "nsISupports.idl"
[scriptable, uuid(b6fe3d78-1dd1-11b2-9058-ced9016984c8)]
interface nsIPKIParamBlock : nsISupports {
void setISupportAtIndex(in PRInt32 index, in nsISupports object);
nsISupports getISupportAtIndex(in PRInt32 index);
};

View File

@@ -0,0 +1,33 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Terry Hayes <thayes@netscape.com>
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
include $(topsrcdir)/config/rules.mk
install::
$(REGCHROME) content pippki pippki.jar
$(REGCHROME) locale en-US/pippki en-US.jar

View File

@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="CAOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="CACerts">
<html>&certmgr.cas;</html>
<separator class="thin"/>
<outliner id="ca-outliner" multiple="true"
onselect="ca_enableButtons()" flex="1">
<outlinercol id="certcol" label="&certmgr.certname;" primary="true"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="tokencol" label="&certmgr.tokenname;"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<!-- <outlinercol id="certdbkeycol" collapsed="true" flex="1"/> -->
<outlinerbody flex="1" ondblclick="viewCerts();"/>
</outliner>
<hbox>
<button id="ca_viewButton" class="normal"
label="&certmgr.view.label;"
disabled="true" oncommand="viewCerts();"/>
<button id="ca_editButton" class="normal"
label="&certmgr.edit.label;"
disabled="true" oncommand="editCerts();"/>
<!-- future - import a DER cert?
<button id="ca_addButton" class="normal"
label="&certmgr.add.label;"
oncommand="addCerts();"/>
-->
<button id="ca_deleteButton" class="normal"
label="&certmgr.delete.label;"
disabled="true" oncommand="deleteCerts();"/>
</hbox>
</vbox>
</overlay>

View File

@@ -0,0 +1,84 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="MineOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="myCerts">
<html>&certmgr.mine;</html>
<separator class="thin"/>
<outliner id="user-outliner" multiple="true"
onselect="mine_enableButtons()" flex="1">
<outlinercol id="certcol" label="&certmgr.certname;" primary="true"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="tokencol" label="&certmgr.tokenname;"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="verifiedcol"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="purposecol" label="&certmgr.purpose;"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="issuedcol" label="&certmgr.issued;"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="expiredcol" label="&certmgr.expires;"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<!-- <outlinercol id="certdbkeycol" collapsed="true" flex="1"/> -->
<outlinerbody flex="1" ondblclick="viewCerts();"/>
</outliner>
<hbox>
<button id="mine_viewButton" class="normal"
label="&certmgr.view.label;"
disabled="true" oncommand="viewCerts();"/>
<button id="mine_backupButton" class="normal"
label="&certmgr.backup.label;"
disabled="true" oncommand="backupCerts();"/>
<button id="mine_backupAllButton" class="normal"
label="&certmgr.backupall.label;"
oncommand="backupAllCerts();"/>
<button id="mine_restoreButton" class="normal"
label="&certmgr.restore.label;"
oncommand="restoreCerts();"/>
<button id="mine_deleteButton" class="normal"
label="&certmgr.delete.label;"
disabled="true" oncommand="deleteCerts();"/>
</hbox>
</vbox>
</overlay>

View File

@@ -0,0 +1,197 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<!-- This file extends "chrome://navigator/content/pageInfo.xul" -->
<!DOCTYPE overlay SYSTEM "chrome://pippki/locale/PageInfoOverlay.dtd">
<overlay id="pipPageInfoOverlayID"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript">
<![CDATA[
var security = {
// Display the server certificate (static)
viewCert : function () {
var cert = security._cert;
if (cert) cert.view();
},
_getSecurityInfo : function() {
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsISSLStatusProvider = Components.interfaces.nsISSLStatusProvider;
// Get the window for this information
var w;
if ("arguments" in window && window.arguments.length > 1 && window.arguments[0])
w = window.arguments[0];
else
w = window.opener.frames[0];
var ui = security._getSecurityUI();
var sp = ui.QueryInterface(nsISSLStatusProvider);
var status = sp.SSLStatus;
if (status) {
var cert = status.serverCert;
var issuerName;
issuerName = this.mapIssuerOrganization(cert.issuerOrganization);
if (!issuerName) issuerName = cert.issuerName;
return {
hostName : w.location.host,
cAName : issuerName,
encryptionAlgorithm : status.cipherName,
encryptionStrength : status.secretKeyLength,
cert : cert
};
} else {
return {
hostName : w.location.host,
cAName : "",
encryptionAlgorithm : "",
encryptionStrength : 0,
cert : null
};
}
},
// Find the secureBrowserUI object (if present)
_getSecurityUI : function() {
return window.opener.gBrowser.boxObject.getPropertyAsSupports("secureBrowserUI");
},
// Interface for mapping a certificate issuer organization to
// the value to be displayed.
// Bug 82017 - this implementation should be moved to pipnss C++ code
mapIssuerOrganization: function(name) {
if (!name) return null;
if (name == "RSA Data Security, Inc.") return "Verisign, Inc.";
// No mapping required
return name;
},
_cert : null
};
function securityOnLoad() {
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var info = security._getSecurityInfo();
var idHdr;
var message1;
var message2;
/* Set the identification messages */
if (info.cert)
{
idHdr = bundle.GetStringFromName("pageInfo_WebSiteVerified");
document.getElementById("security-identity").setAttribute("value", idHdr);
message1 = bundle.formatStringFromName("pageInfo_Identity_Verified",
[ info.hostName, info.cAName ],
2);
setText("security-identity-text", message1);
var viewText = bundle.GetStringFromName("pageInfo_ViewCertificate");
setText("security-view-text", viewText);
security._cert = info.cert;
} else {
idHdr = bundle.GetStringFromName("pageInfo_SiteNotVerified");
document.getElementById("security-identity").setAttribute("value", idHdr);
document.getElementById("security-view-cert").setAttribute("disabled", "true");
document.getElementById("security-view-cert").setAttribute("hidden", "true");
}
var hdr;
var msg1;
var msg2;
/* Set the encryption messages */
if (info.encryptionStrength >= 90) {
hdr = bundle.formatStringFromName("pageInfo_StrongEncryption",
[ info.encryptionAlgorithm, info.encryptionStrength+"" ], 2);
document.getElementById("security-privacy").setAttribute("value", hdr);
msg1 = bundle.GetStringFromName("pageInfo_Privacy_Strong1");
setText("security-privacy-msg1", msg1);
msg2 = bundle.GetStringFromName("pageInfo_Privacy_Strong2");
setText("security-privacy-msg2", msg2);
security._cert = info.cert;
} else if (info.encryptionStrength > 0) {
hdr = bundle.formatStringFromName("pageInfo_WeakEncryption",
[ info.encryptionAlgorithm, info.encryptionStrength+"" ], 2);
document.getElementById("security-privacy").setAttribute("value", hdr);
msg1 = bundle.formatStringFromName("pageInfo_Privacy_Weak1",
[ info.hostName ], 1);
setText("security-privacy-msg1", msg1);
msg2 = bundle.GetStringFromName("pageInfo_Privacy_Weak2");
setText("security-privacy-msg2", msg2);
} else {
hdr = bundle.GetStringFromName("pageInfo_NoEncryption");
document.getElementById("security-privacy").setAttribute("value", hdr);
msg1 = bundle.formatStringFromName("pageInfo_Privacy_None1",
[ info.hostName ], 1);
setText("security-privacy-msg1", msg1);
msg2 = bundle.GetStringFromName("pageInfo_Privacy_None2");
setText("security-privacy-msg2", msg2);
}
}
/* Register for pageInfo onload calls */
onLoadRegistry.push(securityOnLoad);
]]>
</script>
<tabs id="tabs">
<tab id="securityTab" label="&pageInfo.securityTab;"/>
</tabs>
<tabpanels id="tabpanels">
<vbox id="securityPanel" flex="1">
<text id="security-identity" class="header label"/>
<html id="security-identity-text" flex="1"/>
<hbox>
<button id="security-view-cert" class="normal" label="&pageInfo.view.label;"
oncommand="security.viewCert();"/>
<html id="security-view-text" flex="1"/>
</hbox>
<separator class="groove"/>
<text id="security-privacy" class="header label"/>
<vbox flex="1">
<html id="security-privacy-msg1"/>
<html id="security-privacy-msg2"/>
</vbox>
</vbox>
</tabpanels>
</overlay>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<!-- This file overlays "chrome://communicator/content/pref/preftree.xul" -->
<!DOCTYPE overlay SYSTEM "chrome://pippki/locale/PrefOverlay.dtd">
<overlay id="pipPrefOverlayID"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<treechildren id="securityChildren">
<treeitem id="masterpassItem">
<treerow>
<treecell class="treecell-indent" url="chrome://pippki/content/pref-masterpass.xul"
label="&masterpass.label;"/>
</treerow>
</treeitem>
<treeitem id="sslItem">
<treerow>
<treecell class="treecell-indent" url="chrome://pippki/content/pref-ssl.xul"
label="&ssl.label;"/>
</treerow>
</treeitem>
<treeitem id="certItem">
<treerow>
<treecell class="treecell-indent" url="chrome://pippki/content/pref-certs.xul"
label="&certs.label;"/>
</treerow>
</treeitem>
<treeitem id="validationItem">
<treerow>
<treecell class="treecell-indent" url="chrome://pippki/content/pref-validation.xul"
label="&validation.label;"/>
</treerow>
</treeitem>
</treechildren>
</overlay>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="WebSitesOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox id="webCerts">
<html>&certmgr.websites;</html>
<separator class="thin"/>
<outliner id="server-outliner" multiple="true"
onselect="websites_enableButtons()" flex="1">
<outlinercol id="certcol" label="&certmgr.certname;" primary="true"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<splitter class="tree-splitter"/>
<outlinercol id="tokencol" label="&certmgr.tokenname;"
class="outlinercol-header outlinercell-inset-header"
flex="1"/>
<!-- <outlinercol id="certdbkeycol" collapsed="true" flex="1"/> -->
<outlinerbody flex="1" ondblclick="viewCerts();"/>
</outliner>
<hbox>
<button id="websites_viewButton" class="normal"
label="&certmgr.view.label;"
disabled="true" oncommand="viewCerts();"/>
<button id="websites_editButton" class="normal"
label="&certmgr.edit.label;"
disabled="true" oncommand="editCerts();"/>
<!-- future - import a DER cert?
<button id="websites_addButton" class="normal"
label="&certmgr.add.label;"
oncommand="addCerts();"/>
-->
<button id="websites_deleteButton" class="normal"
label="&certmgr.delete.label;"
disabled="true" oncommand="deleteCerts();"/>
</hbox>
</vbox>
</overlay>

View File

@@ -0,0 +1,26 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Rangan Sen <rangansen@netscape.com>
*/
function doOK()
{
window.close();
}

View File

@@ -0,0 +1,53 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Rangan Sen <rangansen@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="cacertexists"
title="&caCertExists.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="setWindowName();">
<script type="application/x-javascript" src="chrome://pippki/content/cacertexists.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox flex="1">
<html>&caCertExists.message;</html>
<separator/>
<hbox align="center">
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="doOK();"/>
</hbox>
<separator/>
</vbox>
</window>

View File

@@ -0,0 +1,52 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
- Javier Delgadillo <javi@netscape.com>
-->
<!DOCTYPE overlay SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="certDumpOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox class="box-padded" id="certPrettyPrint" flex="1">
<text class="header" value="&certmgr.hierarchy.label;"/>
<tree class="inset" id="treesetDump" rows="4"
onselect="updateCertDump();">
<treecolgroup>
<treecol flex="1"/>
</treecolgroup>
<treechildren id="chainDump"/>
</tree>
<outliner class="inset" id="prettyDumpOutliner" style="height:150px">
<outlinercol flex ="1" id="certDataCol" label="&certmgr.details.label;"
ignoreincolumnpicker="true" class="header outlinercol-header" primary="true"/>
<splitter/>
<outlinerbody flex="1" onselect="displaySelected();"/>
</outliner>
<text class="header" value="&certmgr.fields.label;"/>
<textbox class="inset" id="certDumpVal" multiline="true" rows="8"
readonly="true" style="font-family: -moz-fixed;"/>
</vbox>
</overlay>

View File

@@ -0,0 +1,347 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Ian McGreer <mcgreer@netscape.com>
*/
const nsIFilePicker = Components.interfaces.nsIFilePicker;
const nsFilePicker = "@mozilla.org/filepicker;1";
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsICertOutliner = Components.interfaces.nsICertOutliner;
const nsCertOutliner = "@mozilla.org/security/nsCertOutliner;1";
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsDialogParamBlock = "@mozilla.org/embedcomp/dialogparam;1";
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsPKIParamBlock = "@mozilla.org/security/pkiparamblock;1";
var helpURL = "chrome://help/content/help.xul";
var key;
var selected_certs = [];
var certdb;
var caOutlinerView;
var serverOutlinerView;
//var emailOutlinerView;
var userOutlinerView;
function LoadCerts()
{
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
caOutlinerView = Components.classes[nsCertOutliner]
.createInstance(nsICertOutliner);
caOutlinerView.loadCerts(nsIX509Cert.CA_CERT);
document.getElementById('ca-outliner')
.outlinerBoxObject.view = caOutlinerView;
serverOutlinerView = Components.classes[nsCertOutliner]
.createInstance(nsICertOutliner);
serverOutlinerView.loadCerts(nsIX509Cert.SERVER_CERT);
document.getElementById('server-outliner')
.outlinerBoxObject.view = serverOutlinerView;
/*
emailOutlinerView = Components.classes[nsCertOutliner]
.createInstance(nsICertOutliner);
emailOutlinerView.loadCerts(nsIX509Cert.EMAIL_CERT);
document.getElementById('email-outliner')
.outlinerBoxObject.view = emailOutlinerView;
*/
userOutlinerView = Components.classes[nsCertOutliner]
.createInstance(nsICertOutliner);
userOutlinerView.loadCerts(nsIX509Cert.USER_CERT);
document.getElementById('user-outliner')
.outlinerBoxObject.view = userOutlinerView;
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var verifiedColText;
if (certdb.ocspOn) {
verifiedColText = bundle.GetStringFromName("certmgr.verifiedNoOCSP");
} else {
verifiedColText = bundle.GetStringFromName("certmgr.verified");
}
var verifiedCol = document.getElementById('verifiedcol');
verifiedCol.setAttribute('label', verifiedColText);
}
function ReloadCerts()
{
caOutlinerView.loadCerts(nsIX509Cert.CA_CERT);
serverOutlinerView.loadCerts(nsIX509Cert.SERVER_CERT);
//emailOutlinerView.loadCerts(nsIX509Cert.EMAIL_CERT);
userOutlinerView.loadCerts(nsIX509Cert.USER_CERT);
}
function getSelectedTab()
{
var selTab = document.getElementById('certMgrTabbox').selectedTab;
var selTabID = selTab.getAttribute('id');
if (selTabID == 'mine_tab') {
key = "?my_certs";
} else if (selTabID == "websites_tab") {
key = "?web_certs";
} else if (selTabID == "ca_tab") {
key = "?ca_certs";
}
var context = helpURL + key;
return context;
}
function doHelpButton() {
var uri = getSelectedTab();
openHelp(uri);
}
function getSelectedCerts()
{
var ca_tab = document.getElementById("ca_tab");
var mine_tab = document.getElementById("mine_tab");
//var others_tab = document.getElementById("others_tab");
var websites_tab = document.getElementById("websites_tab");
var items = null;
if (ca_tab.selected) {
items = caOutlinerView.selection;
} else if (mine_tab.selected) {
items = userOutlinerView.selection;
/*
} else if (others_tab.selected) {
items = emailOutlinerView.selection;
*/
} else if (websites_tab.selected) {
items = serverOutlinerView.selection;
}
selected_certs = [];
var cert = null;
var nr = 0;
if (items != null) nr = items.getRangeCount();
if (nr > 0) {
for (var i=0; i<nr; i++) {
var o1 = {};
var o2 = {};
items.getRangeAt(i, o1, o2);
var min = o1.value;
var max = o2.value;
for (var j=min; j<=max; j++) {
if (ca_tab.selected) {
cert = caOutlinerView.getCert(j);
} else if (mine_tab.selected) {
cert = userOutlinerView.getCert(j);
/*
} else if (others_tab.selected) {
cert = emailOutlinerView.getCert(j);
*/
} else if (websites_tab.selected) {
cert = serverOutlinerView.getCert(j);
}
if (cert)
selected_certs[selected_certs.length] = cert;
}
}
}
}
function ca_enableButtons()
{
var items = caOutlinerView.selection;
var nr = items.getRangeCount();
var toggle="false";
if (nr == 0) {
toggle="true";
}
var edit_toggle=toggle;
/*
var edit_toggle="true";
if (nr > 0) {
for (var i=0; i<nr; i++) {
var o1 = {};
var o2 = {};
items.getRangeAt(i, o1, o2);
var min = o1.value;
var max = o2.value;
var stop = false;
for (var j=min; j<=max; j++) {
var tokenName = items.outliner.view.getCellText(j, "tokencol");
if (tokenName == "Builtin Object Token") { stop = true; } break;
}
if (stop) break;
}
if (i == nr) {
edit_toggle="false";
}
}
*/
var enableViewButton=document.getElementById('ca_viewButton');
enableViewButton.setAttribute("disabled",toggle);
var enableEditButton=document.getElementById('ca_editButton');
enableEditButton.setAttribute("disabled",edit_toggle);
var enableDeleteButton=document.getElementById('ca_deleteButton');
enableDeleteButton.setAttribute("disabled",toggle);
}
function mine_enableButtons()
{
var items = userOutlinerView.selection;
var toggle="false";
if (items.getRangeCount() == 0) {
toggle="true";
}
var enableViewButton=document.getElementById('mine_viewButton');
enableViewButton.setAttribute("disabled",toggle);
var enableBackupButton=document.getElementById('mine_backupButton');
enableBackupButton.setAttribute("disabled",toggle);
var enableDeleteButton=document.getElementById('mine_deleteButton');
enableDeleteButton.setAttribute("disabled",toggle);
}
function websites_enableButtons()
{
var items = serverOutlinerView.selection;
var toggle="false";
if (items.getRangeCount() == 0) {
toggle="true";
}
var enableViewButton=document.getElementById('websites_viewButton');
enableViewButton.setAttribute("disabled",toggle);
var enableEditButton=document.getElementById('websites_editButton');
enableEditButton.setAttribute("disabled",toggle);
var enableDeleteButton=document.getElementById('websites_deleteButton');
enableDeleteButton.setAttribute("disabled",toggle);
}
function backupCerts()
{
getSelectedCerts();
var numcerts = selected_certs.length;
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker);
fp.init(window,
bundle.GetStringFromName("chooseP12BackupFileDialog"),
nsIFilePicker.modeSave);
fp.appendFilter("PKCS12 Files", "*.p12");
fp.appendFilters(nsIFilePicker.filterAll);
var rv = fp.show();
if (rv == nsIFilePicker.returnOK || rv == nsIFilePicker.returnReplace) {
certdb.exportPKCS12File(null, fp.file,
selected_certs.length, selected_certs);
}
}
function backupAllCerts()
{
// Select all rows, then call doBackup()
var items = userOutlinerView.selection.selectAll();
backupCerts();
}
function editCerts()
{
getSelectedCerts();
var numcerts = selected_certs.length;
for (var t=0; t<numcerts; t++) {
var cert = selected_certs[t];
var certkey = cert.dbKey;
var ca_tab = document.getElementById("ca_tab");
if (ca_tab.selected) {
window.openDialog('chrome://pippki/content/editcacert.xul', certkey,
'chrome,width=100,resizable=1,modal');
} else {
window.openDialog('chrome://pippki/content/editsslcert.xul', certkey,
'chrome,width=100,resizable=1,modal');
}
}
}
function restoreCerts()
{
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker);
fp.init(window,
bundle.GetStringFromName("chooseP12RestoreFileDialog"),
nsIFilePicker.modeOpen);
fp.appendFilter("PKCS12 Files", "*.p12;*.pfx");
fp.appendFilters(nsIFilePicker.filterAll);
if (fp.show() == nsIFilePicker.returnOK) {
var certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
certdb.importPKCS12File(null, fp.file);
}
userOutlinerView.loadCerts(nsIX509Cert.USER_CERT);
}
function deleteCerts()
{
getSelectedCerts();
var params = Components.classes[nsDialogParamBlock].getService(nsIDialogParamBlock);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var selTab = document.getElementById('certMgrTabbox').selectedTab;
var selTabID = selTab.getAttribute('id');
if (selTabID == 'mine_tab')
{
params.SetString(1,bundle.GetStringFromName("deleteUserCertFlag"));
}
else if (selTabID == "websites_tab")
{
params.SetString(1,bundle.GetStringFromName("deleteSslCertFlag"));
}
else if (selTabID == "ca_tab")
{
params.SetString(1,bundle.GetStringFromName("deleteCaCertFlag"));
}
else
{
return;
}
var numcerts = selected_certs.length;
params.SetInt(2,numcerts);
for (var t=0; t<numcerts; t++)
{
var cert = selected_certs[t];
params.SetString(t+3, cert.dbKey);
}
window.openDialog('chrome://pippki/content/deletecert.xul', "",
'chrome,resizable=1,modal',params);
ReloadCerts();
}
function viewCerts()
{
getSelectedCerts();
var numcerts = selected_certs.length;
for (var t=0; t<numcerts; t++) {
selected_certs[t].view();
}
}
/* XXX future - import a DER cert from a file? */
function addCerts()
{
alert("Add cert chosen");
}

View File

@@ -0,0 +1,83 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/MineOverlay.xul"?>
<!-- XXX
<?xul-overlay href="chrome://pippki/content/othercertsOverlay.xul"?>
-->
<?xul-overlay href="chrome://pippki/content/WebSitesOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/CAOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<window id="certmanager"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&certmgr.title;"
onload="LoadCerts();">
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/certManager.js"/>
<hbox flex="1">
<grid flex="1">
<column flex="1"/>
<rows>
<row flex="1">
<tabbox flex="1" orient="vertical">
<tabs id="certMgrTabbox" orient="horizontal">
<tab id="mine_tab" label="&certmgr.tab.mine;"/>
<!--
<tab id="others_tab" label="&certmgr.tab.others;"/>
-->
<tab id="websites_tab" label="&certmgr.tab.websites;"/>
<tab id="ca_tab" label="&certmgr.tab.ca;" selected="true"/>
</tabs>
<tabpanels flex="1">
<vbox id="myCerts" flex="1"/>
<!--
<vbox id="othersCerts" flex="1"/>
-->
<vbox id="webCerts" flex="1"/>
<vbox id="CACerts" flex="1"/>
</tabpanels>
</tabbox>
</row>
<row>
<hbox flex="1">
<button id="HelpButton" class="normal"
label="&certmgr.help.label;"
accesskey="h"
oncommand="doHelpButton();"/>
</hbox>
</row>
</rows>
</grid>
</hbox>
</window>

View File

@@ -0,0 +1,81 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
- Javier Delgadillo <javi@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<?xul-overlay href="chrome://pippki/content/viewCertDetails.xul"?>
<?xul-overlay href="chrome://pippki/content/certDump.xul"?>
<window id="certDetails"
title="&certmgr.certdetail.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="setWindowName();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/viewCertDetails.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close()"/>
</keyset>
<grid flex="1">
<column flex="1"/>
<rows autostretch="always">
<row flex="1">
<tabbox flex="1" orient="vertical">
<tabs orient="horizontal">
<tab id="general_tab" label="&certmgr.detail.general_tab.title;"/>
<tab id="prettyprint_tab" label="&certmgr.detail.prettyprint_tab.title;"/>
</tabs>
<tabpanels flex="1">
<vbox id="general_info" flex="1"/>
<vbox id="certPrettyPrint" flex="1"/>
</tabpanels>
</tabbox>
</row>
<row>
<separator class="thin"/>
</row>
<row>
<hbox align="right" flex="1">
<button id="HelpButton" class="normal"
label="&certmgr.help.label;"
accesskey="h"
oncommand="openHelp('chrome://help/content/help.xul?cert_details');"/>
<button id="closeButton" class="normal"
label="&certmgr.close.label;"
accesskey="c"
oncommand="window.close();"/>
</hbox>
</row>
</rows>
</grid>
</window>

View File

@@ -0,0 +1,108 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="set_password" title="&setPassword.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://pippki/content/password.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox style="margin: 5px;" flex="1">
<hbox>
<text value="&setPassword.tokenName.label;:"/>
<text id="tokenName" />
<!--
<menulist id="signerList" disabled="true">
<menupopup>
<menuitem id="token-menu" label="Built-in private key database"/>
<menuitem label="Bob Lord's iButton"/>
</menupopup>
</menulist>
-->
</hbox>
<separator/>
<groupbox orient="vertical">
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<text value="&setPassword.oldPassword.label;"/>
<textbox id="oldpw" type="password"/>
</row>
<row>
<text value="&setPassword.newPassword.label;"/>
<textbox id="pw1" type="password"
onkeypress="setPasswordStrength(); checkPasswords();"/>
</row>
<row>
<text value="&setPassword.reenterPassword.label;"/>
<textbox id="pw2" type="password" onkeypress="checkPasswords();"/>
</row>
</rows>
</grid>
</groupbox>
<groupbox orient="vertical">
<label value="&setPassword.meter.label;"/>
<progressmeter id="pwmeter" mode="determined" value="0%"
align="horizontal" label="&setPassword.meter.loading;"
style="forground-color: red;"/>
</groupbox>
<separator/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="if (!document.getElementById('ok-button').disabled) setPassword();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="if (!document.getElementById('ok-button').disabled) setPassword();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="setPassword();" disabled="true" default="true"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="window.close();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?change_pwd');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,58 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Drinan.
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
var dialogParams;
function onLoad()
{
dialogParams = window.arguments[0].QueryInterface(nsIDialogParamBlock);
var selectElement = document.getElementById("tokens");
for (var i=1; i <= dialogParams.GetInt(1); i++) {
var menuItemNode = document.createElement("menuitem");
var token = dialogParams.GetString(i);
menuItemNode.setAttribute("value", token);
menuItemNode.setAttribute("label", token);
selectElement.firstChild.appendChild(menuItemNode);
if (i == 1) {
selectElement.selectedItem = menuItemNode;
}
}
}
function doOK()
{
var tokenList = document.getElementById("tokens");
var token = tokenList.value;
dialogParams.SetInt(1,1);
dialogParams.SetString(1, token);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}

View File

@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corporation. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corporation. All
- Rights Reserved.
-
- Contributor(s):
- David Drinan (ddrinan@netscape.com)
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<window id="ssl_warning" title="&chooseToken.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="360"
width="400"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/choosetoken.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="if (!document.getElementById('ok-button').disabled) doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="if (!document.getElementById('ok-button').disabled) doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel();"/>
</keyset>
<vbox style="margin: 5px;" flex="1">
<groupbox orient="vertical">
<html>&chooseToken.message1;</html>
<menulist id="tokens">
<menupopup/>
</menulist>
</groupbox>
<separator />
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="doOK();" disabled="false"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?which_token');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,92 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
var dialogParams;
var itemCount = 0;
function onLoad()
{
var cn;
var org;
var issuer;
dialogParams = window.arguments[0].QueryInterface(nsIDialogParamBlock);
cn = dialogParams.GetString(1);
org = dialogParams.GetString(2);
issuer = dialogParams.GetString(3);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var message1 = bundle.formatStringFromName("clientAuthMessage1",
[org],
1);
var message2 = bundle.formatStringFromName("clientAuthMessage2",
[issuer],
1);
setText("hostname", cn);
setText("organization", message1);
setText("issuer", message2);
var selectElement = document.getElementById("nicknames");
itemCount = dialogParams.GetInt(1);
for (var i=0; i < itemCount; i++) {
var menuItemNode = document.createElement("menuitem");
var nick = dialogParams.GetString(i+4);
menuItemNode.setAttribute("value", i);
menuItemNode.setAttribute("label", nick); // this is displayed
selectElement.firstChild.appendChild(menuItemNode);
if (i == 0) {
selectElement.selectedItem = menuItemNode;
}
}
setDetails();
}
function setDetails()
{
var index = parseInt(document.getElementById("nicknames").value);
details = dialogParams.GetString(index+itemCount+4);
document.getElementById("details").setAttribute("value", details);
}
function onCertSelected()
{
setDetails();
}
function doOK()
{
dialogParams.SetInt(1,1);
var index = parseInt(document.getElementById("nicknames").value);
dialogParams.SetInt(2, index);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}

View File

@@ -0,0 +1,72 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- David Drinan (ddrinan@netscape.com)
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<window id="ssl_warning" title="&clientAuthAsk.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/clientauthask.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js" />
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<vbox style="margin: 5px;">
<groupbox orient="vertical">
<html style="font-weight: bold;">&clientAuthAsk.message1;</html>
<html id="hostname"/>
<html id="organization"/>
<html id="issuer"/>
</groupbox>
<groupbox orient="vertical">
<html style="font-weight: bold;">&clientAuthAsk.message2;</html>
<broadcaster id="certSelected" oncommand="onCertSelected();"/>
<!-- The items in this menulist must never be sorted,
but remain in the order filled by the application
-->
<menulist id="nicknames" observes="certSelected">
<menupopup/>
</menulist>
<html>&clientAuthAsk.message3;</html>
<textbox readonly="true" id="details" multiline="true"
style="height: 10em; width=80em;"/>
</groupbox>
<separator/>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="doOK();" disabled="false"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" class="dialog" label="&help.label;"
style="width: 10ex" oncommand="openHelp('chrome://help/content/help.xul?which_cert');" />
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,55 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the packages being supplied by this jar -->
<RDF:Seq about="urn:mozilla:package:root">
<RDF:li resource="urn:mozilla:package:pippki"/>
</RDF:Seq>
<!-- package information -->
<RDF:Description about="urn:mozilla:package:pippki"
chrome:displayName="pippki"
chrome:author="PSM Team"
chrome:name="pippki"
chrome:localeVersion="0.9.3">
</RDF:Description>
<!-- Declare overlay points used in this package -->
<RDF:Seq about="urn:mozilla:overlays">
<RDF:li resource="chrome://communicator/content/pref/preftree.xul"/>
<RDF:li resource="chrome://navigator/content/pageInfo.xul"/>
</RDF:Seq>
<!-- Define the local overlay file(s) for each overlay point -->
<RDF:Seq about="chrome://communicator/content/pref/preftree.xul">
<RDF:li>chrome://pippki/content/PrefOverlay.xul</RDF:li>
</RDF:Seq>
<RDF:Seq about="chrome://navigator/content/pageInfo.xul">
<RDF:li>chrome://pippki/content/PageInfoOverlay.xul</RDF:li>
</RDF:Seq>
</RDF:RDF>

View File

@@ -0,0 +1,43 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*/
var keygenThread;
function onLoad()
{
keygenThread = window.arguments[0].QueryInterface(Components.interfaces.nsIKeygenThread);
if (!keygenThread) {
window.close();
return;
}
setCursor("wait");
keygenThread.startKeyGeneration(window);
}
function onClose()
{
setCursor("default");
var alreadyClosed = new Object();
keygenThread.userCanceled(alreadyClosed);
}

View File

@@ -0,0 +1,39 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window
id="domainMismatch" title="&createCertInfo.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
debug="false"
onload="onLoad();"
onclose="onClose();"
>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="pippki.js" />
<script type="application/x-javascript" src="createCertInfo.js" />
<script type="application/x-javascript" src="chrome://help/content/help.js" />
<box orient="vertical" style="margin: 5px; max-width: 50em;">
<html>&createCertInfo.msg1;</html>
<separator/>
<html style="font-weight: bold; text-align: center; text-decoration: blink;">&createCertInfo.msg2;</html>
<separator/>
</box>
</window>

View File

@@ -0,0 +1,105 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Drinan <ddrinan@netscape.com>
*/
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsICrlEntry = Components.interfaces.nsICrlEntry;
const nsISupportsArray = Components.interfaces.nsISupportsArray;
var certdb;
var crls;
function onLoad()
{
var crlEntry;
var i;
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
crls = certdb.getCrls();
for (i=0; i<crls.Count(); i++) {
crlEntry = crls.GetElementAt(i).QueryInterface(nsICrlEntry);
var org = crlEntry.org;
var orgUnit = crlEntry.orgUnit;
var lastUpdate = crlEntry.lastUpdate;
var nextUpdate = crlEntry.nextUpdate;
AddItem("crlList", [org, orgUnit, lastUpdate, nextUpdate], "crltree_", i);
}
}
function AddItem(children,cells,prefix,idfier)
{
var kids = document.getElementById(children);
var item = document.createElement("treeitem");
var row = document.createElement("treerow");
for(var i = 0; i < cells.length; i++)
{
var cell = document.createElement("treecell");
cell.setAttribute("class", "propertylist");
cell.setAttribute("label", cells[i])
row.appendChild(cell);
}
item.appendChild(row);
item.setAttribute("id",prefix + idfier);
kids.appendChild(item);
}
function DeleteCrlSelected() {
var crlEntry;
// delete selected item
var crltree = document.getElementById("crltree");
var i = crltree.selectedIndex;
// Delete it
certdb.deleteCrl(i);
DeleteItemSelected("crltree", "crltree_", "crlList");
if( !crltree.selectedItems.length ) {
if( !document.getElementById("deleteCrl").disabled ) {
document.getElementById("deleteCrl").setAttribute("disabled", "true")
}
}
}
function EnableCrlActions() {
document.getElementById("deleteCrl").removeAttribute("disabled", "true");
// document.getElementById("updateCrl").removeAttribute("disabled", "true");
}
function DeleteItemSelected(tree, prefix, kids) {
var i;
var delnarray = [];
var rv = "";
var cookietree = document.getElementById(tree);
var selitems = cookietree.selectedItems;
for(i = 0; i < selitems.length; i++)
{
delnarray[i] = document.getElementById(selitems[i].getAttribute("id"));
var itemid = parseInt(selitems[i].getAttribute("id").substring(prefix.length,selitems[i].getAttribute("id").length));
rv += (itemid + ",");
}
for(i = 0; i < delnarray.length; i++)
{
document.getElementById(kids).removeChild(delnarray[i]);
}
return rv;
}

View File

@@ -0,0 +1,82 @@
<?xml version="1.0"?>
<!--
The contents of this file are subject to the Netscape Public
License Version 1.1 (the "License"); you may not use this file
except in compliance with the License. You may obtain a copy of
the License at http://www.mozilla.org/NPL/
Software distributed under the License is distributed on an "AS
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
The Original Code is Mozilla Communicator client code, released
March 31, 1998.
The Initial Developer of the Original Code is Netscape
Communications Corporation. Portions created by Netscape are
Copyright (C) 1998-1999 Netscape Communications Corporation. All
Rights Reserved.
Contributor(s):
David Drinan (ddrinan@netscape.com)
-->
<!-- CHANGE THIS WHEN MOVING FILES -->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!-- CHANGE THIS WHEN MOVING FILES -->
<!DOCTYPE window [
<!ENTITY % prefValDTD SYSTEM "chrome://pippki/locale/pref-validation.dtd">
%prefValDTD;
<!ENTITY % prefCertMgrDTD SYSTEM "chrome://pippki/locale/certManager.dtd">
%prefCertMgrDTD;
]>
<window id="crlviewer"
class="dialog"
title="&validation.crlmanager.label;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 30em;"
orient="vertical"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/crlManager.js"/>
<text class="label" value="&validation.crlmanager.label;"/>
<separator class="thin"/>
<tree id="crltree" class="inset" style="height: 10em;"
multiple="false" oncommand="EnableCrlActions()" flex="1">
<treecolgroup>
<treecol flex="3" width="0"/>
<splitter class="tree-splitter"/>
<treecol flex="5" width="0"/>
<splitter class="tree-splitter"/>
<treecol flex="2" width="0"/>
<splitter class="tree-splitter"/>
<treecol flex="2" width="0"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header sortDirectionIndicator"
label="&certmgr.certdetail.o;"/>
<treecell class="treecell-header sortDirectionIndicator"
label="&certmgr.certdetail.ou;"/>
<treecell class="treecell-header sortDirectionIndicator"
label="&validation.crllastupdate.label;"/>
<treecell class="treecell-header sortDirectionIndicator"
label="&validation.crlnextupdate.label;"/>
</treerow>
</treehead>
<treechildren id="crlList" flex="1"/>
</tree>
<hbox>
<button id="deleteCrl" class="dialog push" disabled="true"
label="&validation.deletecrl.label;"
oncommand="DeleteCrlSelected();"/>
</hbox>
<separator class="thin"/>
</window>

View File

@@ -0,0 +1,121 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Ian McGreer <mcgreer@netscape.com>
*/
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
var certdb;
var certs = [];
var dialogParams;
var pkiParams;
var helpUrl;
function setWindowName()
{
params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
// Get the cert from the cert database
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
var typeFlag = params.GetString(1);
var numberOfCerts = params.GetInt(2);
var dbkey;
for(var x=0; x<numberOfCerts;x++)
{
dbkey = params.GetString(x+3);
certs[x] = certdb.getCertByDBKey(dbkey , null);
}
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var title;
var confirm;
var impact;
if(typeFlag == bundle.GetStringFromName("deleteUserCertFlag"))
{
title = bundle.GetStringFromName("deleteUserCertTitle");
confirm = bundle.GetStringFromName("deleteUserCertConfirm");
impact = bundle.GetStringFromName("deleteUserCertImpact");
helpUrl = "chrome://help/content/help.xul?delete_my_certs"
}
else if(typeFlag == bundle.GetStringFromName("deleteSslCertFlag"))
{
title = bundle.GetStringFromName("deleteSslCertTitle");
confirm = bundle.GetStringFromName("deleteSslCertConfirm");
impact = bundle.GetStringFromName("deleteSslCertImpact");
helpUrl = "chrome://help/content/help.xul?delete_web_certs"
}
else if(typeFlag == bundle.GetStringFromName("deleteCaCertFlag"))
{
title = bundle.GetStringFromName("deleteCaCertTitle");
confirm = bundle.GetStringFromName("deleteCaCertConfirm");
impact = bundle.GetStringFromName("deleteCaCertImpact");
helpUrl = "chrome://help/content/help.xul?delete_ca_certs"
}
else
{
return;
}
var windowReference = document.getElementById('deleteCert');
var confirReference = document.getElementById('confirm');
var impactReference = document.getElementById('impact');
windowReference.setAttribute("title", title);
setText("confirm",confirm);
var box=document.getElementById("certlist");
var text;
for(var x=0;x<certs.length;x++)
{
text = document.createElement("text");
text.setAttribute("value",certs[x].commonName);
box.appendChild(text);
}
setText("impact",impact);
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("height",window.innerHeight + 40);
}
function doOK()
{
for(var i=0;i<certs.length;i++)
{
certdb.deleteCertificate(certs[i]);
}
window.close();
}
function doHelp()
{
openHelp(helpUrl);
}

View File

@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<window id="deleteCert"
title="&certmgr.deletecert.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="setWindowName();"
style="width:8ex">
<script type="application/x-javascript" src="chrome://pippki/content/deletecert.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="pippki.js" />
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<vbox flex="1">
<html id="confirm"/>
<separator />
<vbox id="certlist" flex="100%"/>
<html id="impact"/>
<separator />
<hbox align="center">
<button id="ok-button" class="dialog" label="&certmgr.ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" class="dialog" label="&certmgr.cancel.label;"
oncommand="window.close();"/>
<button id="help-button" class="dialog" label="&certmgr.help.label;"
oncommand="doHelp();"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,412 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Ian McGreer <mcgreer@netscape.com>
*/
const nsIFilePicker = Components.interfaces.nsIFilePicker;
const nsFilePicker = "@mozilla.org/filepicker;1";
const nsIPKCS11Slot = Components.interfaces.nsIPKCS11Slot;
const nsIPKCS11Module = Components.interfaces.nsIPKCS11Module;
const nsPKCS11ModuleDB = "@mozilla.org/security/pkcs11moduledb;1";
const nsIPKCS11ModuleDB = Components.interfaces.nsIPKCS11ModuleDB;
const nsIPK11Token = Components.interfaces.nsIPK11Token;
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
var bundle;
var secmoddb;
/* Do the initial load of all PKCS# modules and list them. */
function LoadModules()
{
bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
secmoddb = Components.classes[nsPKCS11ModuleDB].getService(nsIPKCS11ModuleDB);
var modules = secmoddb.listModules();
var done = false;
try {
modules.isDone();
} catch (e) { done = true; }
while (!done) {
var module = modules.currentItem().QueryInterface(nsIPKCS11Module);
if (module) {
var slotnames = [];
var slots = module.listSlots();
var slots_done = false;
try {
slots.isDone();
} catch (e) { slots_done = true; }
while (!slots_done) {
var slot = slots.currentItem().QueryInterface(nsIPKCS11Slot);
// in the ongoing discussion of whether slot names or token names
// are to be shown, I've gone with token names because NSS will
// prefer lookup by token name. However, the token may not be
// present, so maybe slot names should be listed, while token names
// are "remembered" for lookup?
if (slot.tokenName)
slotnames[slotnames.length] = slot.tokenName;
else
slotnames[slotnames.length] = slot.name;
try {
slots.next();
} catch (e) { slots_done = true; }
}
AddModule(module.name, slotnames);
}
try {
modules.next();
} catch (e) { done = true; }
}
/* Set the text on the fips button */
SetFIPSButtonText();
}
function SetFIPSButtonText()
{
var fipsButton = document.getElementById("fipsbutton");
var label;
if (secmoddb.isFIPSEnabled) {
label = bundle.GetStringFromName("disable_fips");
} else {
label = bundle.GetStringFromName("enable_fips");
}
fipsButton.setAttribute("label", label);
}
/* Add a module to the tree. slots is the array of slots in the module,
* to be represented as children.
*/
function AddModule(module, slots)
{
var tree = document.getElementById("device_list");
var item = document.createElement("treeitem");
var row = document.createElement("treerow");
var cell = document.createElement("treecell");
cell.setAttribute("class", "propertylist");
cell.setAttribute("label", module);
cell.setAttribute("style", "font-weight: bold");
cell.setAttribute("crop", "never");
row.appendChild(cell);
item.appendChild(row);
var parent = document.createElement("treechildren");
for (var i = 0; i<slots.length; i++) {
var child_item = document.createElement("treeitem");
var child_row = document.createElement("treerow");
var child_cell = document.createElement("treecell");
child_cell.setAttribute("label", slots[i]);
child_cell.setAttribute("class", "treecell-indent");
child_row.appendChild(child_cell);
child_item.appendChild(child_row);
child_item.setAttribute("pk11kind", "slot");
parent.appendChild(child_item);
}
item.appendChild(parent);
item.setAttribute("pk11kind", "module");
item.setAttribute("open", "true");
item.setAttribute("container", "true");
tree.appendChild(item);
}
var selected_slot;
var selected_module;
/* get the slot selected by the user (can only be one-at-a-time) */
function getSelectedItem()
{
var tree = document.getElementById('device_tree');
var items = tree.selectedItems;
selected_slot = null;
selected_module = null;
if (items.length > 0) {
var kind = items[0].getAttribute("pk11kind");
var module_name;
if (kind == "slot") {
// get the module cell for this slot cell
var cell = items[0].parentNode.parentNode.firstChild.firstChild;
module_name = cell.getAttribute("label");
var module = secmoddb.findModuleByName(module_name);
// get the cell for the selected row (the slot to display)
cell = items[0].firstChild.firstChild;
var slot_name = cell.getAttribute("label");
selected_slot = module.findSlotByName(slot_name);
} else { // (kind == "module")
// get the cell for the selected row (the module to display)
cell = items[0].firstChild.firstChild;
module_name = cell.getAttribute("label");
selected_module = secmoddb.findModuleByName(module_name);
}
}
}
function enableButtons()
{
var login_toggle = "true";
var logout_toggle = "true";
var pw_toggle = "true";
var unload_toggle = "true";
getSelectedItem();
if (selected_module) {
unload_toggle = "false";
showModuleInfo();
} else if (selected_slot) {
// here's the workaround - login functions are all with token,
// so grab the token type
var selected_token = selected_slot.getToken();
if (selected_token != null) {
if (selected_token.needsLogin()) {
pw_toggle = "false";
if (selected_token.isLoggedIn()) {
logout_toggle = "false";
} else {
login_toggle = "false";
}
}
}
showSlotInfo();
}
var thebutton = document.getElementById('login_button');
thebutton.setAttribute("disabled", login_toggle);
thebutton = document.getElementById('logout_button');
thebutton.setAttribute("disabled", logout_toggle);
thebutton = document.getElementById('change_pw_button');
thebutton.setAttribute("disabled", pw_toggle);
thebutton = document.getElementById('unload_button');
thebutton.setAttribute("disabled", unload_toggle);
// not implemented
//thebutton = document.getElementById('change_slotname_button');
//thebutton.setAttribute("disabled", toggle);
}
// clear the display of information for the slot
function ClearInfoList()
{
var info_list = document.getElementById("info_list");
while (info_list.firstChild)
info_list.removeChild(info_list.firstChild);
}
// show a list of info about a slot
function showSlotInfo()
{
ClearInfoList();
switch (selected_slot.status) {
case nsIPKCS11Slot.SLOT_DISABLED:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_disabled"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_NOT_PRESENT:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_notpresent"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_UNINITIALIZED:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_uninitialized"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_NOT_LOGGED_IN:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_notloggedin"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_LOGGED_IN:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_loggedin"),
"tok_status");
break;
case nsIPKCS11Slot.SLOT_READY:
AddInfoRow(bundle.GetStringFromName("devinfo_status"),
bundle.GetStringFromName("devinfo_stat_ready"),
"tok_status");
break;
}
AddInfoRow(bundle.GetStringFromName("devinfo_desc"),
selected_slot.desc, "slot_desc");
AddInfoRow(bundle.GetStringFromName("devinfo_manID"),
selected_slot.manID, "slot_manID");
AddInfoRow(bundle.GetStringFromName("devinfo_hwversion"),
selected_slot.HWVersion, "slot_hwv");
AddInfoRow(bundle.GetStringFromName("devinfo_fwversion"),
selected_slot.FWVersion, "slot_fwv");
}
function showModuleInfo()
{
ClearInfoList();
AddInfoRow(bundle.GetStringFromName("devinfo_modname"),
selected_module.name, "module_name");
AddInfoRow(bundle.GetStringFromName("devinfo_modpath"),
selected_module.libName, "module_path");
}
// add a row to the info list, as [col1 col2] (ex.: ["status" "logged in"])
function AddInfoRow(col1, col2, cell_id)
{
var tree = document.getElementById("info_list");
var item = document.createElement("treeitem");
var row = document.createElement("treerow");
var cell1 = document.createElement("treecell");
cell1.setAttribute("label", col1);
cell1.setAttribute("crop", "never");
row.appendChild(cell1);
var cell2 = document.createElement("treecell");
cell2.setAttribute("label", col2);
cell2.setAttribute("crop", "never");
cell2.setAttribute("id", cell_id);
row.appendChild(cell2);
item.appendChild(row);
tree.appendChild(item);
}
// log in to a slot
function doLogin()
{
getSelectedItem();
// here's the workaround - login functions are with token
var selected_token = selected_slot.getToken();
try {
selected_token.login(false);
var tok_status = document.getElementById("tok_status");
if (selected_token.isLoggedIn()) {
tok_status.setAttribute("label",
bundle.GetStringFromName("devinfo_stat_loggedin"));
} else {
tok_status.setAttribute("label",
bundle.GetStringFromName("devinfo_stat_notloggedin"));
}
} catch (e) {
alert("failed to login");
}
enableButtons();
}
// log out of a slot
function doLogout()
{
getSelectedItem();
// here's the workaround - login functions are with token
var selected_token = selected_slot.getToken();
try {
selected_token.logout(false);
var tok_status = document.getElementById("tok_status");
if (selected_token.isLoggedIn()) {
tok_status.setAttribute("label",
bundle.GetStringFromName("devinfo_stat_loggedin"));
} else {
tok_status.setAttribute("label",
bundle.GetStringFromName("devinfo_stat_notloggedin"));
}
} catch (e) {
}
enableButtons();
}
// load a new device
function doLoad()
{
//device.loaddlg.width=300
//device.loaddlg.height=200
var dlgWidth = bundle.GetStringFromName("device.loaddlg.width");
var dlgHeight = bundle.GetStringFromName("device.loaddlg.height");
//
window.open("load_device.xul", "loaddevice",
"chrome,width=" + dlgWidth + ",height="+ dlgHeight+ ",resizable=1,dialog=1,modal=1");
var device_list = document.getElementById("device_list");
while (device_list.firstChild)
device_list.removeChild(device_list.firstChild);
LoadModules();
}
function doUnload()
{
getSelectedItem();
if (selected_module) {
pkcs11.deletemodule(selected_module.name);
var device_list = document.getElementById("device_list");
while (device_list.firstChild)
device_list.removeChild(device_list.firstChild);
LoadModules();
}
}
function changePassword()
{
getSelectedItem();
token = selected_slot.getToken();
window.open("changepassword.xul",
selected_slot.tokenName,
"chrome,resizable=1,modal=1,dialog=1");
showSlotInfo();
enableButtons();
}
// browse fs for PKCS#11 device
function doBrowseFiles()
{
var srbundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var fp = Components.classes[nsFilePicker].createInstance(nsIFilePicker);
fp.init(window,
srbundle.GetStringFromName("loadPK11TokenDialog"),
nsIFilePicker.modeOpen);
fp.appendFilters(nsIFilePicker.filterAll);
if (fp.show() == nsIFilePicker.returnOK) {
var pathbox = document.getElementById("device_path");
pathbox.setAttribute("value", fp.file.persistentDescriptor);
}
}
function doLoadDevice()
{
var name_box = document.getElementById("device_name");
var path_box = document.getElementById("device_path");
pkcs11.addmodule(name_box.value, path_box.value, 0,0);
window.close();
}
// ------------------------------------- Old code
function showTokenInfo()
{
ClearInfoList();
getSelectedToken();
AddInfoRow(bundle.GetStringFromName("devinfo_label"),
selected_token.tokenLabel, "tok_label");
AddInfoRow(bundle.GetStringFromName("devinfo_manID"),
selected_token.tokenManID, "tok_manID");
AddInfoRow(bundle.GetStringFromName("devinfo_serialnum"),
selected_token.tokenSerialNumber, "tok_sNum");
AddInfoRow(bundle.GetStringFromName("devinfo_hwversion"),
selected_token.tokenHWVersion, "tok_hwv");
AddInfoRow(bundle.GetStringFromName("devinfo_fwversion"),
selected_token.tokenFWVersion, "tok_fwv");
}
function toggleFIPS()
{
secmoddb.toggleFIPSMode();
//Remove the existing listed modules so that re-fresh doesn't
//display the module that just changed.
var device_list = document.getElementById("device_list");
while (device_list.firstChild)
device_list.removeChild(device_list.firstChild);
LoadModules();
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % deviceManangerDTD SYSTEM "chrome://pippki/locale/deviceManager.dtd">
%deviceManangerDTD;
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<window id="devicemanager"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&devmgr.title;"
persist="screenX screenY width height"
onload="LoadModules();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/device_manager.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<grid flex="1">
<columns>
<column flex="1"/>
<column flex="1"/>
<column flex="1"/>
</columns>
<rows>
<row>
<hbox flex="1"> <!-- List of devices -->
<tree id="device_tree" rows="12" multiple="false"
onselect="enableButtons();"
flex="1" style="min-width:15em">
<treecolgroup>
<treecol flex="1"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header"
label="&devmgr.devlist.label;"
flex="1"/>
</treerow>
</treehead>
<treechildren id="device_list"/>
</tree>
</hbox> <!-- / List of devices -->
<hbox flex="1"> <!-- Device status -->
<tree id="info_tree" rows="12" multiple="false"
class="list" flex="1" style="min-width:10em">
<treecolgroup>
<treecol flex="5"/>
<treecol flex="7"/>
</treecolgroup>
<treehead>
<treerow>
<treecell class="treecell-header"
label="&devmgr.details.title;" flex="2"/>
<treecell class="treecell-header"
label="&devmgr.details.title2;" flex="7"/>
</treerow>
</treehead>
<treechildren id="info_list"/>
</tree>
</hbox> <!-- / Device status -->
<vbox> <!-- Buttons for manipulating devices -->
<button id="login_button"
label="&devmgr.button.login.label;"
oncommand="doLogin();" disabled="true"/>
<button id="logout_button"
label="&devmgr.button.logout.label;"
oncommand="doLogout();" disabled="true"/>
<button id="change_pw_button"
label="&devmgr.button.changepw.label;"
oncommand="changePassword();" disabled="true"/>
<button id="load_button"
label="&devmgr.button.load.label;"
oncommand="doLoad();" disabled="false"/>
<button id="unload_button"
label="&devmgr.button.unload.label;"
oncommand="doUnload();" disabled="true"/>
<button id="fipsbutton" oncommand="toggleFIPS();"/>
</vbox> <!-- / Buttons for manipulating devices -->
</row>
<row>
<hbox>
<button id="help_button"
label="&help.label;"
class="normal"
oncommand="openHelp('chrome://help/content/help.xul?sec_devices');"/>
<button id="ok_button"
label="&ok.label;"
class="normal"
oncommand="window.close();"/>
</hbox>
</row>
</rows>
</grid>
</window>

View File

@@ -0,0 +1,80 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var pkiParams;
var dialogParams;
var cert;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
cert = isupport.QueryInterface(nsIX509Cert);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var connectURL = dialogParams.GetString(1);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var message1 = bundle.formatStringFromName("mismatchDomainMsg1",
[ connectURL, cert.commonName ],
2);
var message2 = bundle.formatStringFromName("mismatchDomainMsg2",
[ connectURL ],
1);
setText("message1", message1);
setText("message2", message2);
//Set the focus so key press events work
document.getElementById('ok-button').focus();
var xulWindow = document.getElementById("domainMismatch");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 40);
}
function viewCert()
{
cert.view();
}
function doOK()
{
dialogParams.SetInt(1,1);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}

View File

@@ -0,0 +1,69 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="domainMismatch" title="&domainMismatch.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
debug="false"
width="320"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/domainMismatch.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK()" />
<key id="return-key" keycode="VK_RETURN" oncommand="doOK()" />
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel()"/>
</keyset>
<vbox style="margin: 5px;" flex="1">
<html id="message1"/>
<separator/>
<html id="message2" flex="100%"/>
<hbox>
<button id="examineCert-button" class="dialog" label="&examineCert.label;"
oncommand="viewCert();"/>
</hbox>
<separator/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel();"/>
</keyset>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;" primary="true"
oncommand="doOK();" disabled="false"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?bad_name_web_cert');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,87 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Terry Hayes <thayes@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
var params;
var caName;
function onLoad()
{
params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
caName = params.GetString(1);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
if (!caName.length)
caName = bundle.GetStringFromName("unnamedCA");
var message2 = bundle.formatStringFromName("newCAMessage1",
[ caName ],
1);
setText("message2", message2);
var xulWindow = document.getElementById("download_cert");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 40);
}
function viewCert()
{
}
function viewPolicy()
{
}
function doOK()
{
var checkSSL = document.getElementById("trustSSL");
var checkEmail = document.getElementById("trustEmail");
var checkObjSign = document.getElementById("trustObjSign");
if (checkSSL.checked)
params.SetInt(2,1);
else
params.SetInt(2,0);
if (checkEmail.checked)
params.SetInt(3,1);
else
params.SetInt(3,0);
if (checkObjSign.checked)
params.SetInt(4,1);
else
params.SetInt(4,0);
params.SetInt(1,1);
window.close();
}
function doCancel()
{
params.SetInt(1,0);
window.close();
}

View File

@@ -0,0 +1,114 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="download_cert" title="&downloadCert.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="320"
width="460"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/downloadcert.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox style="margin: 5px;" flex="1">
<!-- Let 'em know what they're doing -->
<vbox>
<html>&downloadCert.message1;</html>
</vbox>
<separator/>
<!-- checkboxes for trust bits
- "do you want to?"
- * trust for SSL
- * trust for email
- * trust for object signing
-->
<vbox>
<html id="message2"/>
<checkbox label="&downloadCert.trustSSL;" checked="false"
id="trustSSL"/>
<checkbox label="&downloadCert.trustEmail;" checked="false"
id="trustEmail"/>
<checkbox label="&downloadCert.trustObjSign;" checked="false"
id="trustObjSign"/>
</vbox>
<separator/>
<!-- buttons for viewing cert and policies
- "suggested you view the following:"
- <> view cert
- <> view policy
-->
<vbox>
<html>&downloadCert.message3;</html>
<separator/>
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<button id="viewC-button" class="dialog"
label="&downloadCert.viewCert.label;"
oncommand="viewCert();"/>
<html>&downloadCert.viewCert.text;</html>
</row>
<row>
<button id="viewP-button" class="dialog"
label="&downloadCert.viewPolicy.label;"
oncommand="viewPolicy();"/>
<html>&downloadCert.viewPolicy.text;</html>
</row>
</rows>
</grid>
</vbox>
<separator/>
<!-- usual runaround
- <ok> <cancel> <help>
-->
<hbox align="center">
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?new_ca');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,71 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<window id="editCert"
title="&certmgr.editcacert.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="setWindowName();"
>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/editcerts.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox flex="1">
<html id="certmsg"/>
<separator />
<html flex="100%">&certmgr.editcert.edittrust;</html>
<vbox flex="100%">
<checkbox label="&certmgr.editcert.trustssl;" checked="false"
id="trustSSL"/>
<checkbox label="&certmgr.editcert.trustemail;" checked="false"
id="trustEmail"/>
<checkbox label="&certmgr.editcert.trustobjsign;" checked="false"
id="trustObjSign"/>
</vbox>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doSSLOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doSSLOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<hbox>
<button id="ok-button" class="dialog" label="&certmgr.ok.label;"
oncommand="doOK();"/>
<button id="cancel-button" class="dialog" label="&certmgr.cancel.label;"
oncommand="window.close();"/>
<button id="help-button" class="dialog" label="&certmgr.help.label;"
oncommand="openHelp('chrome://help/content/help.xul?edit_ca_certs');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,210 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Ian McGreer <mcgreer@netscape.com>
*/
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
var certdb;
var cert;
function setWindowName()
{
var dbkey = self.name;
// Get the cert from the cert database
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
//var pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
//var isupport = pkiParams.getISupportAtIndex(1);
//cert = isupport.QueryInterface(nsIX509Cert);
cert = certdb.getCertByDBKey(dbkey, null);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var windowReference = document.getElementById('editCert');
var message1 = bundle.formatStringFromName("editTrustCA",
[ cert.commonName ],
1);
setText("certmsg", message1);
var ssl = document.getElementById("trustSSL");
if (certdb.getCertTrust(cert, nsIX509Cert.CA_CERT,
nsIX509CertDB.TRUSTED_SSL)) {
ssl.setAttribute("checked", "true");
} else {
ssl.setAttribute("checked", "false");
}
var email = document.getElementById("trustEmail");
if (certdb.getCertTrust(cert, nsIX509Cert.CA_CERT,
nsIX509CertDB.TRUSTED_EMAIL)) {
email.setAttribute("checked", "true");
} else {
email.setAttribute("checked", "false");
}
var objsign = document.getElementById("trustObjSign");
if (certdb.getCertTrust(cert, nsIX509Cert.CA_CERT,
nsIX509CertDB.TRUSTED_OBJSIGN)) {
objsign.setAttribute("checked", "true");
} else {
objsign.setAttribute("checked", "false");
}
var xulWindow = document.getElementById("editCert");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 70);
}
function doOK()
{
var ssl = document.getElementById("trustSSL");
var email = document.getElementById("trustEmail");
var objsign = document.getElementById("trustObjSign");
var trustssl = (ssl.checked) ? nsIX509CertDB.TRUSTED_SSL : 0;
var trustemail = (email.checked) ? nsIX509CertDB.TRUSTED_EMAIL : 0;
var trustobjsign = (objsign.checked) ? nsIX509CertDB.TRUSTED_OBJSIGN : 0;
//
// Set the cert trust
//
certdb.setCertTrust(cert, nsIX509Cert.CA_CERT,
trustssl | trustemail | trustobjsign);
window.close();
}
function doLoadForSSLCert()
{
var dbkey = self.name;
// Get the cert from the cert database
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
cert = certdb.getCertByDBKey(dbkey, null);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var windowReference = document.getElementById('editSSLCert');
var message1 = bundle.formatStringFromName("editTrustSSL",
[ cert.commonName ],
1);
setText("certmsg", message1);
setText("issuer", cert.issuerName);
var cacert = getCaCertForServerCert(cert);
if(cacert == null)
{
setText("explainations",bundle.GetStringFromName("issuerNotKnown"));
}
else if(certdb.getCertTrust(cacert, nsIX509Cert.CA_CERT,
nsIX509CertDB.TRUSTED_SSL))
{
setText("explainations",bundle.GetStringFromName("issuerTrusted"));
}
else
{
setText("explainations",bundle.GetStringFromName("issuerNotTrusted"));
}
/*
if(cacert == null)
{
var editButton = document.getElementById('editca-button');
editButton.setAttribute("disabled","true");
}
*/
var trustssl = document.getElementById("trustSSLCert");
var notrustssl = document.getElementById("dontTrustSSLCert");
if (certdb.getCertTrust(cert, nsIX509Cert.SERVER_CERT,
nsIX509CertDB.TRUSTED_SSL)) {
trustssl.setAttribute("checked", "true");
} else {
notrustssl.setAttribute("checked", "true");
}
var xulWindow = document.getElementById("editSSLCert");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 70);
}
function doSSLOK()
{
var ssl = document.getElementById("trustSSLCert");
//var checked = ssl.getAttribute("value");
var checked = ssl.getAttribute("checked");
var trustssl = (checked == "true") ? nsIX509CertDB.TRUSTED_SSL : 0;
//
// Set the cert trust
//
certdb.setCertTrust(cert, nsIX509Cert.SERVER_CERT, trustssl);
window.close();
}
function editCaTrust()
{
var cacert = getCaCertForServerCert(cert);
if(cacert != null)
{
window.openDialog('chrome://pippki/content/editcacert.xul', cacert.dbKey,
'chrome,resizable=1,modal');
}
else
{
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
alert(bundle.GetStringFromName("issuerCertNotFound"));
}
}
function getCaCertForServerCert(cert)
{
var i=1;
var nextCertInChain;
nextCertInChain = cert;
var lastSubjectName="";
while(true)
{
if(nextCertInChain == null)
{
return null;
}
if((nextCertInChain.type == nsIX509Cert.CA_CERT) ||
(nextCertInChain.subjectName = lastSubjectName))
{
break;
}
lastSubjectName = nextCertInChain.subjectName;
nextCertInChain = nextCertInChain.issuer;
}
return nextCertInChain;
}

View File

@@ -0,0 +1,71 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/certManager.dtd">
<window id="editSSLCert"
title="&certmgr.editsslcert.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="doLoadForSSLCert();"
>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/editcerts.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox flex="1">
<html id="certmsg"/>
<html id="issuer"/>
<separator/>
<html id="explainations"/>
<separator />
<html>&certmgr.editsslcert.edittrust;</html>
<vbox>
<radiogroup id="sslTrustGroup" orient="vertical" flex="1">
<radio label="&certmgr.editsslcert.dotrust;"
id="trustSSLCert" group="sslTrustGroup"/>
<radio label="&certmgr.editsslcert.donttrust;"
id="dontTrustSSLCert" group="sslTrustGroup"/>
</radiogroup>
</vbox>
<hbox>
<button id="editca-button" class="dialog" label="&certmgr.editca.label;"
oncommand="editCaTrust();"/>
</hbox>
<hbox>
<button id="ok-button" class="dialog" label="&certmgr.ok.label;"
oncommand="doSSLOK();"/>
<button id="cancel-button" class="dialog" label="&certmgr.cancel.label;"
oncommand="window.close();"/>
<button id="help-button" class="dialog" label="&certmgr.help.label;"
oncommand="openHelp('chrome://help/content/help.xul?edit_web_certs');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,65 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var dialogParams;
var pkiParams;
var cert=null;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var isupports = pkiParams.getISupportAtIndex(1);
cert = isupports.QueryInterface(nsIX509Cert);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var dispName = cert.commonName;
if (dispName == null)
dispName = cert.windowTitle;
var msg = bundle.formatStringFromName("escrowFinalMessage",
[dispName], 1);
setText("message1",msg);
}
function doOK()
{
dialogParams.SetInt(1,1);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}
function viewCert()
{
cert.view();
}

View File

@@ -0,0 +1,63 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="escrowWarnDialog" title="&escrowWarn.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="280"
width="400"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/escrowWarn.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="getPassword();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="getPassword();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<vbox style="margin: 5px;" flex="1">
<html>&escrowWarn.message1;</html>
<separator/>
<html>&escrowWarn.benefit1;</html>
<separator/>
<html>&escrowWarn.message2;</html>
<separator/>
<html id="message1"/>
<hbox>
<button id="examineCert-button" class="dialog" label="&examineCert.label;"
oncommand="viewCert();"/>
</hbox>
<separator/>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="doOK();" disabled="false"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?priv_key_copy');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,68 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="getp12password" title="&pkcs12.getpassword.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="200"
width="300"
onload="onP12Load();">
<script type="application/x-javascript" src="chrome://pippki/content/password.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="getPassword();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="getPassword();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<vbox style="margin: 5px;" flex="1">
<html>&pkcs12.getpassword.message;</html>
<separator />
<grid>
<columns> <column/> <column/> </columns>
<rows>
<row>
<text value="&getPassword.password.label;"/>
<textbox id="pw1" type="password"/>
</row>
</rows>
</grid>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="getPassword();"
default="true" accesskey="o"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="window.close();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?my_certs');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,72 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="getpassword" title="&getPassword.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="320"
width="300"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://pippki/content/password.js"/>
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<vbox style="margin: 5px;" flex="1">
<hbox>
<text value="&getPassword.tokenName.label;:"/>
<text id="tokenName"/>
</hbox>
<separator/>
<grid>
<columns> <column/> <column/> </columns>
<rows>
<row>
<text value="&getPassword.password.label;"/>
<textbox id="pw1" type="password"/>
</row>
</rows>
</grid>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="doOK();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel();"/>
</keyset>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="getPassword();"
default="true" accesskey="o"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="window.close();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="alert('help goes here');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,64 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % deviceManangerDTD SYSTEM "chrome://pippki/locale/deviceManager.dtd">
%deviceManangerDTD;
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<window id="loaddevice"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&loaddevice.title;">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/device_manager.js"/>
<vbox>
<html>&loaddevice.info;</html>
<hbox>
<html>&loaddevice.modname;</html>
<textbox id="device_name" flex="1" value="&loaddevice.modname.default;"/>
</hbox>
<hbox>
<html>&loaddevice.filename;</html>
<textbox id="device_path" flex="1"/>
<button label="&loaddevice.browse;" flex="1" oncommand="doBrowseFiles();"/>
</hbox>
<hbox>
<button id="ok_button"
label="&ok.label;"
class="normal"
oncommand="doLoadDevice();"/>
<button id="cancel_button"
label="&cancel.label;"
class="normal"
oncommand="window.close();"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,103 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
* Håkan Waara <hwaara@chello.se>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var dialogParams;
var pkiParams;
var cert;
function onLoad()
{
doSetOKCancel(doOK, doCancel, doHelpButton);
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
cert = isupport.QueryInterface(nsIX509Cert);
var bundle = srGetStrBundle("chrome://pippki/locale/newserver.properties");
var gBundleBrand = srGetStrBundle("chrome://global/locale/brand.properties");
var brandName = gBundleBrand.GetStringFromName("brandShortName");
var continueButton = bundle.GetStringFromName("continueButton");
document.getElementById("ok").label = continueButton;
var message =
bundle.formatStringFromName("newServerMessage",
[cert.commonName],
1);
var notRecognized =
bundle.formatStringFromName("certNotRecognized",
[brandName],
1);
setText("message", message);
setText("notRecognized", notRecognized);
var windowReference = document.getElementById('ssl_warning');
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
windowReference.setAttribute("height",window.innerHeight + 40);
}
function doHelpButton()
{
openHelp('chrome://help/content/help.xul?new_web_cert');
}
function doOK()
{
// the user pressed OK
dialogParams.SetInt(1,1);
var checkbox = document.getElementById("alwaysAccept");
// 0 = accept perm, 1 = accept for this session - just the opposite
// of the checkbox value.
dialogParams.SetInt(2, !checkbox.checked);
window.close();
}
function doCancel()
{
// the user pressed cancel
dialogParams.SetInt(1,0);
window.close();
}
function viewCert()
{
cert.view();
}

View File

@@ -0,0 +1,70 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
- Håkan Waara <hwaara@chello.se>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % newserverDTD SYSTEM "chrome://pippki/locale/newserver.dtd" >
%newserverDTD;
<!ENTITY % pippkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd" >
%pippkiDTD;
]>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<window id="ssl_warning" title="&newserver.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
style="width: 30em; height: 16em"
class="dialog"
onload="onLoad();"
orient="vertical">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/newserver.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="dialogKeys"/>
<vbox flex="1">
<hbox valign="top" autostretch="never">
<image class="alert-icon" style="margin: 5px"/>
<vbox flex="1" valign="middle">
<html id="message"/>
<separator class="thin"/>
<html id="notRecognized"/>
<separator/>
<vbox autostretch="never" flex="1" align="right">
<button id="examineCert-button" label="&examineCert.label;"
oncommand="viewCert();"/>
</vbox>
<checkbox checked="false" id="alwaysAccept" label="&alwaysAccept.label;"/>
</vbox>
</hbox>
<hbox id="okCancelHelpButtonsRight" flex="1" autostretch="never"/>
</vbox>
</window>

View File

@@ -0,0 +1,213 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Terry Hayes <thayes@netscape.com>
*/
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsPKCS11ModuleDB = "@mozilla.org/security/pkcs11moduledb;1";
const nsIPKCS11ModuleDB = Components.interfaces.nsIPKCS11ModuleDB;
const nsIPKCS11Slot = Components.interfaces.nsIPKCS11Slot;
var params;
var tokenName;
var pw1;
function onLoad()
{
pw1 = document.getElementById("pw1");
if ("arguments" in window) {
params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
tokenName = params.GetString(1);
} else {
tokenName = self.name;
}
// Set token name in display
var t = document.getElementById("tokenName");
t.setAttribute("value", tokenName);
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
// If the token is unitialized, don't use the old password box.
// Otherwise, do.
var secmoddb = Components.
classes[nsPKCS11ModuleDB].
getService(nsIPKCS11ModuleDB);
var slot = secmoddb.findSlotByName(tokenName);
if (slot) {
var oldpwbox = document.getElementById("oldpw");
if (slot.status == nsIPKCS11Slot.SLOT_UNINITIALIZED ) {
oldpwbox.setAttribute("disabled", "true");
oldpwbox.setAttribute("type", "text");
oldpwbox.setAttribute("value",
bundle.GetStringFromName("password_not_set"));
oldpwbox.setAttribute("inited", "true");
// Select first password field
document.getElementById('pw1').focus();
} else {
// Select old password field
oldpwbox.setAttribute("inited", "false");
oldpwbox.focus();
}
}
if (params) {
// Return value 0 means "canceled"
params.SetInt(1, 0);
}
}
function onP12Load()
{
pw1 = document.getElementById("pw1");
params = window.arguments[0].QueryInterface(nsIDialogParamBlock);
// Select first password field
document.getElementById('pw1').focus();
}
function setPassword()
{
var pk11db = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
var token = pk11db.findTokenByName(tokenName);
var oldpwbox = document.getElementById("oldpw");
var initpw = oldpwbox.getAttribute("inited");
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var success = false;
if (initpw == "false") {
try {
var passok = token.checkPassword(oldpwbox.value);
if (passok) {
token.changePassword(oldpwbox.value, pw1.value);
alert(bundle.GetStringFromName("pw_change_ok"));
success = true;
} else {
oldpwbox.focus();
oldpwbox.setAttribute("value", "");
alert(bundle.GetStringFromName("incorrect_pw"));
}
} catch (e) {
alert(bundle.GetStringFromName("failed_pw_change"));
}
} else {
token.initPassword(pw1.value);
success = true;
}
// Terminate dialog
if (success) {
if (params) {
// Return value 1 means "successfully executed ok"
params.SetInt(1, 1);
}
window.close();
}
}
function getPassword()
{
// grab what was entered
params.SetString(2, pw1.value);
// Return value
params.SetInt(1, 1);
// Terminate dialog
window.close();
}
function setP12Password()
{
// grab what was entered
params.SetString(2, pw1.value);
// Return value
params.SetInt(1, 1);
// Terminate dialog
window.close();
}
function setPasswordStrength()
{
// Here is how we weigh the quality of the password
// number of characters
// numbers
// non-alpha-numeric chars
// upper and lower case characters
var pw=document.getElementById('pw1').value;
// alert("password='" + pw +"'");
//length of the password
var pwlength=(pw.length);
if (pwlength>5)
pwlength=5;
//use of numbers in the password
var numnumeric = pw.replace (/[0-9]/g, "");
var numeric=(pw.length - numnumeric.length);
if (numeric>3)
numeric=3;
//use of symbols in the password
var symbols = pw.replace (/\W/g, "");
var numsymbols=(pw.length - symbols.length);
if (numsymbols>3)
numsymbols=3;
//use of uppercase in the password
var numupper = pw.replace (/[A-Z]/g, "");
var upper=(pw.length - numupper.length);
if (upper>3)
upper=3;
var pwstrength=((pwlength*10)-20) + (numeric*10) + (numsymbols*15) + (upper*10);
var mymeter=document.getElementById('pwmeter');
mymeter.setAttribute("value",pwstrength);
return;
}
function checkPasswords()
{
var pw1=document.getElementById('pw1').value;
var pw2=document.getElementById('pw2').value;
var ok=document.getElementById('ok-button');
if (pw1 == "") {
ok.setAttribute("disabled","true");
return;
}
if (pw1 == pw2){
ok.setAttribute("disabled","false");
} else
{
ok.setAttribute("disabled","true");
}
}

View File

@@ -0,0 +1,37 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
/*
* These are helper functions to be included
* pippki UI js files.
*/
function setText(id, value) {
var element = document.getElementById(id);
if (!element) return;
if (element.hasChildNodes())
element.removeChild(element.firstChild);
var textNode = document.createTextNode(value);
element.appendChild(textNode);
}

View File

@@ -0,0 +1,90 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
<!ENTITY % prefSec SYSTEM "chrome://pippki/locale/pref-security.dtd">
<!ENTITY % prefSslDTD SYSTEM "chrome://pippki/locale/pref-ssl.dtd">
%brandDTD;
%prefSec;
%prefSslDTD;
]>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="color-dialog"
orient="vertical" title="certs.title;"
onload="parent.initPanel('chrome://pippki/content/pref-certs.xul');">
<!-- List elements to manage for prefs -->
<script type="application/x-javascript" src="chrome://pippki/content/pref-security.js"/>
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = [ "certSelection" ];
]]>
</script>
<!-- Fancy panel header -->
<hbox class="box-smallheader" title="&certs.label;"/>
<groupbox orient="vertical" autostretch="never">
<label value="&SSLClientAuthMethod;"/>
<html> &certselect.description; </html>
<!-- Prefs -->
<radiogroup id="certSelection" pref="true" preftype="string"
prefstring="security.default_personal_cert" prefattribute="value">
<radio group="certSelection" label="&certselect.auto;" value="Select Automatically"/>
<radio group="certSelection" label="&certselect.ask;" value="Ask Every Time"/>
</radiogroup>
</groupbox>
<!-- Certificate manager -->
<groupbox orient="vertical">
<label value="&managecerts.label;"/>
<html>&managecerts.text;</html>
<hbox halign="left" autostretch="never">
<button class="dialog" label="&managecerts.button;" disabled="false"
oncommand="openCertManager();"
id="openCertManagerButton"
pref="true" preftype="bool" prefattribute="disabled"
prefstring="security.disable_button.openCertManager"/>
</hbox>
</groupbox>
<!-- Device manager -->
<groupbox orient="vertical">
<label value="&managedevices.label;"/>
<html>&managedevices.text;</html>
<hbox halign="left" autostretch="never">
<button class="dialog" label="&managedevices.button;" disabled="false"
oncommand="openDeviceManager();"
id="openDeviceManagerButton"
pref="true" preftype="bool" prefattribute="disabled"
prefstring="security.disable_button.openDeviceManager"/>
</hbox>
</groupbox>
</window>

View File

@@ -0,0 +1,143 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pref-ssl.dtd">
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<window id="pref-ciphers" title="&cipher.title;"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="onLoad();" orient="vertical">
<script type="application/x-javascript"><![CDATA[
var prefs = null;
function onLoad() {
doSetOKCancel(doOK, doCancel);
// Set checkboxes from prefs
const nsIPref = Components.interfaces.nsIPref;
prefs = Components.classes["@mozilla.org/preferences;1"].getService(nsIPref);
// Enumerate each checkbox on this page and set value
var prefElements = document.getElementsByAttribute("pref", "true");
for (var i = 0; i < prefElements.length; i++) {
var element = prefElements[i];
var prefString = element.getAttribute("prefstring");
var prefValue = false;
try {
prefValue = prefs.GetBoolPref(prefString);
} catch(e) { /* Put debug output here */ }
element.setAttribute("checked", prefValue);
// disable xul element if the pref is locked.
if (prefs.PrefIsLocked(prefString)) {
element.disabled=true;
}
}
}
function doOK() {
// Save the prefs
try {
// Enumerate each checkbox on this page and save the value
var prefElements = document.getElementsByAttribute("pref", "true");
for (var i = 0; i < prefElements.length; i++) {
var element = prefElements[i];
var prefString = element.getAttribute("prefstring");
var prefValue = element.getAttribute("checked");
if (typeof(prefValue) == "string") prefValue = (prefValue == "true");
prefs.SetBoolPref(prefString, prefValue);
}
prefs.savePrefFile(null);
} catch(e) { }
window.close();
}
function doCancel() {
window.close();
}
]]></script>
<vbox style="overflow: hidden;" flex="1">
<groupbox orient="vertical" autostretch="never">
<label value="&cipher.ssl2.label;"/>
<checkbox label="&cipher.ssl2.rc4_128;" pref="true"
prefstring="security.ssl2.rc4_128"/>
<checkbox label="&cipher.ssl2.rc2_128;" pref="true"
prefstring="security.ssl2.rc2_128"/>
<checkbox label="&cipher.ssl2.des_ede3_192;" pref="true"
prefstring="security.ssl2.des_ede3_192"/>
<checkbox label="&cipher.ssl2.des_64;" pref="true"
prefstring="security.ssl2.des_64"/>
<checkbox label="&cipher.ssl2.rc4_40;" pref="true"
prefstring="security.ssl2.rc4_40"/>
<checkbox label="&cipher.ssl2.rc2_40;" pref="true"
prefstring="security.ssl2.rc2_40"/>
</groupbox>
<groupbox orient="vertical" autostretch="never">
<label value="&cipher.ssl3.label;"/>
<checkbox label="&cipher.ssl3.rsa_rc4_128_md5;" pref="true"
prefstring="security.ssl3.rsa_rc4_128_md5"/>
<checkbox label="&cipher.ssl3.rsa_fips_des_ede3_sha;" pref="true"
prefstring="security.ssl3.rsa_fips_des_ede3_sha"/>
<checkbox label="&cipher.ssl3.rsa_des_ede3_sha;" pref="true"
prefstring="security.ssl3.rsa_des_ede3_sha"/>
<checkbox label="&cipher.ssl3.rsa_fips_des_sha;" pref="true"
prefstring="security.ssl3.rsa_fips_des_sha"/>
<checkbox label="&cipher.ssl3.rsa_des_sha;" pref="true"
prefstring="security.ssl3.rsa_des_sha"/>
<checkbox label="&cipher.ssl3.rsa_1024_rc4_56_sha;" pref="true"
prefstring="security.ssl3.rsa_1024_rc4_56_sha"/>
<checkbox label="&cipher.ssl3.rsa_1024_des_cbc_sha;" pref="true"
prefstring="security.ssl3.rsa_1024_des_cbc_sha"/>
<checkbox label="&cipher.ssl3.rsa_rc4_40_md5;" pref="true"
prefstring="security.ssl3.rsa_rc4_40_md5"/>
<checkbox label="&cipher.ssl3.rsa_rc2_40_md5;" pref="true"
prefstring="security.ssl3.rsa_rc2_40_md5"/>
<checkbox label="&cipher.ssl3.rsa_null_md5;" pref="true"
prefstring="security.ssl3.rsa_null_md5"/>
</groupbox>
<separator/>
<keyset id="dialogKeys"/>
<hbox id="okCancelButtonsRight"/>
</vbox>
</window>

View File

@@ -0,0 +1,101 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
const nsIPK11Token = Components.interfaces.nsIPK11Token;
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
var internal_token;
function onMasterPasswordLoad()
{
var tokendb = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
internal_token = tokendb.getInternalKeyToken();
var askTimes = internal_token.getAskPasswordTimes();
switch (askTimes) {
case nsIPK11Token.ASK_FIRST_TIME: askTimes = 0; break;
case nsIPK11Token.ASK_EVERY_TIME: askTimes = 1; break;
case nsIPK11Token.ASK_EXPIRE_TIME: askTimes = 2; break;
}
var radiogroup = document.getElementById("passwordAskTimes");
var radioitem;
switch (askTimes) {
case 0: radioitem = document.getElementById("askFirstTime"); break;
case 1: radioitem = document.getElementById("askEveryTime"); break;
case 2: radioitem = document.getElementById("askTimeout"); break;
}
radiogroup.selectedItem = radioitem;
var timeout = internal_token.getAskPasswordTimeout();
var timeoutField = document.getElementById("passwordTimeout");
timeoutField.setAttribute("value", timeout);
changePasswordSettings();
}
function changePasswordSettings()
{
var askTimes = 0;
var timeout = internal_token.getAskPasswordTimeout();
var timeoutField = document.getElementById("passwordTimeout");
var radiogroup = document.getElementById("passwordAskTimes");
switch ( radiogroup.value ) {
case "0":
timeoutField.setAttribute("disabled", true);
askTimes = nsIPK11Token.ASK_FIRST_TIME;
break;
case "1":
timeoutField.setAttribute("disabled", true);
askTimes = nsIPK11Token.ASK_EVERY_TIME;
break;
case "2":
timeoutField.removeAttribute("disabled");
timeoutField.focus();
timeout = timeoutField.value;
var re = new RegExp("^[0-9]+$");
if (!re.test(timeout)) {
timeout = "1";
}
askTimes = nsIPK11Token.ASK_EXPIRE_TIME;
break;
}
internal_token.setAskPasswordDefaults(askTimes, timeout);
}
function ChangePW()
{
window.open("chrome://pippki/content/changepassword.xul",
internal_token.tokenName,
"chrome,resizable=1,modal=1,dialog=1");
}

View File

@@ -0,0 +1,100 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
<!ENTITY % prefPass SYSTEM "chrome://pippki/locale/pref-masterpass.dtd">
%brandDTD;
%prefPass;
]>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="color-dialog"
orient="vertical" title="certs.title;"
onload="parent.initPanel('chrome://pippki/content/pref-masterpass.xul'); onMasterPasswordLoad();">
<script type="application/x-javascript" src="chrome://pippki/content/pref-masterpass.js"/>
<!-- Fancy panel header -->
<hbox class="box-smallheader" title="&lheader;"/>
<!-- Change Password -->
<groupbox orient="vertical">
<label value="&changepassword.label;"/>
<html>&changepassword.text;</html>
<hbox halign="left" autostretch="never">
<button class="dialog" label="&changepassword.button;" disabled="false"
oncommand="ChangePW();"
id="changePasswordButton"
pref="true" preftype="bool" prefattribute="disabled"
prefstring="security.disable_button.changePassword"/>
</hbox>
</groupbox>
<!-- Password Prefs -->
<groupbox orient="vertical">
<label value="&managepassword.label;"/>
<html>&managepassword.text;</html>
<hbox halign="left" autostretch="never">
<radiogroup id="passwordAskTimes" orient="vertical"
pref="true" preftype="int"
prefstring="security.ask_for_password" prefattribute="value"
flex="1">
<!-- note that these values are different than what NSS uses, which
are (0, -1, 1) respectively -->
<grid>
<rows>
<box>
<radio value="0" label="" style="margin: 0px; max-width: 2em;"
id="askFirstTime" group="passwordAskTimes"
oncommand="changePasswordSettings();"/>
<text value="&managepassword.askfirsttime;" style="margin: 4px;"/>
</box>
<box>
<radio value="1" label="" style="margin: 0px; max-width: 2em;"
id="askEveryTime" group="passwordAskTimes"
oncommand="changePasswordSettings();"/>
<text value="&managepassword.askeverytime;" style="margin: 4px;"/>
</box>
<box>
<radio value="2" label="" style="margin: 0px; max-width: 2em;"
id="askTimeout" group="passwordAskTimes"
oncommand="changePasswordSettings();"/>
<text value="&managepassword.asktimeout;" style="margin: 4px;"/>
<textbox id="passwordTimeout" size="4"
pref="true" preftype="int"
prefstring="security.password_lifetime"
prefattribute="value"
oninput="changePasswordSettings();"/>
<text value="&managepassword.timeout.unit;" style="margin: 4px;"/>
</box>
</rows>
</grid>
</radiogroup>
</hbox>
</groupbox>
</window>

View File

@@ -0,0 +1,46 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
function openCertManager()
{
window.open('chrome://pippki/content/certManager.xul', "",
'chrome,width=500,height=400,resizable=yes,dialog=no');
}
function openDeviceManager()
{
window.open('chrome://pippki/content/device_manager.xul', "devmgr",
'chrome,width=540,height=360,resizable=yes');
}

View File

@@ -0,0 +1,101 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
<!ENTITY % prefSslDTD SYSTEM "chrome://pippki/locale/pref-ssl.dtd">
%brandDTD;
%prefSslDTD;
]>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="color-dialog"
orient="vertical" title="Security Preferences"
onload="parent.initPanel('chrome://pippki/content/pref-ssl.xul');">
<!-- List elements to manage for prefs -->
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["enableSSL2", "enableSSL3", "enableTLS",
"warnEnteringSecure", "warnEnteringWeak",
"warnLeavingSecure", "warnInsecurePost",
"warnViewMixed" ];
]]>
</script>
<!-- Fancy panel header -->
<hbox class="box-smallheader" title="SSL"/>
<groupbox orient="horizontal">
<label value="&SSLProtocolVersions;"/>
<!-- Prefs -->
<vbox flex="1" autostretch="never" >
<checkbox id="enableSSL2" label="&enable.ssl2;"
pref="true" preftype="bool" prefstring="security.enable_ssl2"
prefattribute="checked"/>
<checkbox id="enableSSL3" label="&enable.ssl3;"
pref="true" preftype="bool" prefstring="security.enable_ssl3"
prefattribute="checked"/>
<checkbox id="enableTLS" label="&enable.tls;"
pref="true" preftype="bool" prefstring="security.enable_tls"
prefattribute="checked"/>
</vbox>
<vbox halign="right">
<button class="dialog" label="&edit.sslciphers;"
oncommand="window.openDialog('chrome://pippki/content/pref-ciphers.xul', '',
'modal=yes,resizable,chrome');"
id="editSSLCiphersButton"
pref="true" preftype="bool" prefattribute="disabled"
prefstring="security.disable_button.editSSLCiphers"/>
</vbox>
</groupbox>
<groupbox orient="vertical" autostretch="never">
<label value="&SSLWarnings;"/>
<html>&warn.description;</html>
<!-- Prefs -->
<checkbox id="warnEnteringSecure" label="&warn.enteringsecure;"
pref="true" preftype="bool" prefstring="security.warn_entering_secure"
prefattribute="checked"/>
<checkbox id="warnEnteringWeak" label="&warn.enteringweak;"
pref="true" preftype="bool" prefstring="security.warn_entering_weak"
prefattribute="checked"/>
<checkbox id="warnLeavingSecure" label="&warn.leavingsecure;"
pref="true" preftype="bool" prefstring="security.warn_leaving_secure"
prefattribute="checked"/>
<checkbox id="warnInsecurePost" label="&warn.insecurepost;"
pref="true" preftype="bool" prefstring="security.warn_submit_insecure"
prefattribute="checked"/>
<checkbox id="warnViewMixed" label="&warn.viewmixed;"
pref="true" preftype="bool" prefstring="security.warn_viewing_mixed"
prefattribute="checked" checked="true"/>
</groupbox>
</window>

View File

@@ -0,0 +1,95 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Drinan <ddrinan@netscape.com>
*/
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIOCSPResponder = Components.interfaces.nsIOCSPResponder;
const nsISupportsArray = Components.interfaces.nsISupportsArray;
var certdb;
var ocspResponders;
function onLoad()
{
var ocspEntry;
var i;
certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
ocspResponders = certdb.getOCSPResponders();
var signersMenu = document.getElementById("signingCA");
var signersURL = document.getElementById("serviceURL");
for (i=0; i<ocspResponders.Count(); i++) {
ocspEntry = ocspResponders.GetElementAt(i).QueryInterface(nsIOCSPResponder);
var menuItemNode = document.createElement("menuitem");
menuItemNode.setAttribute("value", ocspEntry.responseSigner);
menuItemNode.setAttribute("label", ocspEntry.responseSigner);
signersMenu.firstChild.appendChild(menuItemNode);
}
parent.initPanel('chrome://pippki/content/pref-validation.xul');
doEnabling();
}
function doEnabling()
{
var signersMenu = document.getElementById("signingCA");
var signersURL = document.getElementById("serviceURL");
var radiogroup = document.getElementById("securityOCSPEnabled");
switch ( radiogroup.value ) {
case "0":
case "1":
signersMenu.setAttribute("disabled", true);
signersURL.setAttribute("disabled", true);
break;
case "2":
default:
signersMenu.removeAttribute("disabled");
signersURL.removeAttribute("disabled");
}
}
function changeURL()
{
var signersMenu = document.getElementById("signingCA");
var signersURL = document.getElementById("serviceURL");
var CA = signersMenu.getAttribute("value");
var i;
var ocspEntry;
for (i=0; i < ocspResponders.Count(); i++) {
ocspEntry = ocspResponders.GetElementAt(i).QueryInterface(nsIOCSPResponder);
if (CA == ocspEntry.responseSigner) {
signersURL.setAttribute("value", ocspEntry.serviceURL);
break;
}
}
}
function openCrlManager()
{
window.open('chrome://pippki/content/crlManager.xul', "",
'chrome,width=500,height=400,resizable=1');
}

View File

@@ -0,0 +1,97 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- David Drinan <ddrinan@netscape.com>
-->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://communicator/skin/dialogOverlay.css" type="text/css"?>
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd">
<!ENTITY % prefValidationDTD SYSTEM "chrome://pippki/locale/pref-validation.dtd">
%brandDTD;
%prefValidationDTD;
]>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="color-dialog"
orient="vertical"
onload="onLoad();">
<!-- List elements to manage for prefs -->
<script type="application/x-javascript">
<![CDATA[
var _elementIDs = ["securityOCSPEnabled", "serviceURL", "signingCA"];
]]>
</script>
<script type="application/x-javascript" src="chrome://pippki/content/pref-validation.js"/>
<!-- Fancy panel header -->
<hbox class="box-smallheader" title="&validation.title;"/>
<groupbox orient="vertical">
<label value="&validation.crl.label;"/>
<html>&validation.crl.description;</html>
<hbox halign="left" autostretch="never">
<button class="dialog" label="&validation.managecrls.button;"
oncommand="openCrlManager();"
id="managecrlbutton"
pref="true" preftype="bool" prefattribute="disabled"
prefstring="security.OCSP.disable_button.managecrl"/>
</hbox>
</groupbox>
<groupbox orient="vertical" autostretch="never" >
<label value="&validation.ocsp.label;"/>
<html>&validation.ocsp.description;</html>
<!-- Prefs -->
<radiogroup id="securityOCSPEnabled" orient="vertical" autostretch="never"
pref="true" preftype="int" prefstring="security.OCSP.enabled"
prefattribute="value">
<radio group="securityOCSPEnabled" value="0" label="&disableOCSP.label;" oncommand="doEnabling();"/>
<radio group="securityOCSPEnabled" value="1" label="&certOCSP.label;" oncommand="doEnabling();"/>
<radio group="securityOCSPEnabled" value="2" label="&proxyOCSP.label;" oncommand="doEnabling();"/>
<grid class="indent" flex="1">
<columns>
<column/>
<column flex="1"/>
</columns>
<rows>
<row>
<text class="label" value="&signingCA.label;" for="signingCA"/>
<menulist id="signingCA" pref="true" preftype="string" prefstring="security.OCSP.signingCA"
prefattribute="value" flex="1" oncommand="changeURL()">
<menupopup/>
</menulist>
</row>
<row>
<text class="label" value="&serviceURL.label;" for="serviceURL"/>
<textbox id="serviceURL" pref="true" preftype="string" prefstring="security.OCSP.URL"
prefattribute="value" flex="1"/>
</row>
</rows>
</grid>
</radiogroup>
</groupbox>
</window>

View File

@@ -0,0 +1,84 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var dialogParams;
var pkiParams;
var cert=null;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var title = dialogParams.GetString(2);
window.title = title;
var bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var message1 = dialogParams.GetString(1);
var currDate = new Date();
var message2 = bundle.formatStringFromName("serverCertExpiredMsg2",
[ currDate.toLocaleString() ],
1);
setText("message1", message1);
setText("message2", message2);
//Set the focus so key press events work.
document.getElementById('ok-button').focus();
var xulWindow = document.getElementById("serverCertExpired");
var wdth = window.innerWidth; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("width",window.innerWidth + 30);
var hght = window.innerHeight; // THIS IS NEEDED,
window.sizeToContent();
xulWindow.setAttribute("height",window.innerHeight + 40);
}
function doOK()
{
dialogParams.SetInt(1,1);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}
function viewCert()
{
if (cert == null) {
var isupport = pkiParams.getISupportAtIndex(1);
cert = isupport.QueryInterface(nsIX509Cert);
}
cert.view();
}

View File

@@ -0,0 +1,62 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="serverCertExpired"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
width="300"
onload="onLoad();">
<script type="application/x-javascript" src="chrome://global/content/strres.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript" src="chrome://pippki/content/serverCertExpired.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK()" />
<key id="return-key" keycode="VK_RETURN" oncommand="doOK()" />
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel()"/>
</keyset>
<vbox style="margin: 5px;" flex="100%">
<html id="message1" flex="100%"/>
<separator/>
<html id="message2" flex="100%"/>
<separator/>
<text value="&serverCertExpired.continue;" flex="100%"/>
<separator/>
<hbox>
<button id="examineCert-button" class="dialog" label="&examineCert.label;"
oncommand="viewCert();"/>
</hbox>
<separator/>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;" primary="true"
oncommand="doOK();" disabled="false"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="doCancel();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?exp_web_cert');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,75 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* David Drinan <ddrinan@netscape.com>
*/
const nsIDialogParamBlock = Components.interfaces.nsIDialogParamBlock;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIX509Cert = Components.interfaces.nsIX509Cert;
var dialogParams;
var pkiParams;
var bundle;
function onLoad()
{
pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
dialogParams = pkiParams.QueryInterface(nsIDialogParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
var cert = isupport.QueryInterface(nsIX509Cert);
bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
// Organization
addAttributeFromCert('organization', cert.organization);
// Organizational Unit
addAttributeFromCert('orgunit', cert.organizationalUnit);
//Set the focus so key press events work.
document.getElementById('ok-button').focus();
}
function doOK()
{
dialogParams.SetInt(1,1);
window.close();
}
function doCancel()
{
dialogParams.SetInt(1,0);
window.close();
}
function managerCrls()
{
window.open('chrome://pippki/content/crlManager.xul', "",
'chrome,width=500,height=400,resizable=1');
}
function addAttributeFromCert(nodeName, value)
{
var node = document.getElementById(nodeName);
if (!value) {
value = bundle.GetStringFromName('notPresent');
}
node.setAttribute('value',value)
}

View File

@@ -0,0 +1,87 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- David Drinan <ddrinan@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!-- CHANGE THIS WHEN MOVING FILES -->
<!DOCTYPE window [
<!ENTITY % pipPkiDTD SYSTEM "chrome://pippki/locale/pippki.dtd">
%pipPkiDTD;
<!ENTITY % prefCertMgrDTD SYSTEM "chrome://pippki/locale/certManager.dtd">
%prefCertMgrDTD;
]>
<window
id="serverCrlExpired"
title="&serverCrlExpired.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
debug="false"
style="width: 30em; height: 16em"
onload="onLoad();"
>
<script type="application/x-javascript" src="chrome://global/content/strres.js" />
<script type="application/x-javascript" src="chrome://pippki/content/pippki.js" />
<script type="application/x-javascript" src="chrome://pippki/content/serverCrlExpired.js" />
<script type="application/x-javascript" src="chrome://help/content/help.js" />
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="doOK()" />
<key id="return-key" keycode="VK_RETURN" oncommand="doOK()" />
<key id="esc-key" keycode="VK_ESCAPE" oncommand="doCancel()"/>
</keyset>
<vbox style="margin: 5px;" flex="100%">
<html> &serverCrlExpired.message1; </html>
<separator/>
<grid>
<columns>
<column />
<column />
</columns>
<rows>
<row>
<text class="label" value="&certmgr.certdetail.o;" />
<text id="organization"/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.ou;" />
<text id="orgunit"/>
</row>
</rows>
</grid>
<separator/>
<html> &serverCrlExpired.message2; </html>
<separator/>
<html> &serverCrlExpired.continue; </html>
<separator/>
<hbox>
<button id="manageCrlCert-button" class="dialog" label="&serverCrlExpired.manageCrls.label;"
onclick="managerCrls();"/>
</hbox>
<separator/>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;" primary="true"
onclick="doOK();" disabled="false"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
onclick="doCancel();" />
<button id="help-button" class="dialog" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?exp_web_cert_crl');" />
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,88 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<!DOCTYPE window SYSTEM "chrome://pippki/locale/pippki.dtd">
<window id="setp12password" title="&pkcs12.setpassword.title;"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
height="480"
width="360"
onload="onP12Load();">
<script type="application/x-javascript" src="chrome://pippki/content/password.js"/>
<script type="application/x-javascript" src="chrome://help/content/help.js"/>
<vbox style="margin: 5px;" flex="1">
<html>&pkcs12.setpassword.message;</html>
<separator />
<grid>
<columns> <column/> <column/> </columns>
<rows>
<row>
<text value="&pkcs12.setpassword.label1;"/>
<textbox id="pw1" type="password"
onkeypress="setPasswordStrength(); checkPasswords();"/>
</row>
<row>
<text value="&pkcs12.setpassword.label2;"/>
<textbox id="pw2" type="password"
onkeypress="checkPasswords();"/>
</row>
</rows>
</grid>
<separator/>
<html>&pkcs12.setpassword.reminder;</html>
<separator/>
<text value="&setPassword.meter.label;"/>
<grid style="margin: 4px;">
<rows> <row/> </rows>
<columns>
<column style="margin: 5px;">
<progressmeter flex="1" id="pwmeter" mode="determined" value="0%"
orient="horizontal" progresstext="Loading"
width="200" style="foreground-color: red"/>
</column>
</columns>
</grid>
<keyset id="keys">
<key id="enter-key" keycode="VK_ENTER" oncommand="if (!document.getElementById('ok-button').disabled) setP12Password();"/>
<key id="return-key" keycode="VK_RETURN" oncommand="if (!document.getElementById('ok-button').disabled) setP12Password();"/>
<key id="esc-key" keycode="VK_ESCAPE" oncommand="window.close();"/>
</keyset>
<hbox>
<button id="ok-button" class="dialog" label="&ok.label;"
oncommand="setP12Password();" disabled="true"/>
<button id="cancel-button" class="dialog" label="&cancel.label;"
oncommand="window.close();"/>
<button id="help-button" class="dialog" label="&help.label;"
oncommand="openHelp('chrome://help/content/help.xul?cert_backup_pwd');"/>
</hbox>
</vbox>
</window>

View File

@@ -0,0 +1,255 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Bob Lord <lord@netscape.com>
* Ian McGreer <mcgreer@netscape.com>
* Javier Delgadillo <javi@netscape.com>
*/
const nsIX509Cert = Components.interfaces.nsIX509Cert;
const nsX509CertDB = "@mozilla.org/security/x509certdb;1";
const nsIX509CertDB = Components.interfaces.nsIX509CertDB;
const nsPK11TokenDB = "@mozilla.org/security/pk11tokendb;1";
const nsIPK11TokenDB = Components.interfaces.nsIPK11TokenDB;
const nsIPKIParamBlock = Components.interfaces.nsIPKIParamBlock;
const nsIASN1Object = Components.interfaces.nsIASN1Object;
const nsIASN1Sequence = Components.interfaces.nsIASN1Sequence;
const nsIASN1PrintableItem = Components.interfaces.nsIASN1PrintableItem;
const nsIASN1Outliner = Components.interfaces.nsIASN1Outliner;
const nsASN1Outliner = "@mozilla.org/security/nsASN1Outliner;1"
var bundle;
function AddCertChain(node, chain, idPrefix)
{
var idfier = idPrefix+"chain_";
var child = document.getElementById(node);
var numCerts = chain.Count();
var currCert;
var displayVal;
var addTwistie;
for (var i=numCerts-1; i>=0; i--) {
currCert = chain.GetElementAt(i);
currCert = currCert.QueryInterface(nsIX509Cert);
if (currCert.commonName) {
displayVal = currCert.commonName;
} else {
displayVal = currCert.windowTitle;
}
if (0 == i) {
addTwistie = false;
} else {
addTwistie = true;
}
child = addChildrenToTree(child, displayVal, currCert.dbKey,addTwistie);
}
}
function AddUsage(usage,verifyInfoBox)
{
var text = document.createElement("textbox");
text.setAttribute("value", usage);
text.setAttribute("style", "margin: 2px 5px");
text.setAttribute("readonly", "true");
text.setAttribute("class", "scrollfield");
verifyInfoBox.appendChild(text);
}
function setWindowName()
{
// Get the cert from the cert database
var certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
var windowReference=document.getElementById('certDetails');
myName = self.name;
bundle = srGetStrBundle("chrome://pippki/locale/pippki.properties");
var cert;
certDetails = bundle.GetStringFromName('certDetails');
if (myName != "_blank") {
windowReference.setAttribute("title",certDetails+'"'+myName+'"');
// Get the token
// XXX ignore this for now. NSS will find the cert on a token
// by "tokenname:certname", which is what we have.
//var tokenName = "";
//var pk11db = Components.classes[nsPK11TokenDB].getService(nsIPK11TokenDB);
//var token = pk11db.findTokenByName(tokenName);
//var cert = certdb.getCertByNickname(token, myName);
cert = certdb.getCertByNickname(null, myName);
} else {
var pkiParams = window.arguments[0].QueryInterface(nsIPKIParamBlock);
var isupport = pkiParams.getISupportAtIndex(1);
cert = isupport.QueryInterface(nsIX509Cert);
windowReference.setAttribute("title",
certDetails+'"'+cert.windowTitle+'"');
}
//
// Set the cert attributes for viewing
//
// The chain of trust
var chain = cert.getChain();
AddCertChain("chainDump", chain,"dump_");
DisplayGeneralDataFromCert(cert);
BuildPrettyPrint(cert);
}
function addChildrenToTree(parentTree,label,value,addTwistie)
{
var treeChild1 = document.createElement("treechildren");
var treeElement = addTreeItemToTreeChild(treeChild1,label,value,addTwistie);
parentTree.appendChild(treeChild1);
return treeElement;
}
function addTreeItemToTreeChild(treeChild,label,value,addTwistie)
{
var treeElem1 = document.createElement("treeitem");
if (addTwistie) {
treeElem1.setAttribute("container","true");
treeElem1.setAttribute("open","true");
}
var treeRow = document.createElement("treerow");
var treeCell = document.createElement("treecell");
treeCell.setAttribute("class", "treecell-indent");
treeCell.setAttribute("label",label);
if (value)
treeCell.setAttribute("display",value);
treeRow.appendChild(treeCell);
treeElem1.appendChild(treeRow);
treeChild.appendChild(treeElem1);
return treeElem1;
}
function displaySelected() {
var asn1Outliner = document.getElementById('prettyDumpOutliner').
outlinerBoxObject.view.QueryInterface(nsIASN1Outliner);
var items = asn1Outliner.selection;
var certDumpVal = document.getElementById('certDumpVal');
if (items.currentIndex != -1) {
var value = asn1Outliner.getDisplayData(items.currentIndex);
certDumpVal.setAttribute("value", value);
} else {
certDumpVal.setAttribute("value","");
}
}
function BuildPrettyPrint(cert)
{
var certDumpOutliner = Components.classes[nsASN1Outliner].
createInstance(nsIASN1Outliner);
certDumpOutliner.loadASN1Structure(cert.ASN1Structure);
document.getElementById('prettyDumpOutliner').
outlinerBoxObject.view = certDumpOutliner;
}
function addAttributeFromCert(nodeName, value)
{
var node = document.getElementById(nodeName);
if (!value) {
value = bundle.GetStringFromName('notPresent');
}
node.setAttribute('value',value)
}
function DisplayGeneralDataFromCert(cert)
{
// Verification and usage
var verifystr = "";
var o1 = {};
var o2 = {};
var o3 = {};
cert.getUsages(o1, o2, o3);
var verifystate = o1.value;
var count = o2.value;
var usageList = o3.value;
if (verifystate == cert.VERIFIED_OK) {
verifystr = bundle.GetStringFromName('certVerified');
} else if (verifystate == cert.CERT_REVOKED) {
verifystr = bundle.GetStringFromName('certNotVerified_CertRevoked');
} else if (verifystate == cert.CERT_EXPIRED) {
verifystr = bundle.GetStringFromName('certNotVerified_CertExpired');
} else if (verifystate == cert.CERT_NOT_TRUSTED) {
verifystr = bundle.GetStringFromName('certNotVerified_CertNotTrusted');
} else if (verifystate == cert.ISSUER_NOT_TRUSTED) {
verifystr = bundle.GetStringFromName('certNotVerified_IssuerNotTrusted');
} else if (verifystate == cert.ISSUER_UNKNOWN) {
verifystr = bundle.GetStringFromName('certNotVerified_IssuerUnknown');
} else if (verifystate == cert.INVALID_CA) {
verifystr = bundle.GetStringFromName('certNotVerified_CAInvalid');
} else { /* if (verifystate == cert.NOT_VERIFIED_UNKNOWN) */
verifystr = bundle.GetStringFromName('certNotVerified_Unknown');
}
var verified=document.getElementById('verified');
verified.setAttribute("value", verifystr);
if (count > 0) {
var verifyInfoBox = document.getElementById('verify_info_box');
for (var i=0; i<count; i++) {
AddUsage(usageList[i],verifyInfoBox);
}
}
// Common Name
addAttributeFromCert('commonname', cert.commonName);
// Organization
addAttributeFromCert('organization', cert.organization);
// Organizational Unit
addAttributeFromCert('orgunit', cert.organizationalUnit);
// Serial Number
addAttributeFromCert('serialnumber',cert.serialNumber);
// SHA1 Fingerprint
addAttributeFromCert('sha1fingerprint',cert.sha1Fingerprint);
// MD5 Fingerprint
addAttributeFromCert('md5fingerprint',cert.md5Fingerprint);
// Validity start
addAttributeFromCert('validitystart', cert.issuedDate);
// Validity end
addAttributeFromCert('validityend', cert.expiresDate);
//Now to populate the fields that correspond to the issuer.
var issuerCommonname, issuerOrg, issuerOrgUnit;
issuerCommonname = cert.issuerCommonName;
issuerOrg = cert.issuerOrganization;
issuerOrgUnit = cert.issuerOrganizationalUnit;
addAttributeFromCert('issuercommonname', issuerCommonname);
addAttributeFromCert('issuerorganization', issuerOrg);
addAttributeFromCert('issuerorgunit', issuerOrgUnit);
}
function updateCertDump()
{
var asn1Outliner = document.getElementById('prettyDumpOutliner').
outlinerBoxObject.view.QueryInterface(nsIASN1Outliner);
var tree = document.getElementById('treesetDump');
var items=tree.selectedItems;
if (items.length==0) {
alert("No items are selected."); //This should never happen.
} else {
var dbKey = items[0].firstChild.firstChild.getAttribute('display');
// Get the cert from the cert database
var certdb = Components.classes[nsX509CertDB].getService(nsIX509CertDB);
var cert = certdb.getCertByDBKey(dbKey,null);
asn1Outliner.loadASN1Structure(cert.ASN1Structure);
}
displaySelected();
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Ian McGreer <mcgreer@netscape.com>
-->
<!DOCTYPE overlay SYSTEM "chrome://pippki/locale/certManager.dtd">
<overlay id="certViewerOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cert="http://netscape.com/rdf-cert#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<vbox class="box-padded" id="general_info">
<vbox id="verify_info_box">
<text class="header" id="verified"/>
</vbox>
<separator class="groove"/>
<vbox flex="1">
<grid>
<columns>
<column/>
<column/>
</columns>
<rows>
<row>
<text class="header" value="&certmgr.subjectinfo.label;"/>
<spring/>
<spring/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.cn;"/>
<text id="commonname"/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.o;"/>
<text id="organization"/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.ou;"/>
<text id="orgunit"/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.serialnumber;"/>
<text id="serialnumber"/>
</row>
<row>
<separator class="thin"/>
<spring/>
</row>
<row>
<text class="header" value="&certmgr.issuerinfo.label;"/>
<spring/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.cn;"/>
<text id="issuercommonname"/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.o;"/>
<text id="issuerorganization"/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.ou;"/>
<text id="issuerorgunit"/>
</row>
<row>
<separator class="thin"/>
<spring/>
</row>
<row>
<text class ="header" value="&certmgr.validity.label;"/>
<spring/>
</row>
<row>
<text class="label" value="&certmgr.issued;"/>
<text id="validitystart"/>
</row>
<row>
<text class="label" value="&certmgr.expires;"/>
<text id="validityend"/>
</row>
<row>
<separator class="thin"/>
<spring/>
</row>
<row>
<text class="header" value="&certmgr.fingerprints.label;"/>
<spring/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.sha1fingerprint;"/>
<text id="sha1fingerprint"/>
</row>
<row>
<text class="label" value="&certmgr.certdetail.md5fingerprint;"/>
<text id="md5fingerprint"/>
</row>
</rows>
</grid>
</vbox>
</vbox>
</overlay>

View File

@@ -0,0 +1,72 @@
pippki.jar:
content/pippki/contents.rdf (content/contents.rdf)
content/pippki/changepassword.xul (content/changepassword.xul)
content/pippki/getpassword.xul (content/getpassword.xul)
content/pippki/password.js (content/password.js)
content/pippki/PrefOverlay.xul (content/PrefOverlay.xul)
content/pippki/pref-security.js (content/pref-security.js)
content/pippki/pref-ssl.xul (content/pref-ssl.xul)
content/pippki/pref-certs.xul (content/pref-certs.xul)
content/pippki/pref-ciphers.xul (content/pref-ciphers.xul)
content/pippki/PageInfoOverlay.xul (content/PageInfoOverlay.xul)
content/pippki/newserver.js (content/newserver.js)
content/pippki/newserver.xul (content/newserver.xul)
content/pippki/downloadcert.js (content/downloadcert.js)
content/pippki/downloadcert.xul (content/downloadcert.xul)
content/pippki/cacertexists.js (content/cacertexists.js)
content/pippki/cacertexists.xul (content/cacertexists.xul)
content/pippki/certManager.js (content/certManager.js)
content/pippki/certManager.xul (content/certManager.xul)
content/pippki/CAOverlay.xul (content/CAOverlay.xul)
content/pippki/WebSitesOverlay.xul (content/WebSitesOverlay.xul)
content/pippki/MineOverlay.xul (content/MineOverlay.xul)
content/pippki/viewCertDetails.xul (content/viewCertDetails.xul)
content/pippki/editcacert.xul (content/editcacert.xul)
content/pippki/editsslcert.xul (content/editsslcert.xul)
content/pippki/editcerts.js (content/editcerts.js)
content/pippki/deletecert.xul (content/deletecert.xul)
content/pippki/deletecert.js (content/deletecert.js)
content/pippki/viewCertDetails.js (content/viewCertDetails.js)
content/pippki/getp12password.xul (content/getp12password.xul)
content/pippki/setp12password.xul (content/setp12password.xul)
content/pippki/pippki.js (content/pippki.js)
content/pippki/domainMismatch.xul (content/domainMismatch.xul)
content/pippki/domainMismatch.js (content/domainMismatch.js)
content/pippki/serverCertExpired.xul (content/serverCertExpired.xul)
content/pippki/serverCertExpired.js (content/serverCertExpired.js)
content/pippki/clientauthask.xul (content/clientauthask.xul)
content/pippki/clientauthask.js (content/clientauthask.js)
content/pippki/certViewer.xul (content/certViewer.xul)
content/pippki/certDump.xul (content/certDump.xul)
content/pippki/device_manager.xul (content/device_manager.xul)
content/pippki/device_manager.js (content/device_manager.js)
content/pippki/load_device.xul (content/load_device.xul)
content/pippki/choosetoken.xul (content/choosetoken.xul)
content/pippki/choosetoken.js (content/choosetoken.js)
content/pippki/escrowWarn.xul (content/escrowWarn.xul)
content/pippki/escrowWarn.js (content/escrowWarn.js)
content/pippki/pref-validation.xul (content/pref-validation.xul)
content/pippki/pref-validation.js (content/pref-validation.js)
content/pippki/crlManager.xul (content/crlManager.xul)
content/pippki/crlManager.js (content/crlManager.js)
content/pippki/pref-masterpass.js (content/pref-masterpass.js)
content/pippki/pref-masterpass.xul (content/pref-masterpass.xul)
content/pippki/serverCrlExpired.js (content/serverCrlExpired.js)
content/pippki/serverCrlExpired.xul (content/serverCrlExpired.xul)
content/pippki/createCertInfo.xul (content/createCertInfo.xul)
content/pippki/createCertInfo.js (content/createCertInfo.js)
en-US.jar:
locale/en-US/pippki/contents.rdf (locale/en-US/contents.rdf)
locale/en-US/pippki/pippki.dtd (locale/en-US/pippki.dtd)
locale/en-US/pippki/pref-ssl.dtd (locale/en-US/pref-ssl.dtd)
locale/en-US/pippki/pippki.properties (locale/en-US/pippki.properties)
locale/en-US/pippki/PrefOverlay.dtd (locale/en-US/PrefOverlay.dtd)
locale/en-US/pippki/newserver.properties (locale/en-US/newserver.properties)
locale/en-US/pippki/newserver.dtd (locale/en-US/newserver.dtd)
locale/en-US/pippki/pref-security.dtd (locale/en-US/pref-security.dtd)
locale/en-US/pippki/PageInfoOverlay.dtd (locale/en-US/PageInfoOverlay.dtd)
locale/en-US/pippki/certManager.dtd (locale/en-US/certManager.dtd)
locale/en-US/pippki/deviceManager.dtd (locale/en-US/deviceManager.dtd)
locale/en-US/pippki/pref-validation.dtd (locale/en-US/pref-validation.dtd)
locale/en-US/pippki/pref-masterpass.dtd (locale/en-US/pref-masterpass.dtd)

View File

@@ -0,0 +1,26 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<!ENTITY pageInfo.securityTab "Security">
<!ENTITY pageInfo.securityHeader "Security information for this page">
<!ENTITY pageInfo.view.label "View">

View File

@@ -0,0 +1,28 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<!ENTITY masterpass.label "Master Passwords">
<!ENTITY security.label "Privacy and Security">
<!ENTITY ssl.label "SSL">
<!ENTITY certs.label "Certificates">
<!ENTITY validation.label "Validation">

View File

@@ -0,0 +1,93 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<!ENTITY certmgr.title "Certificate Manager">
<!ENTITY certmgr.tab.mine "Your Certificates">
<!ENTITY certmgr.tab.others "Other People's">
<!ENTITY certmgr.tab.websites "Web Sites">
<!ENTITY certmgr.tab.ca "Authorities">
<!ENTITY certmgr.ca.builtins "Built-in CAs">
<!ENTITY certmgr.ca.mycas "CAs Managed By You">
<!ENTITY certmgr.mine "You have certificates from these organizations that identify you:">
<!ENTITY certmgr.others "You have certificates on file that identify these people:">
<!ENTITY certmgr.websites "You have certificates on file that identify these web sites:">
<!ENTITY certmgr.cas "You have certificates on file that identify these certificate authorities:">
<!ENTITY certmgr.detail.general_tab.title "General">
<!ENTITY certmgr.detail.prettyprint_tab.title "Details">
<!ENTITY certmgr.subjectinfo.label "Issued To">
<!ENTITY certmgr.issuerinfo.label "Issued By">
<!ENTITY certmgr.validity.label "Validity" >
<!ENTITY certmgr.fingerprints.label "Fingerprints">
<!ENTITY certmgr.certdetail.title "Certificate Detail">
<!ENTITY certmgr.certdetail.cn "Common Name (CN)">
<!ENTITY certmgr.certdetail.o "Organization (O)">
<!ENTITY certmgr.certdetail.ou "Organizational Unit (OU)">
<!ENTITY certmgr.certdetail.serialnumber "Serial Number">
<!ENTITY certmgr.certdetail.rsapubmodulus "RSA Public Modulus">
<!ENTITY certmgr.certdetail.sha1fingerprint "SHA1 Fingerprint">
<!ENTITY certmgr.certdetail.md5fingerprint "MD5 Fingerprint">
<!ENTITY certmgr.editcert.title "Edit Security Certificate Settings">
<!ENTITY certmgr.editcacert.title "Edit CA certificate trust settings">
<!ENTITY certmgr.editsslcert.title "Edit web site certificate trust settings">
<!ENTITY certmgr.editcert.edittrust "Edit trust settings:">
<!ENTITY certmgr.editcert.trustssl "This certificate can identify web sites.">
<!ENTITY certmgr.editcert.trustemail "This certificate can identify mail users.">
<!ENTITY certmgr.editcert.trustobjsign "This certificate can identify software makers.">
<!ENTITY certmgr.editsslcert.edittrust "Edit certificate trust settings:">
<!ENTITY certmgr.editsslcert.dotrust "Trust the authenticity of this certificate.">
<!ENTITY certmgr.editsslcert.donttrust "Do not trust the authenticity of this certificate.">
<!ENTITY certmgr.deletecert.title "Delete Certificate">
<!ENTITY certmgr.deletecert.beforename "You have requested to delete this certificate:">
<!ENTITY certmgr.deletecert.aftername "Are you sure you want to delete this certificate?">
<!ENTITY certmgr.deleteusercert.title "Delete Your Certificate">
<!ENTITY certmgr.deleteusercert.beforename "You have requested to delete the certificate:">
<!ENTITY certmgr.deleteusercert.aftername "Once you have deleted this certificate, you will not be able to read mail that has been encrypted with it.">
<!ENTITY certmgr.certname "Certificate Name">
<!ENTITY certmgr.tokenname "Security Device">
<!ENTITY certmgr.purpose "Purpose">
<!ENTITY certmgr.issued "Issued On">
<!ENTITY certmgr.expires "Expires On">
<!ENTITY certmgr.help.label "Help">
<!ENTITY certmgr.ok.label "OK">
<!ENTITY certmgr.close.label "Close">
<!ENTITY certmgr.cancel.label "Cancel">
<!ENTITY certmgr.view.label "View">
<!ENTITY certmgr.edit.label "Edit">
<!ENTITY certmgr.editca.label "Edit CA Trust">
<!ENTITY certmgr.add.label "Add">
<!ENTITY certmgr.delete.label "Delete">
<!ENTITY certmgr.backup.label "Backup">
<!ENTITY certmgr.backupall.label "Backup All">
<!ENTITY certmgr.restore.label "Restore">
<!ENTITY certmgr.details.label "Certificate Fields">
<!ENTITY certmgr.fields.label "Field Value">
<!ENTITY certmgr.hierarchy.label "Certificate Hierarchy">

View File

@@ -0,0 +1,48 @@
<?xml version="1.0"?>
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
<!-- list all the locales being supplied by this jar -->
<RDF:Seq about="urn:mozilla:locale:root">
<RDF:li resource="urn:mozilla:locale:en-US"/>
</RDF:Seq>
<!-- locale information -->
<RDF:Description about="urn:mozilla:locale:en-US"
chrome:displayName="English (US)"
chrome:author="PSM Team"
chrome:name="en-US">
<chrome:packages>
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
<RDF:li resource="urn:mozilla:locale:en-US:pippki"/>
</RDF:Seq>
</chrome:packages>
</RDF:Description>
<!-- Version Information. State that we work only with major version of this
package. -->
<RDF:Description about="urn:mozilla:locale:en-US:pippki"
chrome:localeVersion="0.9.3"/>
</RDF:RDF>

View File

@@ -0,0 +1,44 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Ian McGreer <mcgreer@netscape.com>
-->
<!ENTITY devmgr.title "Device Manager">
<!ENTITY devmgr.devlist.label "Security Modules and Devices">
<!ENTITY devmgr.details.title "Details">
<!ENTITY devmgr.details.title2 "Value">
<!ENTITY devmgr.status.label "Status">
<!ENTITY devmgr.version.label "Version">
<!ENTITY devmgr.button.changeslotname.label "Change Slot Name">
<!ENTITY devmgr.button.login.label "Log In">
<!ENTITY devmgr.button.logout.label "Log Out">
<!ENTITY devmgr.button.changepw.label "Change Password">
<!ENTITY devmgr.button.load.label "Load">
<!ENTITY devmgr.button.unload.label "Unload">
<!ENTITY loaddevice.info "Enter the information for the module you want to add.">
<!ENTITY loaddevice.modname "Module Name:">
<!ENTITY loaddevice.modname.default "New PKCS#11 Module">
<!ENTITY loaddevice.filename "Module filename:">
<!ENTITY loaddevice.browse "Browse...">
<!ENTITY loaddevice.title "Load PKCS#11 Device">

View File

@@ -0,0 +1,21 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
-
- Contributor(s):
- Javier Delgadillo <javi@netscape.com>
- Bob Lord <lord@netscape.com>
-->
<!-- Values for newserver.xul -->
<!ENTITY newserver.title "">
<!ENTITY alwaysAccept.label "Remember this certificate permanently">
<!ENTITY continue.label "Continue">

View File

@@ -0,0 +1,27 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo <javi@netscape.com>
# Bob Lord <lord@netscape.com>
#
newServerMessage=There is a problem with the certificate that identifies "%S". Do you want to continue?
certNotRecognized=The certificate was issued by a certificate authority that %S does not recognize.
continueButton=Continue

View File

@@ -0,0 +1,109 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Terry Hayes <thayes@netscape.com>
-->
<!-- Values for changepassword.xul -->
<!ENTITY setPassword.title "Change Master Password">
<!ENTITY setPassword.tokenName.label "Security Device">
<!ENTITY setPassword.oldPassword.label "Current password:">
<!ENTITY setPassword.newPassword.label "New password:">
<!ENTITY setPassword.reenterPassword.label "New password (again):">
<!ENTITY setPassword.meter.label "Password quality meter">
<!ENTITY setPassword.meter.loading "Loading">
<!-- Values for getpassword.xul -->
<!ENTITY getPassword.title "Enter Master Password">
<!ENTITY getPassword.tokenName.label "Security Device">
<!ENTITY getPassword.password.label "Password:">
<!-- These should be common -->
<!ENTITY ok.label "OK">
<!ENTITY cancel.label "Cancel">
<!ENTITY help.label "Help">
<!ENTITY piperror.title "Error">
<!ENTITY pipalert.title "Error - cannot recover">
<!-- Prefs panel strings -->
<!ENTITY pref.security.general.lHeader "Security">
<!ENTITY pref.security.general.rHeader "Settings for general security">
<!ENTITY pref.security.general.header "Settings for general security">
<!ENTITY pref.security.general.level.title "Security Level">
<!ENTITY pref.security.general.paranoid.label "Use paranoid security settings">
<!ENTITY pref.security.general.certificates.title "Certificates">
<!ENTITY pref.security.general.manageCert.label "Manage Certificates">
<!-- Downloading a cert -->
<!ENTITY downloadCert.title "Downloading Certificate">
<!ENTITY downloadCert.message1 "You have been asked to trust a new Certificate Authority (CA).">
<!ENTITY downloadCert.trustSSL "Trust this CA to identify web sites.">
<!ENTITY downloadCert.trustEmail "Trust this CA to identify email users.">
<!ENTITY downloadCert.trustObjSign "Trust this CA to identify software developers.">
<!ENTITY downloadCert.message3 "Before trusting this CA for any purpose, you should examine its certificate and its policy and procedures (if available).">
<!ENTITY downloadCert.viewCert.label "View">
<!ENTITY downloadCert.viewPolicy.label "Policy">
<!ENTITY downloadCert.viewCert.text "Examine CA certificate">
<!ENTITY downloadCert.viewPolicy.text "Examine CA policies and procedures">
<!-- Certificate Exists in database -->
<!ENTITY caCertExists.title "Certificate Exists">
<!ENTITY caCertExists.message "The Certificate already exists.">
<!-- Strings for the MismatchDomain dialog -->
<!ENTITY domainMismatch.title "Security Error: Domain Name Mismatch">
<!ENTITY examineCert.label "View Certificate">
<!-- Strings for the Server cert expired dialog -->
<!ENTITY serverCertExpired.continue "Would you like to continue anyway?">
<!-- Strings for the SSL client auth ask dialog -->
<!ENTITY clientAuthAsk.title "User Identification Request">
<!ENTITY clientAuthAsk.message1 "This site has requested that you identify yourself with a certificate:">
<!ENTITY clientAuthAsk.message2 "Choose a certificate to present as identification:">
<!ENTITY clientAuthAsk.message3 "Details of selected certificate:">
<!ENTITY pkcs12.setpassword.title "Choose a Certificate Backup Password">
<!ENTITY pkcs12.setpassword.message "The certificate backup password you set here protects the backup file that you are about to create. You must set this password to proceed with the backup.">
<!ENTITY pkcs12.setpassword.label1 "Certificate backup password:">
<!ENTITY pkcs12.setpassword.label2 "Certificate backup password (again):">
<!ENTITY pkcs12.setpassword.reminder "Important: If you forget your certificate backup password, you will not be able to restore this backup later. Please record it in a safe location.">
<!ENTITY pkcs12.getpassword.title "Password Entry Dialog">
<!ENTITY pkcs12.getpassword.message "Please enter the password that was used to encrypt this certificate backup.">
<!ENTITY chooseToken.title "Choose Token Dialog">
<!ENTITY chooseToken.message1 "Please choose a token.">
<!ENTITY escrowWarn.title "Encryption Key Copy">
<!ENTITY escrowWarn.message1 "Important: This certificate authority has asked to make a backup of your encryption private key.">
<!ENTITY escrowWarn.benefit1 "The benefit is that if you lose access to your encryption private key, you can request a copy from this certificate authority.">
<!ENTITY escrowWarn.message2 "However, your encryption private key will be stored by the certificate authority, and could be used to read your encrypted email or documents without your permission.">
<!ENTITY serverCrlExpired.title "Certificate Revocation List (CRL) Expired">
<!ENTITY serverCrlExpired.message1 "The certificate revocation list (CRL) issued by this certificate authority has expired:">
<!ENTITY serverCrlExpired.message2 "To avoid this warning in the future, ask your system administrator how to update this CRL. Or, if you are sure this CRL is no longer required, click Manage CRLs to locate and delete it.">
<!ENTITY serverCrlExpired.continue "Would you like to continue?">
<!ENTITY serverCrlExpired.manageCrls.label "Manager CRLs...">
<!-- Strings for the CreateCertInfo dialog -->
<!ENTITY createCertInfo.title "Generating A Private Key">
<!ENTITY createCertInfo.msg1 "Key Generation in progress... This may take a few minutes....">
<!ENTITY createCertInfo.msg2 "Please wait...">

View File

@@ -0,0 +1,140 @@
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
#
SignedBy=Signed by %S
CertPassPrompt=Please enter the Personal Security Password for the PSM Private Keys security device.
#These are for dialogs
#Download Cert dialog
newCAMessage1=Do you want to trust "%S" for the following purposes?
unnamedCA=Certificate Authority (unnamed)
#For editing cert trust
editTrustWindowTitle=Edit certificate trust
editTrustCA=The certificate "%S" represents a Certificate Authority.
editTrustSSL=The certificate "%S" was issued by:
issuerNotTrusted=Because you do not trust the certificate authority that issued this certificate, you do not trust the authenticity of this certificate unless otherwise indicated here.
issuerTrusted=Because you trust the certificate authority that issued this certificate, you trust the authenticity of this certificate unless otherwise indicated here.
issuerNotKnown=Because you do not know the certificate authority that issued this certificate, you do not trust the authenticity of this certificate unless otherwise indicated here.
issuerCertNotFound=Certificate for this certificate authority was not found
#For Deleting Certificates
deleteSslCertFlag=deleteSslFlag
deleteSslCertConfirm=Are you sure you want to delete these web site certificates?
deleteSslCertImpact=If you delete a web site certificate, you will be asked to accept it again the next time you visit the web site.
deleteSslCertTitle=Delete Web Site Certificates
deleteUserCertFlag=deleteUserFlag
deleteUserCertConfirm=Are you sure you want to delete these certificates?
deleteUserCertImpact=If you delete one of your own certificates, you can no longer use it to identify yourself.
deleteUserCertTitle=Delete your Certificates
deleteCaCertFlag=deleteCaFlag
deleteCaCertConfirm=Are you sure you want to delete these CA certificates?
deleteCaCertImpact=If you delete a certificate authority (CA) certificate, your browser will no longer trust any certificates issued by that CA.
deleteCaCertTitle=Delete CA Certificates
#PKCS#12 file dialogs
chooseP12RestoreFileDialog=File Name to Restore
chooseP12BackupFileDialog=File Name to Backup
#Mismatch Domain Dialg
mismatchDomainMsg1=You have attempted to establish a connection with "%S". However, the security certificate presented belongs to "%S". It is possible, though unlikely, that someone may be trying to intercept your communication with this web site.
mismatchDomainMsg2=If you suspect the certificate shown does not belong to "%S", please cancel the connection and notify the site administrator.
#Server Cert expired
serverCertExpiredMsg1="%S" is a site that uses a security certificate to encrypt data during transmission, but its certificate expired on %S.
serverCertExpiredTitle=Server Certificate Expired
serverCertNotYetValedMsg1="%S" is a site that uses a security certificate to encrypt data during transmission, but its certificate will not be valid until %S.
serverCertNotYetValidTitle=Server Certificate Not Yet Valid
serverCertExpiredMsg2=You should check to make sure that your computer's time (currently set to %S) is correct.
#Preferences
resetPreferences=Use this button to reset %S's security preferences to their factory settings.
#Cert verification
certVerified=This certificate has been verified for the following uses:
certNotVerified_CertRevoked=Could not verify this certificate because it has been revoked.
certNotVerified_CertExpired=Could not verify this certificate because it has expired.
certNotVerified_CertNotTrusted=Could not verify this certificate because it is not trusted.
certNotVerified_IssuerNotTrusted=Could not verify this certificate because the issuer is not trusted.
certNotVerified_IssuerUnknown=Could not verify this certificate because the issuer is unknown.
certNotVerified_CAInvalid=Could not verify this certificate because the CA certificate is invalid.
certNotVerified_Unknown=Could not verify this certificate for unknown reasons.
#Client auth
clientAuthMessage1=Organization: "%S"
clientAuthMessage2=Issued Under: "%S"
#Page Info
pageInfo_SiteNotVerified=Web Site Identity Not Verified
pageInfo_WebSiteVerified=Web Site Identity Verified
pageInfo_Identity_Verified=The web site %S supports authentication for the page you are viewing. The identity of this web site has been verified by %S, a certificate authority you trust for this purpose.
pageInfo_ViewCertificate=View the security certificate that verifies this web site's identity.
pageInfo_NoEncryption=Connection Not Encrypted
pageInfo_Privacy_None1=The web site %S does not support encryption for the page you are viewing.
pageInfo_Privacy_None2=Information sent over the Internet without encryption can be seen by other people while it is in transit.
pageInfo_StrongEncryption=Connection Encrypted: High-grade Encryption (%S %S bit)
pageInfo_Privacy_Strong1=The page you are viewing was encrypted before being transmitted over the Internet.
pageInfo_Privacy_Strong2=Encryption makes it very difficult for unauthorized people to view information traveling between computers. It is therefore very unlikely that anyone read this page as it traveled across the network.
pageInfo_WeakEncryption=Connection Encrypted: Low-grade Encryption (%S %S bit)
pageInfo_Privacy_Weak1=The web site %S is using low-grade encryption for the page you are viewing.
pageInfo_Privacy_Weak2=Low-grade encryption may allow some unauthorized people to view this information.
#Cert Viewer
certDetails=Certificate Viewer:
notPresent=<Not Part Of Certificate>
unknownIssuer=<Unknown Issuer>
escrowFinalMessage=You should click OK only if you trust "%S" to protect your encryption private key.
#Token Manager
password_not_set=(not set)
failed_pw_change=Unable to change Master Password.
incorrect_pw=You did not enter the correct current Master Password. Please try again.
pw_change_ok=Master Password successfully changed.
loadPK11TokenDialog=Choose a PKCS#11 device to load
devinfo_modname=Module
devinfo_modpath=Path
devinfo_label=Label
devinfo_manID=Manufacturer
devinfo_serialnum=Serial Number
devinfo_hwversion=HW Version
devinfo_fwversion=FW Version
devinfo_status=Status
devinfo_desc=Description
devinfo_stat_disabled=Disabled
devinfo_stat_notpresent=Not Present
devinfo_stat_uninitialized=Uninitialized
devinfo_stat_notloggedin=Not Logged In
devinfo_stat_loggedin=Logged In
devinfo_stat_ready=Ready
enable_fips=Enable FIPS
disable_fips=Disable FIPS
#device manager: load device dlg
device.loaddlg.width=300
device.loaddlg.height=200
certmgr.verified=Verified
certmgr.verifiedNoOCSP=Verified (No OCSP)

View File

@@ -0,0 +1,34 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<!ENTITY lheader "Master Passwords">
<!ENTITY managepassword.label "Master Password Timeout">
<!ENTITY managepassword.text "&brandShortName; will ask for your master password:">
<!ENTITY managepassword.askfirsttime "The first time it is needed">
<!ENTITY managepassword.askeverytime "Every time it is needed">
<!ENTITY managepassword.asktimeout "If it has not been used for ">
<!ENTITY managepassword.timeout.unit "minutes or longer">
<!ENTITY changepassword.label "Change Master Password">
<!ENTITY changepassword.text "Your master password protects sensitive information such as web passwords and certificates.">
<!ENTITY changepassword.button "Change Password">

View File

@@ -0,0 +1,40 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<!ENTITY security.title "Security Preferences">
<!ENTITY security.label "Privacy and Security">
<!ENTITY security.description "Settings for Privacy and Security">
<!ENTITY resetsettings.label "Reset Settings">
<!ENTITY resetpreferences.label "Reset Preferences...">
<!ENTITY managecerts.label "Manage Certificates">
<!ENTITY managecerts.text "Use the Certificate Manager to manage your personal certificates, as well as those of other people and certificate authorities.">
<!ENTITY managecerts.button "Manage Certificates...">
<!ENTITY managedevices.label "Manage Security Devices...">
<!ENTITY managedevices.text "Use this button to manage your security devices, such as smart cards.">
<!ENTITY managedevices.button "Manage Security Devices...">
<!ENTITY ssl.label "SSL">
<!ENTITY certs.title "Certificates">
<!ENTITY certs.label "Certificates">

View File

@@ -0,0 +1,70 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- Bob Lord <lord@netscape.com>
- Terry Hayes <thayes@netscape.com>
-->
<!ENTITY SSLProtocolVersions "SSL Protocol Versions">
<!ENTITY SSLWarnings "SSL Warnings">
<!ENTITY SSLClientAuthMethod "Client Certificate Selection">
<!ENTITY enable.ssl2 "Enable SSL version 2">
<!ENTITY enable.ssl3 "Enable SSL version 3">
<!ENTITY enable.tls "Enable TLS">
<!ENTITY edit.sslciphers "Edit Ciphers...">
<!ENTITY warn.description "&brandShortName; can alert you to the security status of the web page you are viewing. Set &brandShortName; to show a warning and ask permission before:">
<!ENTITY warn.enteringsecure "Loading a page that supports encryption">
<!ENTITY warn.enteringweak "Loading a page that uses low-grade encryption">
<!ENTITY warn.insecurepost "Sending form data from an unencrypted page to an unencrypted page">
<!ENTITY warn.leavingsecure "Leaving a page that supports encryption">
<!ENTITY warn.secureredirect "Redirecting from one encrypted page to another">
<!ENTITY warn.secureredirecttoinsecure "Redirecting from an encrypted page to an unencrypted page">
<!ENTITY warn.viewmixed "Viewing a page with an encrypted/unencrypted mix">
<!ENTITY certselect.description "Decide how &brandShortName; selects a security certificate to present to web sites that require one:">
<!ENTITY certselect.auto "Select Automatically">
<!ENTITY certselect.ask "Ask Every Time">
<!-- Cipher pref window -->
<!ENTITY cipher.title "SSL: Edit Ciphers">
<!ENTITY cipher.ssl2.label "SSL2 Ciphersuites">
<!ENTITY cipher.ssl3.label "SSL3/TLS Ciphersuites">
<!-- SSL2 Ciphers -->
<!ENTITY cipher.ssl2.rc4_128 "RC4 encryption with a 128-bit key">
<!ENTITY cipher.ssl2.rc2_128 "RC2 encryption with a 128-bit key">
<!ENTITY cipher.ssl2.des_ede3_192 "Triple DES encryption with a 168-bit key">
<!ENTITY cipher.ssl2.des_64 "DES encryption with a 56-bit key">
<!ENTITY cipher.ssl2.rc4_40 "RC4 encryption with a 40-bit key">
<!ENTITY cipher.ssl2.rc2_40 "RC2 encryption with a 40-bit key">
<!-- SSL3 ciphers -->
<!ENTITY cipher.ssl3.rsa_rc4_128_md5 "RC4 encryption with a 128-bit key and an MD5 MAC">
<!ENTITY cipher.ssl3.rsa_fips_des_ede3_sha "FIPS 140-1 compliant triple DES encryption and SHA-1 MAC">
<!ENTITY cipher.ssl3.rsa_des_ede3_sha "Triple DES encryption with a 168-bit key and a SHA-1 MAC">
<!ENTITY cipher.ssl3.rsa_fips_des_sha "FIPS 140-1 compliant DES encryption and SHA-1 MAC">
<!ENTITY cipher.ssl3.rsa_des_sha "DES encryption with a 56-bit key and a SHA-1 MAC">
<!ENTITY cipher.ssl3.rsa_1024_rc4_56_sha "RC4 encryption with a 56-bit key and a SHA-1 MAC">
<!ENTITY cipher.ssl3.rsa_1024_des_cbc_sha "DES encryption in CBC mode with a 56-bit key and a SHA-1 MAC">
<!ENTITY cipher.ssl3.rsa_rc4_40_md5 "RC4 encryption with a 40-bit key and an MD5 MAC">
<!ENTITY cipher.ssl3.rsa_rc2_40_md5 "RC2 encryption with a 40-bit key and an MD5 MAC">
<!ENTITY cipher.ssl3.rsa_null_md5 "No encryption with an MD5 MAC">

View File

@@ -0,0 +1,41 @@
<!--
- The contents of this file are subject to the Mozilla Public
- License Version 1.1 (the "License"); you may not use this file
- except in compliance with the License. You may obtain a copy of
- the License at http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS
- IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
- implied. See the License for the specific language governing
- rights and limitations under the License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is Netscape
- Communications Corp. Portions created by Netscape are
- Copyright (C) 2001 Netscape Communications Corp. All
- Rights Reserved.
-
- Contributor(s):
- David P. Drinan (ddrinan@netscape.com)
-->
<!ENTITY validation.title "Validation">
<!ENTITY validation.crl.label "CRL">
<!ENTITY validation.crl.description "Use the CRL Manager to manage the Certificate Revocation Lists (CRL) that are stored in your certificate database.">
<!ENTITY validation.managecrls.button "Manage CRLs...">
<!ENTITY validation.crlmanager.label "Manage CRLs">
<!ENTITY validation.crlname.label "Name">
<!ENTITY validation.crllastupdate.label "Last Update">
<!ENTITY validation.crlnextupdate.label "Next Update">
<!ENTITY validation.deletecrl.label "Delete">
<!ENTITY validation.updatecrl.label "Update">
<!ENTITY validation.ocsp.label "OCSP">
<!ENTITY validation.ocsp.description "&brandShortName; can use Online Certificate Status Protocol (OCSP) to verify certificates. Set &brandShortName; to use OCSP as follows:">
<!ENTITY disableOCSP.label "Do not use OCSP for certificate validation">
<!ENTITY certOCSP.label "Use OCSP to validate only certificates that specify an OCSP service URL">
<!ENTITY proxyOCSP.label "Use OCSP to validate all certificates using this URL and signer:">
<!ENTITY serviceURL.label "Service URL:">
<!ENTITY signingCA.label "Response Signer:">

View File

@@ -0,0 +1,42 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Terry Hayes <thayes@netscape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
DEPTH=..\..\..\..
include <$(DEPTH)\config\rules.mak>
chrome::
$(REGCHROME) content pippki pippki.jar
$(REGCHROME) locale en-US/pippki en-US.jar

View File

@@ -0,0 +1,79 @@
#! gmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is the Netscape security libraries.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1994-2000 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo <javi@netscape.com>
# Terry Hayes <thayes@netscape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
MODULE = pippki
LIBRARY_NAME = pippki
IS_COMPONENT = 1
MODULE_NAME = PKI
EXPORT_LIBRARY = 1
META_COMPONENT = crypto
EXPORTS = \
$(NULL)
CPPSRCS = \
nsNSSDialogs.cpp \
nsPKIModule.cpp \
nsPKIParamBlock.cpp \
nsASN1Outliner.cpp \
$(NULL)
REQUIRES = nspr security js xpcom string dom pref intl locale windowwatcher appshell necko pipnss layout caps
include $(topsrcdir)/config/rules.mk
INCLUDES += \
-I$(DIST)/public/security \
$(NULL)
EXTRA_DSO_LDOPTS += \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_JS_LIBS) \
$(NULL)
EXTRA_LIBS += \
$(NULL)
OUR_CC = $(shell which $(CCC))
libs::
echo We used c++ at $(OUR_CC)

View File

@@ -1,5 +1,5 @@
# -*- Mode: perl; indent-tabs-mode: nil -*-
#
#!nmake
#
# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
@@ -10,19 +10,20 @@
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code are the Bugzilla Tests.
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Zach Lipton
# Portions created by Zach Lipton are
# Copyright (C) 2001 Zach Lipton. All
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s): Zach Lipton <zach@zachlipton.com>
#
# Contributor(s):
# Terry Hayes <thayes@netscape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
@@ -30,38 +31,39 @@
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
#
package Support::Files;
MODULE = pippki
@additional_files = ('syncshadowdb','processmail');
@exclude_files = ('importxml.pl');
DEPTH=..\..\..\..
IGNORE_MANIFEST=1
$file = '*';
@files = glob($file);
LIBRARY_NAME = pippki
PDBFILE = $(LIBRARY_NAME).pdb
MAPFILE = $(LIBRARY_NAME).map
MODULE_NAME = PKI
META_COMPONENT = crypto
sub isTestingFile {
my ($file) = @_;
my $exclude;
foreach $exclude (@exclude_files) {
if ($file eq $exclude) { return undef; } # get rid of excluded files.
}
include <$(DEPTH)/config/config.mak>
if ($file =~ /\.cgi$|\.pl$|\.pm$/) {
return 1;
}
my $additional;
foreach $additional (@additional_files) {
if ($file eq $additional) { return 1; }
}
return undef;
}
LINCS = $(LINCS) \
-I$(PUBLIC) \
$(NULL)
foreach $currentfile (@files) {
if (isTestingFile($currentfile)) {
push(@testitems,$currentfile);
}
}
LLIBS = \
$(DIST)/lib/js3250.lib \
$(LIBNSPR) \
$(DIST)\lib\xpcom.lib \
$(NULL)
EXPORTS = \
$(NULL)
1;
OBJS = \
.\$(OBJDIR)\nsNSSDialogs.obj \
.\$(OBJDIR)\nsPKIModule.obj \
.\$(OBJDIR)\nsPKIParamBlock.obj \
.\$(OBJDIR)\nsASN1Outliner.obj \
$(NULL)
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,558 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "nsASN1Outliner.h"
#include "nsIComponentManager.h"
#include "nsString.h"
NS_IMPL_THREADSAFE_ISUPPORTS2(nsNSSASN1Outliner, nsIASN1Outliner,
nsIOutlinerView);
nsNSSASN1Outliner::nsNSSASN1Outliner()
{
NS_INIT_ISUPPORTS();
}
nsNSSASN1Outliner::~nsNSSASN1Outliner()
{
}
/* void loadASN1Structure (in nsIASN1Object asn1Object); */
NS_IMETHODIMP
nsNSSASN1Outliner::LoadASN1Structure(nsIASN1Object *asn1Object)
{
//
// The outliner won't automatically re-draw if the contents
// have been changed. So I do a quick test here to let
// me know if I should forced the outliner to redraw itself
// by calling RowCountChanged on it.
//
PRBool redraw = (mASN1Object && mOutliner);
PRInt32 rowsToDelete;
if (redraw) {
// This is the number of rows we will be deleting after
// the contents have changed.
rowsToDelete = 0-CountNumberOfVisibleRows(mASN1Object);
}
mASN1Object = asn1Object;
if (redraw) {
// The number of rows in the new content.
PRInt32 newRows = CountNumberOfVisibleRows(mASN1Object);
// Erase all of the old rows.
mOutliner->RowCountChanged(0, rowsToDelete);
// Replace them with the new contents
mOutliner->RowCountChanged(0, newRows);
}
return NS_OK;
}
/* wstring getDisplayData (in unsigned long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetDisplayData(PRUint32 index, PRUnichar **_retval)
{
nsCOMPtr<nsIASN1Object> object;
GetASN1ObjectAtIndex(index, mASN1Object, getter_AddRefs(object));
if (object) {
object->GetDisplayValue(_retval);
} else {
*_retval = nsnull;
}
return NS_OK;
}
nsresult
nsNSSASN1Outliner::GetASN1ObjectAtIndex(PRUint32 index,
nsIASN1Object *sourceObject,
nsIASN1Object **retval)
{
if (mASN1Object == nsnull) {
*retval = nsnull;
} else {
if (index == 0) {
*retval = sourceObject;
NS_IF_ADDREF(*retval);
return NS_OK;
}
// the source object better be an nsIASN1Sequence, otherwise,
// the index better be 1. If neither of these is ture, then
// someting bad has happened.
nsCOMPtr<nsIASN1Sequence> sequence = do_QueryInterface(sourceObject);
if (sequence == nsnull) {
//Something really bad has happened. bail out.
*retval = nsnull;
return NS_ERROR_FAILURE;
} else {
PRBool showObjects;
sequence->GetShowObjects(&showObjects);
if (!showObjects) {
*retval = nsnull;
return NS_OK;
}
nsCOMPtr<nsISupportsArray>asn1Objects;
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
PRUint32 numObjects;
asn1Objects->Count(&numObjects);
PRUint32 i;
nsCOMPtr<nsISupports>isupports;
nsCOMPtr<nsIASN1Object>currObject;
PRUint32 numObjectsCounted = 0;
PRUint32 numObjToDisplay;
for (i=0; i<numObjects; i++) {
isupports = dont_AddRef(asn1Objects->ElementAt(i));
currObject = do_QueryInterface(isupports);
numObjToDisplay = CountNumberOfVisibleRows(currObject);
if ((numObjectsCounted+numObjToDisplay) >= index) {
return GetASN1ObjectAtIndex(index-numObjectsCounted-1,
currObject, retval);
}
numObjectsCounted += numObjToDisplay;
}
}
}
// We should never get here.
return NS_ERROR_FAILURE;
}
PRUint32
nsNSSASN1Outliner::CountNumberOfVisibleRows(nsIASN1Object *asn1Object)
{
nsCOMPtr<nsIASN1Sequence> sequence;
PRUint32 count = 1;
sequence = do_QueryInterface(asn1Object);
if (sequence) {
PRBool showObjects;
sequence->GetShowObjects(&showObjects);
if (showObjects) {
nsCOMPtr<nsISupportsArray> asn1Objects;
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
PRUint32 numObjects;
asn1Objects->Count(&numObjects);
PRUint32 i;
nsCOMPtr<nsISupports> isupports;
nsCOMPtr<nsIASN1Object> currObject;
for (i=0; i<numObjects; i++) {
isupports = dont_AddRef(asn1Objects->ElementAt(i));
currObject = do_QueryInterface(isupports);
count += CountNumberOfVisibleRows(currObject);
}
}
}
return count;
}
/* readonly attribute long rowCount; */
NS_IMETHODIMP
nsNSSASN1Outliner::GetRowCount(PRInt32 *aRowCount)
{
if (mASN1Object) {
*aRowCount = CountNumberOfVisibleRows(mASN1Object);
} else {
*aRowCount = 0;
}
return NS_OK;
}
/* attribute nsIOutlinerSelection selection; */
NS_IMETHODIMP
nsNSSASN1Outliner::GetSelection(nsIOutlinerSelection * *aSelection)
{
*aSelection = mSelection;
NS_IF_ADDREF(*aSelection);
return NS_OK;
}
NS_IMETHODIMP
nsNSSASN1Outliner::SetSelection(nsIOutlinerSelection * aSelection)
{
mSelection = aSelection;
return NS_OK;
}
/* void getRowProperties (in long index, in nsISupportsArray properties); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetRowProperties(PRInt32 index, nsISupportsArray *properties)
{
return NS_OK;
}
/* void getCellProperties (in long row, in wstring colID,
in nsISupportsArray properties); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetCellProperties(PRInt32 row, const PRUnichar *colID,
nsISupportsArray *properties)
{
return NS_OK;
}
/* void getColumnProperties (in wstring colID, in nsIDOMElement colElt,
in nsISupportsArray properties); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetColumnProperties(const PRUnichar *colID,
nsIDOMElement *colElt,
nsISupportsArray *properties)
{
return NS_OK;
}
/* boolean isContainer (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::IsContainer(PRInt32 index, PRBool *_retval)
{
nsCOMPtr<nsIASN1Object> object;
nsCOMPtr<nsIASN1Sequence> sequence;
nsresult rv = GetASN1ObjectAtIndex(index, mASN1Object,
getter_AddRefs(object));
if (NS_FAILED(rv))
return rv;
sequence = do_QueryInterface(object);
if (sequence != nsnull) {
sequence->GetProcessObjects(_retval);
} else {
*_retval = PR_FALSE;
}
return NS_OK;
}
/* boolean isContainerOpen (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::IsContainerOpen(PRInt32 index, PRBool *_retval)
{
nsCOMPtr<nsIASN1Object> object;
nsCOMPtr<nsIASN1Sequence> sequence;
nsresult rv = GetASN1ObjectAtIndex(index, mASN1Object,
getter_AddRefs(object));
if (NS_FAILED(rv))
return rv;
sequence = do_QueryInterface(object);
if (sequence == nsnull) {
*_retval = PR_FALSE;
} else {
sequence->GetShowObjects(_retval);
}
return NS_OK;
}
/* boolean isContainerEmpty (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::IsContainerEmpty(PRInt32 index, PRBool *_retval)
{
*_retval = PR_FALSE;
return NS_OK;
}
PRInt32
nsNSSASN1Outliner::GetParentOfObjectAtIndex(PRUint32 index,
nsIASN1Object *sourceObject)
{
if (index == 0) {
return -1;
} else {
PRUint32 numVisibleRows = CountNumberOfVisibleRows(sourceObject);
if (numVisibleRows > index) {
nsCOMPtr<nsIASN1Sequence>sequence(do_QueryInterface(sourceObject));
if (sequence == nsnull)
return -2;
nsCOMPtr<nsISupportsArray>asn1Objects;
nsCOMPtr<nsISupports>isupports;
nsCOMPtr<nsIASN1Object>currObject;
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
PRUint32 indexCnt = 0;
PRUint32 i,numObjects;
asn1Objects->Count(&numObjects);
for (i=0; i<numObjects; i++) {
isupports = dont_AddRef(asn1Objects->ElementAt(i));
currObject = do_QueryInterface(isupports);
numVisibleRows = CountNumberOfVisibleRows(currObject);
if (numVisibleRows+indexCnt > index) {
//We're dealing with a sequence with visible elements
//that has the desired element.
PRInt32 subIndex = GetParentOfObjectAtIndex(index-indexCnt+1,
currObject);
if (subIndex == -1) {
return indexCnt+1;
} else if (subIndex == -2) {
return -2;
} else {
// This is a case where a subIndex was returned.
return indexCnt+1+subIndex;
}
}
indexCnt+=numVisibleRows;
if (indexCnt == index) {
// The passed in source object is the parent.
return -1;
}
}
}// the else case is an error, just let it fall through.
}
return -2;
}
/* long getParentIndex (in long rowIndex); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetParentIndex(PRInt32 rowIndex, PRInt32 *_retval)
{
*_retval = GetParentOfObjectAtIndex(rowIndex, mASN1Object);
return NS_OK;
}
/* boolean hasNextSibling (in long rowIndex, in long afterIndex); */
NS_IMETHODIMP
nsNSSASN1Outliner::HasNextSibling(PRInt32 rowIndex, PRInt32 afterIndex,
PRBool *_retval)
{
*_retval = PR_FALSE;
return NS_OK;
}
PRInt32
nsNSSASN1Outliner::GetLevelsTilIndex(PRUint32 index,
nsIASN1Object *sourceObject)
{
if (index == 0) {
return 0;
} else {
nsCOMPtr<nsIASN1Sequence> sequence(do_QueryInterface(sourceObject));
nsCOMPtr<nsISupportsArray>asn1Objects;
if (sequence == nsnull)
return -1;
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
PRUint32 numObjects,i,indexCnt=0,numVisibleRows;
asn1Objects->Count(&numObjects);
nsCOMPtr<nsISupports> isupports;
nsCOMPtr<nsIASN1Object> currObject;
for (i=0; i<numObjects; i++) {
isupports = dont_AddRef(asn1Objects->ElementAt(i));
currObject = do_QueryInterface(isupports);
numVisibleRows = CountNumberOfVisibleRows(currObject);
if ((numVisibleRows+indexCnt)>=index) {
PRInt32 numSubLayers;
numSubLayers = GetLevelsTilIndex(index-indexCnt-1,
currObject);
if (numSubLayers == -1) {
// This return value means the parent is not a child
// object, we're not adding any more layers to the nested
// levels.
return -1;
} else {
return 1+numSubLayers;
}
}
indexCnt += numVisibleRows;
}
}
return -2;
}
/* long getLevel (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetLevel(PRInt32 index, PRInt32 *_retval)
{
*_retval = GetLevelsTilIndex(index, mASN1Object);
return NS_OK;
}
/* wstring getCellText (in long row, in wstring colID); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetCellText(PRInt32 row, const PRUnichar *colID,
PRUnichar **_retval)
{
nsCOMPtr<nsIASN1Object> object;
*_retval = nsnull;
char *col = NS_CONST_CAST(char *, NS_ConvertUCS2toUTF8(colID).get());
nsresult rv = NS_OK;
if (strcmp(col, "certDataCol") == 0) {
rv = GetASN1ObjectAtIndex(row, mASN1Object,
getter_AddRefs(object));
if (NS_FAILED(rv))
return rv;
//There's only one column for ASN1 dump.
rv = object->GetDisplayName(_retval);
}
return rv;
}
/* void setOutliner (in nsIOutlinerBoxObject outliner); */
NS_IMETHODIMP
nsNSSASN1Outliner::SetOutliner(nsIOutlinerBoxObject *outliner)
{
mOutliner = outliner;
return NS_OK;
}
/* void toggleOpenState (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::ToggleOpenState(PRInt32 index)
{
nsCOMPtr<nsIASN1Object> object;
nsresult rv = GetASN1ObjectAtIndex(index, mASN1Object,
getter_AddRefs(object));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIASN1Sequence> sequence(do_QueryInterface(object));
if (sequence == nsnull)
return NS_ERROR_FAILURE;
PRBool showObjects;
sequence->GetShowObjects(&showObjects);
PRInt32 rowCountChange;
if (showObjects) {
rowCountChange = 1-CountNumberOfVisibleRows(object);
sequence->SetShowObjects(PR_FALSE);
} else {
sequence->SetShowObjects(PR_TRUE);
rowCountChange = CountNumberOfVisibleRows(object)-1;
}
if (mOutliner)
mOutliner->RowCountChanged(index, rowCountChange);
return NS_OK;
}
/* void cycleHeader (in wstring colID, in nsIDOMElement elt); */
NS_IMETHODIMP
nsNSSASN1Outliner::CycleHeader(const PRUnichar *colID, nsIDOMElement *elt)
{
return NS_OK;
}
/* void selectionChanged (); */
NS_IMETHODIMP
nsNSSASN1Outliner::SelectionChanged()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void cycleCell (in long row, in wstring colID); */
NS_IMETHODIMP
nsNSSASN1Outliner::CycleCell(PRInt32 row, const PRUnichar *colID)
{
return NS_OK;
}
/* boolean isEditable (in long row, in wstring colID); */
NS_IMETHODIMP
nsNSSASN1Outliner::IsEditable(PRInt32 row, const PRUnichar *colID,
PRBool *_retval)
{
*_retval = PR_FALSE;
return NS_OK;
}
/* void setCellText (in long row, in wstring colID, in wstring value); */
NS_IMETHODIMP
nsNSSASN1Outliner::SetCellText(PRInt32 row, const PRUnichar *colID,
const PRUnichar *value)
{
return NS_OK;
}
/* void performAction (in wstring action); */
NS_IMETHODIMP
nsNSSASN1Outliner::PerformAction(const PRUnichar *action)
{
return NS_OK;
}
/* void performActionOnRow (in wstring action, in long row); */
NS_IMETHODIMP
nsNSSASN1Outliner::PerformActionOnRow(const PRUnichar *action, PRInt32 row)
{
return NS_OK;
}
/* void performActionOnCell (in wstring action, in long row, in wstring colID); */
NS_IMETHODIMP
nsNSSASN1Outliner::PerformActionOnCell(const PRUnichar *action, PRInt32 row,
const PRUnichar *colID)
{
return NS_OK;
}
//
// CanDropOn
//
// Can't drop on the thread pane.
//
NS_IMETHODIMP nsNSSASN1Outliner::CanDropOn(PRInt32 index, PRBool *_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
*_retval = PR_FALSE;
return NS_OK;
}
//
// CanDropBeforeAfter
//
// Can't drop on the thread pane.
//
NS_IMETHODIMP nsNSSASN1Outliner::CanDropBeforeAfter(PRInt32 index, PRBool before, PRBool *_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
*_retval = PR_FALSE;
return NS_OK;
}
//
// Drop
//
// Can't drop on the thread pane.
//
NS_IMETHODIMP nsNSSASN1Outliner::Drop(PRInt32 row, PRInt32 orient)
{
return NS_OK;
}
//
// IsSorted
//
// ...
//
NS_IMETHODIMP nsNSSASN1Outliner::IsSorted(PRBool *_retval)
{
*_retval = PR_FALSE;
return NS_OK;
}

View File

@@ -0,0 +1,73 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#ifndef _NSSASNOUTLINER_H_
#define _NSSASNOUTLINER_H_
#include "nscore.h"
#include "nsIX509Cert.h"
#include "nsIASN1Outliner.h"
#include "nsIOutlinerView.h"
#include "nsIOutlinerBoxObject.h"
#include "nsIOutlinerSelection.h"
#include "nsCOMPtr.h"
//4bfaa9f0-1dd2-11b2-afae-a82cbaa0b606
#define NS_NSSASN1OUTINER_CID { \
0x4bfaa9f0, \
0x1dd2, \
0x11b2, \
{0xaf,0xae,0xa8,0x2c,0xba,0xa0,0xb6,0x06} \
}
class nsNSSASN1Outliner : public nsIASN1Outliner
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIASN1OUTLINER
NS_DECL_NSIOUTLINERVIEW
nsNSSASN1Outliner();
virtual ~nsNSSASN1Outliner();
protected:
PRUint32 CountNumberOfVisibleRows(nsIASN1Object *asn1Object);
nsresult GetASN1ObjectAtIndex(PRUint32 index, nsIASN1Object *sourceObject,
nsIASN1Object **retval);
PRInt32 GetParentOfObjectAtIndex(PRUint32 index, nsIASN1Object *sourceObject);
PRInt32 GetLevelsTilIndex(PRUint32 index, nsIASN1Object *sourceObject);
nsCOMPtr<nsIASN1Object> mASN1Object;
nsCOMPtr<nsIOutlinerSelection> mSelection;
nsCOMPtr<nsIOutlinerBoxObject> mOutliner;
};
#endif //_NSSASNOUTLINER_H_

View File

@@ -0,0 +1,558 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "nsASN1Outliner.h"
#include "nsIComponentManager.h"
#include "nsString.h"
NS_IMPL_THREADSAFE_ISUPPORTS2(nsNSSASN1Outliner, nsIASN1Outliner,
nsIOutlinerView);
nsNSSASN1Outliner::nsNSSASN1Outliner()
{
NS_INIT_ISUPPORTS();
}
nsNSSASN1Outliner::~nsNSSASN1Outliner()
{
}
/* void loadASN1Structure (in nsIASN1Object asn1Object); */
NS_IMETHODIMP
nsNSSASN1Outliner::LoadASN1Structure(nsIASN1Object *asn1Object)
{
//
// The outliner won't automatically re-draw if the contents
// have been changed. So I do a quick test here to let
// me know if I should forced the outliner to redraw itself
// by calling RowCountChanged on it.
//
PRBool redraw = (mASN1Object && mOutliner);
PRInt32 rowsToDelete;
if (redraw) {
// This is the number of rows we will be deleting after
// the contents have changed.
rowsToDelete = 0-CountNumberOfVisibleRows(mASN1Object);
}
mASN1Object = asn1Object;
if (redraw) {
// The number of rows in the new content.
PRInt32 newRows = CountNumberOfVisibleRows(mASN1Object);
// Erase all of the old rows.
mOutliner->RowCountChanged(0, rowsToDelete);
// Replace them with the new contents
mOutliner->RowCountChanged(0, newRows);
}
return NS_OK;
}
/* wstring getDisplayData (in unsigned long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetDisplayData(PRUint32 index, PRUnichar **_retval)
{
nsCOMPtr<nsIASN1Object> object;
GetASN1ObjectAtIndex(index, mASN1Object, getter_AddRefs(object));
if (object) {
object->GetDisplayValue(_retval);
} else {
*_retval = nsnull;
}
return NS_OK;
}
nsresult
nsNSSASN1Outliner::GetASN1ObjectAtIndex(PRUint32 index,
nsIASN1Object *sourceObject,
nsIASN1Object **retval)
{
if (mASN1Object == nsnull) {
*retval = nsnull;
} else {
if (index == 0) {
*retval = sourceObject;
NS_IF_ADDREF(*retval);
return NS_OK;
}
// the source object better be an nsIASN1Sequence, otherwise,
// the index better be 1. If neither of these is ture, then
// someting bad has happened.
nsCOMPtr<nsIASN1Sequence> sequence = do_QueryInterface(sourceObject);
if (sequence == nsnull) {
//Something really bad has happened. bail out.
*retval = nsnull;
return NS_ERROR_FAILURE;
} else {
PRBool showObjects;
sequence->GetShowObjects(&showObjects);
if (!showObjects) {
*retval = nsnull;
return NS_OK;
}
nsCOMPtr<nsISupportsArray>asn1Objects;
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
PRUint32 numObjects;
asn1Objects->Count(&numObjects);
PRUint32 i;
nsCOMPtr<nsISupports>isupports;
nsCOMPtr<nsIASN1Object>currObject;
PRUint32 numObjectsCounted = 0;
PRUint32 numObjToDisplay;
for (i=0; i<numObjects; i++) {
isupports = dont_AddRef(asn1Objects->ElementAt(i));
currObject = do_QueryInterface(isupports);
numObjToDisplay = CountNumberOfVisibleRows(currObject);
if ((numObjectsCounted+numObjToDisplay) >= index) {
return GetASN1ObjectAtIndex(index-numObjectsCounted-1,
currObject, retval);
}
numObjectsCounted += numObjToDisplay;
}
}
}
// We should never get here.
return NS_ERROR_FAILURE;
}
PRUint32
nsNSSASN1Outliner::CountNumberOfVisibleRows(nsIASN1Object *asn1Object)
{
nsCOMPtr<nsIASN1Sequence> sequence;
PRUint32 count = 1;
sequence = do_QueryInterface(asn1Object);
if (sequence) {
PRBool showObjects;
sequence->GetShowObjects(&showObjects);
if (showObjects) {
nsCOMPtr<nsISupportsArray> asn1Objects;
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
PRUint32 numObjects;
asn1Objects->Count(&numObjects);
PRUint32 i;
nsCOMPtr<nsISupports> isupports;
nsCOMPtr<nsIASN1Object> currObject;
for (i=0; i<numObjects; i++) {
isupports = dont_AddRef(asn1Objects->ElementAt(i));
currObject = do_QueryInterface(isupports);
count += CountNumberOfVisibleRows(currObject);
}
}
}
return count;
}
/* readonly attribute long rowCount; */
NS_IMETHODIMP
nsNSSASN1Outliner::GetRowCount(PRInt32 *aRowCount)
{
if (mASN1Object) {
*aRowCount = CountNumberOfVisibleRows(mASN1Object);
} else {
*aRowCount = 0;
}
return NS_OK;
}
/* attribute nsIOutlinerSelection selection; */
NS_IMETHODIMP
nsNSSASN1Outliner::GetSelection(nsIOutlinerSelection * *aSelection)
{
*aSelection = mSelection;
NS_IF_ADDREF(*aSelection);
return NS_OK;
}
NS_IMETHODIMP
nsNSSASN1Outliner::SetSelection(nsIOutlinerSelection * aSelection)
{
mSelection = aSelection;
return NS_OK;
}
/* void getRowProperties (in long index, in nsISupportsArray properties); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetRowProperties(PRInt32 index, nsISupportsArray *properties)
{
return NS_OK;
}
/* void getCellProperties (in long row, in wstring colID,
in nsISupportsArray properties); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetCellProperties(PRInt32 row, const PRUnichar *colID,
nsISupportsArray *properties)
{
return NS_OK;
}
/* void getColumnProperties (in wstring colID, in nsIDOMElement colElt,
in nsISupportsArray properties); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetColumnProperties(const PRUnichar *colID,
nsIDOMElement *colElt,
nsISupportsArray *properties)
{
return NS_OK;
}
/* boolean isContainer (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::IsContainer(PRInt32 index, PRBool *_retval)
{
nsCOMPtr<nsIASN1Object> object;
nsCOMPtr<nsIASN1Sequence> sequence;
nsresult rv = GetASN1ObjectAtIndex(index, mASN1Object,
getter_AddRefs(object));
if (NS_FAILED(rv))
return rv;
sequence = do_QueryInterface(object);
if (sequence != nsnull) {
sequence->GetProcessObjects(_retval);
} else {
*_retval = PR_FALSE;
}
return NS_OK;
}
/* boolean isContainerOpen (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::IsContainerOpen(PRInt32 index, PRBool *_retval)
{
nsCOMPtr<nsIASN1Object> object;
nsCOMPtr<nsIASN1Sequence> sequence;
nsresult rv = GetASN1ObjectAtIndex(index, mASN1Object,
getter_AddRefs(object));
if (NS_FAILED(rv))
return rv;
sequence = do_QueryInterface(object);
if (sequence == nsnull) {
*_retval = PR_FALSE;
} else {
sequence->GetShowObjects(_retval);
}
return NS_OK;
}
/* boolean isContainerEmpty (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::IsContainerEmpty(PRInt32 index, PRBool *_retval)
{
*_retval = PR_FALSE;
return NS_OK;
}
PRInt32
nsNSSASN1Outliner::GetParentOfObjectAtIndex(PRUint32 index,
nsIASN1Object *sourceObject)
{
if (index == 0) {
return -1;
} else {
PRUint32 numVisibleRows = CountNumberOfVisibleRows(sourceObject);
if (numVisibleRows > index) {
nsCOMPtr<nsIASN1Sequence>sequence(do_QueryInterface(sourceObject));
if (sequence == nsnull)
return -2;
nsCOMPtr<nsISupportsArray>asn1Objects;
nsCOMPtr<nsISupports>isupports;
nsCOMPtr<nsIASN1Object>currObject;
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
PRUint32 indexCnt = 0;
PRUint32 i,numObjects;
asn1Objects->Count(&numObjects);
for (i=0; i<numObjects; i++) {
isupports = dont_AddRef(asn1Objects->ElementAt(i));
currObject = do_QueryInterface(isupports);
numVisibleRows = CountNumberOfVisibleRows(currObject);
if (numVisibleRows+indexCnt > index) {
//We're dealing with a sequence with visible elements
//that has the desired element.
PRInt32 subIndex = GetParentOfObjectAtIndex(index-indexCnt+1,
currObject);
if (subIndex == -1) {
return indexCnt+1;
} else if (subIndex == -2) {
return -2;
} else {
// This is a case where a subIndex was returned.
return indexCnt+1+subIndex;
}
}
indexCnt+=numVisibleRows;
if (indexCnt == index) {
// The passed in source object is the parent.
return -1;
}
}
}// the else case is an error, just let it fall through.
}
return -2;
}
/* long getParentIndex (in long rowIndex); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetParentIndex(PRInt32 rowIndex, PRInt32 *_retval)
{
*_retval = GetParentOfObjectAtIndex(rowIndex, mASN1Object);
return NS_OK;
}
/* boolean hasNextSibling (in long rowIndex, in long afterIndex); */
NS_IMETHODIMP
nsNSSASN1Outliner::HasNextSibling(PRInt32 rowIndex, PRInt32 afterIndex,
PRBool *_retval)
{
*_retval = PR_FALSE;
return NS_OK;
}
PRInt32
nsNSSASN1Outliner::GetLevelsTilIndex(PRUint32 index,
nsIASN1Object *sourceObject)
{
if (index == 0) {
return 0;
} else {
nsCOMPtr<nsIASN1Sequence> sequence(do_QueryInterface(sourceObject));
nsCOMPtr<nsISupportsArray>asn1Objects;
if (sequence == nsnull)
return -1;
sequence->GetASN1Objects(getter_AddRefs(asn1Objects));
PRUint32 numObjects,i,indexCnt=0,numVisibleRows;
asn1Objects->Count(&numObjects);
nsCOMPtr<nsISupports> isupports;
nsCOMPtr<nsIASN1Object> currObject;
for (i=0; i<numObjects; i++) {
isupports = dont_AddRef(asn1Objects->ElementAt(i));
currObject = do_QueryInterface(isupports);
numVisibleRows = CountNumberOfVisibleRows(currObject);
if ((numVisibleRows+indexCnt)>=index) {
PRInt32 numSubLayers;
numSubLayers = GetLevelsTilIndex(index-indexCnt-1,
currObject);
if (numSubLayers == -1) {
// This return value means the parent is not a child
// object, we're not adding any more layers to the nested
// levels.
return -1;
} else {
return 1+numSubLayers;
}
}
indexCnt += numVisibleRows;
}
}
return -2;
}
/* long getLevel (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetLevel(PRInt32 index, PRInt32 *_retval)
{
*_retval = GetLevelsTilIndex(index, mASN1Object);
return NS_OK;
}
/* wstring getCellText (in long row, in wstring colID); */
NS_IMETHODIMP
nsNSSASN1Outliner::GetCellText(PRInt32 row, const PRUnichar *colID,
PRUnichar **_retval)
{
nsCOMPtr<nsIASN1Object> object;
*_retval = nsnull;
char *col = NS_CONST_CAST(char *, NS_ConvertUCS2toUTF8(colID).get());
nsresult rv = NS_OK;
if (strcmp(col, "certDataCol") == 0) {
rv = GetASN1ObjectAtIndex(row, mASN1Object,
getter_AddRefs(object));
if (NS_FAILED(rv))
return rv;
//There's only one column for ASN1 dump.
rv = object->GetDisplayName(_retval);
}
return rv;
}
/* void setOutliner (in nsIOutlinerBoxObject outliner); */
NS_IMETHODIMP
nsNSSASN1Outliner::SetOutliner(nsIOutlinerBoxObject *outliner)
{
mOutliner = outliner;
return NS_OK;
}
/* void toggleOpenState (in long index); */
NS_IMETHODIMP
nsNSSASN1Outliner::ToggleOpenState(PRInt32 index)
{
nsCOMPtr<nsIASN1Object> object;
nsresult rv = GetASN1ObjectAtIndex(index, mASN1Object,
getter_AddRefs(object));
if (NS_FAILED(rv))
return rv;
nsCOMPtr<nsIASN1Sequence> sequence(do_QueryInterface(object));
if (sequence == nsnull)
return NS_ERROR_FAILURE;
PRBool showObjects;
sequence->GetShowObjects(&showObjects);
PRInt32 rowCountChange;
if (showObjects) {
rowCountChange = 1-CountNumberOfVisibleRows(object);
sequence->SetShowObjects(PR_FALSE);
} else {
sequence->SetShowObjects(PR_TRUE);
rowCountChange = CountNumberOfVisibleRows(object)-1;
}
if (mOutliner)
mOutliner->RowCountChanged(index, rowCountChange);
return NS_OK;
}
/* void cycleHeader (in wstring colID, in nsIDOMElement elt); */
NS_IMETHODIMP
nsNSSASN1Outliner::CycleHeader(const PRUnichar *colID, nsIDOMElement *elt)
{
return NS_OK;
}
/* void selectionChanged (); */
NS_IMETHODIMP
nsNSSASN1Outliner::SelectionChanged()
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void cycleCell (in long row, in wstring colID); */
NS_IMETHODIMP
nsNSSASN1Outliner::CycleCell(PRInt32 row, const PRUnichar *colID)
{
return NS_OK;
}
/* boolean isEditable (in long row, in wstring colID); */
NS_IMETHODIMP
nsNSSASN1Outliner::IsEditable(PRInt32 row, const PRUnichar *colID,
PRBool *_retval)
{
*_retval = PR_FALSE;
return NS_OK;
}
/* void setCellText (in long row, in wstring colID, in wstring value); */
NS_IMETHODIMP
nsNSSASN1Outliner::SetCellText(PRInt32 row, const PRUnichar *colID,
const PRUnichar *value)
{
return NS_OK;
}
/* void performAction (in wstring action); */
NS_IMETHODIMP
nsNSSASN1Outliner::PerformAction(const PRUnichar *action)
{
return NS_OK;
}
/* void performActionOnRow (in wstring action, in long row); */
NS_IMETHODIMP
nsNSSASN1Outliner::PerformActionOnRow(const PRUnichar *action, PRInt32 row)
{
return NS_OK;
}
/* void performActionOnCell (in wstring action, in long row, in wstring colID); */
NS_IMETHODIMP
nsNSSASN1Outliner::PerformActionOnCell(const PRUnichar *action, PRInt32 row,
const PRUnichar *colID)
{
return NS_OK;
}
//
// CanDropOn
//
// Can't drop on the thread pane.
//
NS_IMETHODIMP nsNSSASN1Outliner::CanDropOn(PRInt32 index, PRBool *_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
*_retval = PR_FALSE;
return NS_OK;
}
//
// CanDropBeforeAfter
//
// Can't drop on the thread pane.
//
NS_IMETHODIMP nsNSSASN1Outliner::CanDropBeforeAfter(PRInt32 index, PRBool before, PRBool *_retval)
{
NS_ENSURE_ARG_POINTER(_retval);
*_retval = PR_FALSE;
return NS_OK;
}
//
// Drop
//
// Can't drop on the thread pane.
//
NS_IMETHODIMP nsNSSASN1Outliner::Drop(PRInt32 row, PRInt32 orient)
{
return NS_OK;
}
//
// IsSorted
//
// ...
//
NS_IMETHODIMP nsNSSASN1Outliner::IsSorted(PRBool *_retval)
{
*_retval = PR_FALSE;
return NS_OK;
}

View File

@@ -0,0 +1,73 @@
/*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Netscape security libraries.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1994-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#ifndef _NSSASNOUTLINER_H_
#define _NSSASNOUTLINER_H_
#include "nscore.h"
#include "nsIX509Cert.h"
#include "nsIASN1Outliner.h"
#include "nsIOutlinerView.h"
#include "nsIOutlinerBoxObject.h"
#include "nsIOutlinerSelection.h"
#include "nsCOMPtr.h"
//4bfaa9f0-1dd2-11b2-afae-a82cbaa0b606
#define NS_NSSASN1OUTINER_CID { \
0x4bfaa9f0, \
0x1dd2, \
0x11b2, \
{0xaf,0xae,0xa8,0x2c,0xba,0xa0,0xb6,0x06} \
}
class nsNSSASN1Outliner : public nsIASN1Outliner
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIASN1OUTLINER
NS_DECL_NSIOUTLINERVIEW
nsNSSASN1Outliner();
virtual ~nsNSSASN1Outliner();
protected:
PRUint32 CountNumberOfVisibleRows(nsIASN1Object *asn1Object);
nsresult GetASN1ObjectAtIndex(PRUint32 index, nsIASN1Object *sourceObject,
nsIASN1Object **retval);
PRInt32 GetParentOfObjectAtIndex(PRUint32 index, nsIASN1Object *sourceObject);
PRInt32 GetLevelsTilIndex(PRUint32 index, nsIASN1Object *sourceObject);
nsCOMPtr<nsIASN1Object> mASN1Object;
nsCOMPtr<nsIOutlinerSelection> mSelection;
nsCOMPtr<nsIOutlinerBoxObject> mOutliner;
};
#endif //_NSSASNOUTLINER_H_

View File

@@ -0,0 +1,914 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Terry Hayes <thayes@netscape.com>
* Javier Delgadillo <javi@netscape.com>
*/
/*
* Dialog services for PIP.
*/
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsXPIDLString.h"
#include "nsIPrompt.h"
#include "nsIDOMWindowInternal.h"
#include "nsIDialogParamBlock.h"
#include "nsIComponentManager.h"
#include "nsIServiceManager.h"
#include "nsIStringBundle.h"
#include "nsIPref.h"
#include "nsIInterfaceRequestor.h"
#include "nsIX509Cert.h"
#include "nsIX509CertDB.h"
#include "nsILocaleService.h"
#include "nsIDateTimeFormat.h"
#include "nsDateTimeFormatCID.h"
#include "nsIWindowWatcher.h"
#include "nsNSSDialogs.h"
#include "nsPKIParamBlock.h"
#include "nsIKeygenThread.h"
#define PIPSTRING_BUNDLE_URL "chrome://pippki/locale/pippki.properties"
#define STRING_BUNDLE_URL "chrome://communicator/locale/security.properties"
#define ENTER_SITE_PREF "security.warn_entering_secure"
#define WEAK_SITE_PREF "security.warn_entering_weak"
#define LEAVE_SITE_PREF "security.warn_leaving_secure"
#define MIXEDCONTENT_PREF "security.warn_viewing_mixed"
#define INSECURE_SUBMIT_PREF "security.warn_submit_insecure"
static NS_DEFINE_CID(kCStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
static NS_DEFINE_CID(kPrefCID, NS_PREF_CID);
static NS_DEFINE_CID(kDateTimeFormatCID, NS_DATETIMEFORMAT_CID);
/**
* Common class that uses the window watcher service to open a
* standard dialog, with or without a parent context. The params
* parameter can be an nsISupportsArray so any number of additional
* arguments can be used.
*/
class nsNSSDialogHelper
{
public:
const static char *kDefaultOpenWindowParam;
//The params is going to be either a nsIPKIParamBlock or
//nsIDialogParamBlock
static nsresult openDialog(
nsIDOMWindowInternal *window,
const char *url,
nsISupports *params);
};
const char* nsNSSDialogHelper::kDefaultOpenWindowParam = "centerscreen,chrome,modal,titlebar";
nsresult
nsNSSDialogHelper::openDialog(
nsIDOMWindowInternal *window,
const char *url,
nsISupports *params)
{
nsresult rv;
nsCOMPtr<nsIWindowWatcher> windowWatcher =
do_GetService("@mozilla.org/embedcomp/window-watcher;1", &rv);
if (NS_FAILED(rv)) return rv;
nsIDOMWindowInternal *parent = window;
nsCOMPtr<nsIDOMWindowInternal> activeParent;
if (!parent) {
nsCOMPtr<nsIDOMWindow> active;
windowWatcher->GetActiveWindow(getter_AddRefs(active));
if (active) {
active->QueryInterface(NS_GET_IID(nsIDOMWindowInternal), getter_AddRefs(activeParent));
parent = activeParent;
}
}
nsCOMPtr<nsIDOMWindow> newWindow;
rv = windowWatcher->OpenWindow(parent,
url,
"_blank",
nsNSSDialogHelper::kDefaultOpenWindowParam,
params,
getter_AddRefs(newWindow));
return rv;
}
/* ==== */
static NS_DEFINE_CID(kPKIParamBlockCID, NS_PKIPARAMBLOCK_CID);
nsNSSDialogs::nsNSSDialogs()
{
NS_INIT_ISUPPORTS();
}
nsNSSDialogs::~nsNSSDialogs()
{
}
NS_IMPL_THREADSAFE_ISUPPORTS9(nsNSSDialogs, nsINSSDialogs,
nsITokenPasswordDialogs,
nsISecurityWarningDialogs,
nsIBadCertListener,
nsICertificateDialogs,
nsIClientAuthDialogs,
nsITokenDialogs,
nsIDOMCryptoDialogs,
nsIGeneratingKeypairInfoDialogs);
nsresult
nsNSSDialogs::Init()
{
nsresult rv;
mPref = do_GetService(kPrefCID, &rv);
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIStringBundleService> service = do_GetService(kCStringBundleServiceCID, &rv);
if (NS_FAILED(rv)) return rv;
rv = service->CreateBundle(STRING_BUNDLE_URL,
getter_AddRefs(mStringBundle));
if (NS_FAILED(rv)) return rv;
rv = service->CreateBundle(PIPSTRING_BUNDLE_URL,
getter_AddRefs(mPIPStringBundle));
return rv;
}
nsresult
nsNSSDialogs::SetPassword(nsIInterfaceRequestor *ctx,
const PRUnichar *tokenName, PRBool* _canceled)
{
nsresult rv;
*_canceled = PR_FALSE;
// Get the parent window for the dialog
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
if (!block) return NS_ERROR_FAILURE;
// void ChangePassword(in wstring tokenName, out int status);
rv = block->SetString(1, tokenName);
if (NS_FAILED(rv)) return rv;
rv = nsNSSDialogHelper::openDialog(parent,
"chrome://pippki/content/changepassword.xul",
block);
if (NS_FAILED(rv)) return rv;
PRInt32 status;
rv = block->GetInt(1, &status);
if (NS_FAILED(rv)) return rv;
*_canceled = (status == 0)?PR_TRUE:PR_FALSE;
return rv;
}
nsresult
nsNSSDialogs::GetPassword(nsIInterfaceRequestor *ctx,
const PRUnichar *tokenName,
PRUnichar **_password,
PRBool* _canceled)
{
nsresult rv;
*_canceled = PR_FALSE;
// Get the parent window for the dialog
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
if (!block) return NS_ERROR_FAILURE;
// Set the token name in the window
rv = block->SetString(1, tokenName);
if (NS_FAILED(rv)) return rv;
// open up the window
rv = nsNSSDialogHelper::openDialog(parent,
"chrome://pippki/content/getpassword.xul",
block);
if (NS_FAILED(rv)) return rv;
// see if user canceled
PRInt32 status;
rv = block->GetInt(1, &status);
if (NS_FAILED(rv)) return rv;
*_canceled = (status == 0) ? PR_TRUE : PR_FALSE;
if (!*_canceled) {
// retrieve the password
rv = block->GetString(2, _password);
}
return rv;
}
/* boolean unknownIssuer (in nsITransportSecurityInfo socketInfo,
in nsIX509Cert cert, out addType); */
NS_IMETHODIMP
nsNSSDialogs::UnknownIssuer(nsITransportSecurityInfo *socketInfo,
nsIX509Cert *cert, PRInt16 *outAddType,
PRBool *_retval)
{
nsresult rv;
PRInt32 addType;
*_retval = PR_FALSE;
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
if (!block)
return NS_ERROR_FAILURE;
nsXPIDLString commonName;
rv = block->SetISupportAtIndex(1, cert);
if (NS_FAILED(rv))
return rv;
rv = nsNSSDialogHelper::openDialog(nsnull,
"chrome://pippki/content/newserver.xul",
block);
if (NS_FAILED(rv))
return rv;
PRInt32 status;
nsCOMPtr<nsIDialogParamBlock> dialogBlock = do_QueryInterface(block);
rv = dialogBlock->GetInt(1, &status);
if (NS_FAILED(rv))
return rv;
if (status == 0) {
*_retval = PR_FALSE;
} else {
// The user wants to continue, let's figure out
// what to do with this cert.
rv = dialogBlock->GetInt(2, &addType);
switch (addType) {
case 0:
*outAddType = ADD_TRUSTED_PERMANENTLY;
*_retval = PR_TRUE;
break;
case 1:
*outAddType = ADD_TRUSTED_FOR_SESSION;
*_retval = PR_TRUE;
break;
default:
*outAddType = UNINIT_ADD_FLAG;
*_retval = PR_FALSE;
break;
}
}
return NS_OK;
}
/* boolean mismatchDomain (in nsITransportSecurityInfo socketInfo,
in wstring targetURL,
in nsIX509Cert cert); */
NS_IMETHODIMP
nsNSSDialogs::MismatchDomain(nsITransportSecurityInfo *socketInfo,
const PRUnichar *targetURL,
nsIX509Cert *cert, PRBool *_retval)
{
nsresult rv;
*_retval = PR_FALSE;
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
if (!block)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIDialogParamBlock> dialogBlock = do_QueryInterface(block);
rv = dialogBlock->SetString(1, targetURL);
if (NS_FAILED(rv))
return rv;
rv = block->SetISupportAtIndex(1, cert);
if (NS_FAILED(rv))
return rv;
rv = nsNSSDialogHelper::openDialog(nsnull,
"chrome://pippki/content/domainMismatch.xul",
block);
if (NS_FAILED(rv))
return rv;
PRInt32 status;
rv = dialogBlock->GetInt(1, &status);
if (NS_FAILED(rv))
return rv;
*_retval = (status) ? PR_TRUE : PR_FALSE;
return NS_OK;
}
/* boolean certExpired (in nsITransportSecurityInfo socketInfo,
in nsIX509Cert cert); */
NS_IMETHODIMP
nsNSSDialogs::CertExpired(nsITransportSecurityInfo *socketInfo,
nsIX509Cert *cert, PRBool *_retval)
{
nsresult rv;
PRTime now = PR_Now();
PRTime notAfter, notBefore, timeToUse;
nsCOMPtr<nsIX509CertValidity> validity;
const char *key;
const char *titleKey;
*_retval = PR_FALSE;
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
if (!block)
return NS_ERROR_FAILURE;
rv = cert->GetValidity(getter_AddRefs(validity));
if (NS_FAILED(rv))
return rv;
rv = validity->GetNotAfter(&notAfter);
if (NS_FAILED(rv))
return rv;
rv = validity->GetNotBefore(&notBefore);
if (NS_FAILED(rv))
return rv;
if (LL_CMP(now, >, notAfter)) {
key = "serverCertExpiredMsg1";
titleKey = "serverCertExpiredTitle";
timeToUse = notAfter;
} else {
key = "serverCertNotYetValedMsg1";
titleKey = "serverCertNotYetValidTitle";
timeToUse = notBefore;
}
nsXPIDLString message1;
nsXPIDLString title;
PRUnichar *commonName=nsnull;
nsString formattedDate;
rv = cert->GetCommonName(&commonName);
nsIDateTimeFormat *aDateTimeFormat;
rv = nsComponentManager::CreateInstance(kDateTimeFormatCID, NULL,
NS_GET_IID(nsIDateTimeFormat),
(void **) &aDateTimeFormat);
aDateTimeFormat->FormatPRTime(nsnull, kDateFormatShort,
kTimeFormatNoSeconds, timeToUse,
formattedDate);
PRUnichar *formattedDatePR = formattedDate.ToNewUnicode();
const PRUnichar *formatStrings[2] = { commonName, formattedDatePR };
nsString keyString = NS_ConvertASCIItoUCS2(key);
nsString titleKeyString = NS_ConvertASCIItoUCS2(titleKey);
mPIPStringBundle->FormatStringFromName(keyString.get(), formatStrings,
2, getter_Copies(message1));
mPIPStringBundle->FormatStringFromName(titleKeyString.get(), formatStrings,
2, getter_Copies(title));
Recycle(commonName);
Recycle(formattedDatePR);
nsCOMPtr<nsIDialogParamBlock> dialogBlock = do_QueryInterface(block);
rv = dialogBlock->SetString(1,message1);
rv = dialogBlock->SetString(2,title);
if (NS_FAILED(rv))
return rv;
rv = block->SetISupportAtIndex(1, cert);
if (NS_FAILED(rv))
return rv;
rv = nsNSSDialogHelper::openDialog(nsnull,
"chrome://pippki/content/serverCertExpired.xul",
block);
PRInt32 status;
rv = dialogBlock->GetInt(1, &status);
if (NS_FAILED(rv))
return rv;
*_retval = (status) ? PR_TRUE : PR_FALSE;
return NS_OK;
}
NS_IMETHODIMP
nsNSSDialogs::CrlExpired(nsITransportSecurityInfo *socketInfo,
nsIX509Cert *cert, PRBool *_retval)
{
nsresult rv;
*_retval = PR_FALSE;
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
nsCOMPtr<nsIDialogParamBlock> dialogBlock = do_QueryInterface(block);
rv = block->SetISupportAtIndex(1, cert);
if (NS_FAILED(rv))
return rv;
rv = nsNSSDialogHelper::openDialog(nsnull,
"chrome://pippki/content/serverCrlExpired.xul",
block);
PRInt32 status;
rv = dialogBlock->GetInt(1, &status);
if (NS_FAILED(rv))
return rv;
*_retval = (status) ? PR_TRUE : PR_FALSE;
return NS_OK;
}
nsresult
nsNSSDialogs::AlertEnteringSecure(nsIInterfaceRequestor *ctx)
{
nsresult rv;
rv = AlertDialog(ctx, ENTER_SITE_PREF,
NS_LITERAL_STRING("EnterSiteMessage").get());
return rv;
}
nsresult
nsNSSDialogs::AlertEnteringWeak(nsIInterfaceRequestor *ctx)
{
nsresult rv;
rv = AlertDialog(ctx, WEAK_SITE_PREF,
NS_LITERAL_STRING("WeakSiteMessage").get());
return rv;
}
nsresult
nsNSSDialogs::AlertLeavingSecure(nsIInterfaceRequestor *ctx)
{
nsresult rv;
rv = AlertDialog(ctx, LEAVE_SITE_PREF,
NS_LITERAL_STRING("LeaveSiteMessage").get());
return rv;
}
nsresult
nsNSSDialogs::AlertMixedMode(nsIInterfaceRequestor *ctx)
{
nsresult rv;
rv = AlertDialog(ctx, MIXEDCONTENT_PREF,
NS_LITERAL_STRING("MixedContentMessage").get());
return rv;
}
nsresult
nsNSSDialogs::AlertDialog(nsIInterfaceRequestor *ctx, const char *prefName,
const PRUnichar *dialogMessageName)
{
nsresult rv;
// Get user's preference for this alert
PRBool prefValue;
rv = mPref->GetBoolPref(prefName, &prefValue);
if (NS_FAILED(rv)) prefValue = PR_TRUE;
// Stop if alert is not requested
if (!prefValue) return NS_OK;
// Get Prompt to use
nsCOMPtr<nsIPrompt> prompt = do_GetInterface(ctx);
if (!prompt) return NS_ERROR_FAILURE;
// Get messages strings from localization file
nsXPIDLString windowTitle, message, dontShowAgain;
mStringBundle->GetStringFromName(NS_LITERAL_STRING("Title").get(),
getter_Copies(windowTitle));
mStringBundle->GetStringFromName(dialogMessageName,
getter_Copies(message));
mStringBundle->GetStringFromName(NS_LITERAL_STRING("DontShowAgain").get(),
getter_Copies(dontShowAgain));
if (!windowTitle || !message || !dontShowAgain) return NS_ERROR_FAILURE;
rv = prompt->AlertCheck(windowTitle, message, dontShowAgain, &prefValue);
if (NS_FAILED(rv)) return rv;
if (!prefValue) {
mPref->SetBoolPref(prefName, PR_FALSE);
}
return rv;
}
nsresult
nsNSSDialogs::ConfirmPostToInsecure(nsIInterfaceRequestor *ctx, PRBool* _result)
{
nsresult rv;
rv = ConfirmDialog(ctx, INSECURE_SUBMIT_PREF,
NS_LITERAL_STRING("PostToInsecureFromInsecure").get(),
_result);
return rv;
}
nsresult
nsNSSDialogs::ConfirmPostToInsecureFromSecure(nsIInterfaceRequestor *ctx, PRBool* _result)
{
nsresult rv;
rv = ConfirmDialog(ctx, nsnull,
NS_LITERAL_STRING("PostToInsecure").get(), _result);
return rv;
}
nsresult
nsNSSDialogs::ConfirmDialog(nsIInterfaceRequestor *ctx, const char *prefName,
const PRUnichar *messageName, PRBool* _result)
{
nsresult rv;
// Get user's preference for this alert
PRBool prefValue = PR_TRUE;
if (prefName) {
rv = mPref->GetBoolPref(prefName, &prefValue);
if (NS_FAILED(rv)) prefValue = PR_TRUE;
}
// Stop if confirm is not requested
if (!prefValue) {
*_result = PR_TRUE;
return NS_OK;
}
// Get Prompt to use
nsCOMPtr<nsIPrompt> prompt = do_GetInterface(ctx);
if (!prompt) return NS_ERROR_FAILURE;
// Get messages strings from localization file
nsXPIDLString windowTitle, message, dontShowAgain;
mStringBundle->GetStringFromName(NS_LITERAL_STRING("Title").get(),
getter_Copies(windowTitle));
mStringBundle->GetStringFromName(messageName,
getter_Copies(message));
if (!windowTitle || !message) return NS_ERROR_FAILURE;
if (prefName) {
mStringBundle->GetStringFromName(NS_LITERAL_STRING("DontShowAgain").get(),
getter_Copies(dontShowAgain));
if (!dontShowAgain) return NS_ERROR_FAILURE;
rv = prompt->ConfirmCheck(windowTitle, message, dontShowAgain, &prefValue, _result);
} else {
rv = prompt->Confirm(windowTitle, message, _result);
}
if (NS_FAILED(rv)) return rv;
if (prefName && !prefValue) {
mPref->SetBoolPref(prefName, PR_FALSE);
}
return rv;
}
/* void downloadCACert (in nsIInterfaceRequestor ctx,
in nsIX509Cert cert,
out trust,
out canceled); */
NS_IMETHODIMP
nsNSSDialogs::DownloadCACert(nsIInterfaceRequestor *ctx,
nsIX509Cert *cert,
PRUint32 *_trust,
PRBool *_canceled)
{
nsresult rv;
*_canceled = PR_FALSE;
// Get the parent window for the dialog
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
if (!block) return NS_ERROR_FAILURE;
nsXPIDLString commonName;
rv = cert->GetCommonName(getter_Copies(commonName));
if (NS_FAILED(rv))
return rv;
rv = block->SetString(1, commonName);
if (NS_FAILED(rv)) return rv;
rv = nsNSSDialogHelper::openDialog(parent,
"chrome://pippki/content/downloadcert.xul",
block);
if (NS_FAILED(rv)) return rv;
PRInt32 status;
PRInt32 ssl, email, objsign;
rv = block->GetInt(1, &status);
if (NS_FAILED(rv)) return rv;
rv = block->GetInt(2, &ssl);
if (NS_FAILED(rv)) return rv;
rv = block->GetInt(3, &email);
if (NS_FAILED(rv)) return rv;
rv = block->GetInt(4, &objsign);
if (NS_FAILED(rv)) return rv;
*_trust = nsIX509CertDB::UNTRUSTED;
*_trust |= (ssl) ? nsIX509CertDB::TRUSTED_SSL : 0;
*_trust |= (email) ? nsIX509CertDB::TRUSTED_EMAIL : 0;
*_trust |= (objsign) ? nsIX509CertDB::TRUSTED_OBJSIGN : 0;
*_canceled = (status == 0)?PR_TRUE:PR_FALSE;
return rv;
}
NS_IMETHODIMP
nsNSSDialogs::CACertExists(nsIInterfaceRequestor *ctx,PRBool *_canceled)
{
nsresult rv;
*_canceled = PR_FALSE;
// Get the parent window for the dialog
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
if (!block) return NS_ERROR_FAILURE;
rv = nsNSSDialogHelper::openDialog(parent,
"chrome://pippki/content/cacertexists.xul",
block);
return rv;
}
NS_IMETHODIMP
nsNSSDialogs::ChooseCertificate(nsIInterfaceRequestor *ctx, const PRUnichar *cn, const PRUnichar *organization, const PRUnichar *issuer, const PRUnichar **certNickList, const PRUnichar **certDetailsList, PRUint32 count, PRInt32 *selectedIndex, PRBool *canceled)
{
nsresult rv;
PRUint32 i;
*canceled = PR_FALSE;
// Get the parent window for the dialog
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
if (!block) return NS_ERROR_FAILURE;
// void ChangePassword(in wstring tokenName, out int status);
rv = block->SetString(1, cn);
if (NS_FAILED(rv)) return rv;
// void ChangePassword(in wstring tokenName, out int status);
rv = block->SetString(2, organization);
if (NS_FAILED(rv)) return rv;
// void ChangePassword(in wstring tokenName, out int status);
rv = block->SetString(3, issuer);
if (NS_FAILED(rv)) return rv;
for (i = 0; i < count; i++) {
rv = block->SetString(i+4, certNickList[i]);
if (NS_FAILED(rv)) return rv;
}
for (i = 0; i < count; i++) {
rv = block->SetString(i+count+4, certDetailsList[i]);
if (NS_FAILED(rv)) return rv;
}
rv = block->SetInt(1, count);
if (NS_FAILED(rv)) return rv;
rv = nsNSSDialogHelper::openDialog(nsnull,
"chrome://pippki/content/clientauthask.xul",
block);
if (NS_FAILED(rv)) return rv;
PRInt32 status;
rv = block->GetInt(1, &status);
if (NS_FAILED(rv)) return rv;
*canceled = (status == 0)?PR_TRUE:PR_FALSE;
if (!*canceled) {
// retrieve the nickname
rv = block->GetInt(2, selectedIndex);
}
return rv;
}
/*
* void setPKCS12FilePassword(in nsIInterfaceRequestor ctx,
* out wstring password,
* out boolean canceled);
*/
NS_IMETHODIMP
nsNSSDialogs::SetPKCS12FilePassword(nsIInterfaceRequestor *ctx,
PRUnichar **_password,
PRBool *_canceled)
{
nsresult rv;
*_canceled = PR_FALSE;
// Get the parent window for the dialog
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
if (!block) return NS_ERROR_FAILURE;
// open up the window
rv = nsNSSDialogHelper::openDialog(parent,
"chrome://pippki/content/setp12password.xul",
block);
if (NS_FAILED(rv)) return rv;
// see if user canceled
PRInt32 status;
rv = block->GetInt(1, &status);
if (NS_FAILED(rv)) return rv;
*_canceled = (status == 0) ? PR_TRUE : PR_FALSE;
if (!*_canceled) {
// retrieve the password
rv = block->GetString(2, _password);
}
return rv;
}
/*
* void getPKCS12FilePassword(in nsIInterfaceRequestor ctx,
* out wstring password,
* out boolean canceled);
*/
NS_IMETHODIMP
nsNSSDialogs::GetPKCS12FilePassword(nsIInterfaceRequestor *ctx,
PRUnichar **_password,
PRBool *_canceled)
{
nsresult rv;
*_canceled = PR_FALSE;
// Get the parent window for the dialog
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
if (!block) return NS_ERROR_FAILURE;
// open up the window
rv = nsNSSDialogHelper::openDialog(parent,
"chrome://pippki/content/getp12password.xul",
block);
if (NS_FAILED(rv)) return rv;
// see if user canceled
PRInt32 status;
rv = block->GetInt(1, &status);
if (NS_FAILED(rv)) return rv;
*_canceled = (status == 0) ? PR_TRUE : PR_FALSE;
if (!*_canceled) {
// retrieve the password
rv = block->GetString(2, _password);
}
return rv;
}
/* void viewCert (in nsIX509Cert cert); */
NS_IMETHODIMP
nsNSSDialogs::ViewCert(nsIX509Cert *cert)
{
nsresult rv;
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
if (!block)
return NS_ERROR_FAILURE;
rv = block->SetISupportAtIndex(1, cert);
if (NS_FAILED(rv))
return rv;
rv = nsNSSDialogHelper::openDialog(nsnull,
"chrome://pippki/content/certViewer.xul",
block);
return rv;
}
NS_IMETHODIMP
nsNSSDialogs::DisplayGeneratingKeypairInfo(nsIInterfaceRequestor *aCtx, nsIKeygenThread *runnable)
{
nsresult rv;
// Get the parent window for the dialog
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(aCtx);
rv = nsNSSDialogHelper::openDialog(parent,
"chrome://pippki/content/createCertInfo.xul",
runnable);
return rv;
}
NS_IMETHODIMP
nsNSSDialogs::ChooseToken(nsIInterfaceRequestor *aCtx, const PRUnichar **aTokenList, PRUint32 aCount, PRUnichar **aTokenChosen, PRBool *aCanceled) {
nsresult rv;
PRUint32 i;
*aCanceled = PR_FALSE;
// Get the parent window for the dialog
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(aCtx);
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
if (!block) return NS_ERROR_FAILURE;
for (i = 0; i < aCount; i++) {
rv = block->SetString(i+1, aTokenList[i]);
if (NS_FAILED(rv)) return rv;
}
rv = block->SetInt(1, aCount);
if (NS_FAILED(rv)) return rv;
rv = nsNSSDialogHelper::openDialog(nsnull,
"chrome://pippki/content/choosetoken.xul",
block);
if (NS_FAILED(rv)) return rv;
PRInt32 status;
rv = block->GetInt(1, &status);
if (NS_FAILED(rv)) return rv;
*aCanceled = (status == 0)?PR_TRUE:PR_FALSE;
if (!*aCanceled) {
// retrieve the nickname
rv = block->GetString(1, aTokenChosen);
}
return rv;
}
/* boolean ConfirmKeyEscrow (in nsIX509Cert escrowAuthority); */
NS_IMETHODIMP
nsNSSDialogs::ConfirmKeyEscrow(nsIX509Cert *escrowAuthority, PRBool *_retval)
{
*_retval = PR_FALSE;
nsresult rv;
nsCOMPtr<nsIPKIParamBlock> block = do_CreateInstance(kPKIParamBlockCID);
if (!block)
return NS_ERROR_FAILURE;
rv = block->SetISupportAtIndex(1, escrowAuthority);
if (NS_FAILED(rv))
return rv;
rv = nsNSSDialogHelper::openDialog(nsnull,
"chrome://pippki/content/escrowWarn.xul",
block);
if (NS_FAILED(rv))
return rv;
PRInt32 status=0;
nsCOMPtr<nsIDialogParamBlock> dlgParamBlock = do_QueryInterface(block);
rv = dlgParamBlock->GetInt(1, &status);
if (status) {
*_retval = PR_TRUE;
}
return rv;
}

View File

@@ -0,0 +1,75 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 2001 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Terry Hayes <thayes@netscape.com>
*/
#ifndef __NS_NSSDIALOGS_H__
#define __NS_NSSDIALOGS_H__
#include "nsINSSDialogs.h"
#include "nsIBadCertListener.h"
#include "nsCOMPtr.h"
#include "nsIStringBundle.h"
#include "nsIPref.h"
#define NS_NSSDIALOGS_CID \
{ 0x518e071f, 0x1dd2, 0x11b2, \
{ 0x93, 0x7e, 0xc4, 0x5f, 0x14, 0xde, 0xf7, 0x78 }}
class nsNSSDialogs
: public nsINSSDialogs,
public nsITokenPasswordDialogs,
public nsIBadCertListener,
public nsISecurityWarningDialogs,
public nsICertificateDialogs,
public nsIClientAuthDialogs,
public nsITokenDialogs,
public nsIDOMCryptoDialogs,
public nsIGeneratingKeypairInfoDialogs
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSINSSDIALOGS
NS_DECL_NSITOKENPASSWORDDIALOGS
NS_DECL_NSIBADCERTLISTENER
NS_DECL_NSISECURITYWARNINGDIALOGS
NS_DECL_NSICERTIFICATEDIALOGS
NS_DECL_NSICLIENTAUTHDIALOGS
NS_DECL_NSITOKENDIALOGS
NS_DECL_NSIDOMCRYPTODIALOGS
NS_DECL_NSIGENERATINGKEYPAIRINFODIALOGS
nsNSSDialogs();
virtual ~nsNSSDialogs();
nsresult Init();
protected:
nsresult AlertDialog(nsIInterfaceRequestor *ctx, const char *prefName,
const PRUnichar *messageName);
nsresult ConfirmDialog(nsIInterfaceRequestor *ctx, const char *prefName,
const PRUnichar *messageName, PRBool* _result);
nsCOMPtr<nsIStringBundle> mStringBundle;
nsCOMPtr<nsIStringBundle> mPIPStringBundle;
nsCOMPtr<nsIPref> mPref;
};
#endif

View File

@@ -0,0 +1,58 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Terry Hayes <thayes@netscape.com>
*/
#include "nsIModule.h"
#include "nsIGenericFactory.h"
#include "nsNSSDialogs.h"
#include "nsPKIParamBlock.h"
#include "nsASN1Outliner.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNSSDialogs, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPKIParamBlock, Init)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNSSASN1Outliner)
static nsModuleComponentInfo components[] =
{
{
"NSS Dialogs",
NS_NSSDIALOGS_CID,
NS_NSSDIALOGS_CONTRACTID,
nsNSSDialogsConstructor
},
{
"ASN1 Outliner",
NS_NSSASN1OUTINER_CID,
NS_ASN1OUTLINER_CONTRACTID,
nsNSSASN1OutlinerConstructor
},
{ "PKI Parm Block",
NS_PKIPARAMBLOCK_CID,
NS_PKIPARAMBLOCK_CONTRACTID,
nsPKIParamBlockConstructor
}
};
NS_IMPL_NSGETMODULE(PKI, components)

View File

@@ -0,0 +1,114 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#include "nsPKIParamBlock.h"
#include "nsIServiceManager.h"
#include "nsIDialogParamBlock.h"
NS_IMPL_THREADSAFE_ISUPPORTS2(nsPKIParamBlock, nsIPKIParamBlock,
nsIDialogParamBlock)
nsPKIParamBlock::nsPKIParamBlock()
{
NS_INIT_REFCNT();
}
nsresult
nsPKIParamBlock::Init()
{
mDialogParamBlock = do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1");
return (mDialogParamBlock == nsnull) ? NS_ERROR_OUT_OF_MEMORY : NS_OK;
}
nsPKIParamBlock::~nsPKIParamBlock()
{
}
NS_IMETHODIMP
nsPKIParamBlock::SetNumberStrings( PRInt32 inNumStrings )
{
return mDialogParamBlock->SetNumberStrings(inNumStrings);
}
NS_IMETHODIMP
nsPKIParamBlock::SetInt(PRInt32 inIndex, PRInt32 inInt)
{
return mDialogParamBlock->SetInt(inIndex, inInt);
}
NS_IMETHODIMP
nsPKIParamBlock::GetInt(PRInt32 inIndex, PRInt32 *outInt)
{
return mDialogParamBlock->GetInt(inIndex, outInt);
}
NS_IMETHODIMP
nsPKIParamBlock::GetString(PRInt32 inIndex, PRUnichar **_retval)
{
return mDialogParamBlock->GetString(inIndex, _retval);
}
NS_IMETHODIMP
nsPKIParamBlock::SetString(PRInt32 inIndex, const PRUnichar *inString)
{
return mDialogParamBlock->SetString(inIndex, inString);
}
/* void setISupportAtIndex (in PRInt32 index, in nsISupports object); */
NS_IMETHODIMP
nsPKIParamBlock::SetISupportAtIndex(PRInt32 index, nsISupports *object)
{
if (!mSupports) {
mSupports = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
if (mSupports == nsnull) {
return NS_ERROR_OUT_OF_MEMORY;
}
}
return mSupports->InsertElementAt(object, index-1);
}
/* nsISupports getISupportAtIndex (in PRInt32 index); */
NS_IMETHODIMP
nsPKIParamBlock::GetISupportAtIndex(PRInt32 index, nsISupports **_retval)
{
NS_ENSURE_ARG(_retval);
*_retval = mSupports->ElementAt(index-1);
return NS_OK;
}

View File

@@ -0,0 +1,65 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Javier Delgadillo <javi@netscape.com>
*
* Alternatively, the contents of this file may be used under the
* terms of the GNU General Public License Version 2 or later (the
* "GPL"), in which case the provisions of the GPL are applicable
* instead of those above. If you wish to allow use of your
* version of this file only under the terms of the GPL and not to
* allow others to use your version of this file under the MPL,
* indicate your decision by deleting the provisions above and
* replace them with the notice and other provisions required by
* the GPL. If you do not delete the provisions above, a recipient
* may use your version of this file under either the MPL or the
* GPL.
*/
#ifndef _NSPKIPARAMBLOCK_
#define _NSPKIPARAMBLOCK_
#include "nsCOMPtr.h"
#include "nsIPKIParamBlock.h"
#include "nsIDialogParamBlock.h"
#include "nsISupportsArray.h"
#define NS_PKIPARAMBLOCK_CID \
{ 0x0bec75a8, 0x1dd2, 0x11b2, \
{ 0x86, 0x3a, 0xf6, 0x9f, 0x77, 0xc3, 0x13, 0x71 }}
#define NS_PKIPARAMBLOCK_CONTRACTID "@mozilla.org/security/pkiparamblock;1"
class nsPKIParamBlock : public nsIPKIParamBlock,
public nsIDialogParamBlock
{
public:
nsPKIParamBlock();
virtual ~nsPKIParamBlock();
nsresult Init();
NS_DECL_NSIPKIPARAMBLOCK
NS_DECL_NSIDIALOGPARAMBLOCK
NS_DECL_ISUPPORTS
private:
nsCOMPtr<nsIDialogParamBlock> mDialogParamBlock;
nsCOMPtr<nsISupportsArray> mSupports;
};
#endif //_NSPKIPARAMBLOCK_

View File

@@ -0,0 +1,30 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Brian Ryner <bryner@netscape.com>
#
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
DIRS = resources src public
include $(topsrcdir)/config/rules.mk

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,41 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
DEPTH=..\..\..
include <$(DEPTH)/config/config.mak>
DIRS = public src resources
include <$(DEPTH)\config\rules.mak>

View File

@@ -0,0 +1,59 @@
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Brian Ryner <bryner@netscape.com>
# Javier Delgadillo <javi@netscape.com>
# Terry Hayes <thayes@netscape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
MODULE = pipnss
DEPTH = ../../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
XPIDLSRCS = \
nsIBadCertListener.idl \
nsICertSelect.idl \
nsIX509Cert.idl \
nsIX509CertDB.idl \
nsIPKCS11Slot.idl \
nsIPK11TokenDB.idl \
nsINSSDialogs.idl \
nsISSLStatus.idl \
nsICertOutliner.idl \
nsIKeygenThread.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@@ -0,0 +1,67 @@
#!nmake
#
# The contents of this file are subject to the Netscape Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/NPL/
#
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is Netscape
# Communications Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
# Javier Delgadillo
# Terry Hayes <thayes@netscape.com>
#
# Alternatively, the contents of this file may be used under the
# terms of the GNU General Public License Version 2 or later (the
# "GPL"), in which case the provisions of the GPL are applicable
# instead of those above. If you wish to allow use of your
# version of this file only under the terms of the GPL and not to
# allow others to use your version of this file under the MPL,
# indicate your decision by deleting the provisions above and
# replace them with the notice and other provisions required by
# the GPL. If you do not delete the provisions above, a recipient
# may use your version of this file under either the MPL or the
# GPL.
#
MODULE = pipnss
DEPTH=..\..\..\..
IGNORE_MANIFEST=1
DLLNAME = pipnss
PDBFILE = $(DLLNAME).pdb
MAPFILE = $(DLLNAME).map
DLL = .\$(OBJDIR)\$(DLLNAME).dll
MAKE_OBJ_TYPE = DLL
include <$(DEPTH)/config/config.mak>
XPIDL_INCLUDES=-I$(DEPTH)\dist\idl
XPIDLSRCS= \
.\nsIBadCertListener.idl \
.\nsICertSelect.idl \
.\nsIX509Cert.idl \
.\nsIX509CertDB.idl \
.\nsIPKCS11Slot.idl \
.\nsIPK11TokenDB.idl \
.\nsINSSDialogs.idl \
.\nsISSLStatus.idl \
.\nsICertOutliner.idl \
.\nsIKeygenThread.idl \
.\nsICMSMessage.idl \
$(NULL)
include <$(DEPTH)\config\rules.mak>

Some files were not shown because too many files have changed in this diff Show More