ws-tsik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject svn commit: r326931 - /incubator/tsik/trunk/src/org/apache/tsik/xmlsig/tools/PrivateKeyTool.java
Date Thu, 20 Oct 2005 16:12:30 GMT
Author: hans
Date: Thu Oct 20 09:12:26 2005
New Revision: 326931

URL: http://svn.apache.org/viewcvs?rev=326931&view=rev
Log:
Incorporated PKCS#8 fixes from Bradley Ward [bward@coindata.com]

Modified:
    incubator/tsik/trunk/src/org/apache/tsik/xmlsig/tools/PrivateKeyTool.java

Modified: incubator/tsik/trunk/src/org/apache/tsik/xmlsig/tools/PrivateKeyTool.java
URL: http://svn.apache.org/viewcvs/incubator/tsik/trunk/src/org/apache/tsik/xmlsig/tools/PrivateKeyTool.java?rev=326931&r1=326930&r2=326931&view=diff
==============================================================================
--- incubator/tsik/trunk/src/org/apache/tsik/xmlsig/tools/PrivateKeyTool.java (original)
+++ incubator/tsik/trunk/src/org/apache/tsik/xmlsig/tools/PrivateKeyTool.java Thu Oct 20 09:12:26
2005
@@ -1,20 +1,22 @@
-// $Id$
+/* $Id$ */
 
-//
-// (C) Copyright 2005 VeriSign, Inc.  All Rights Reserved.
-//
-// VeriSign, Inc. shall have no responsibility, financial or
-// otherwise, for any consequences arising out of the use of
-// this material. The program material is provided on an "AS IS"
-// BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
-// express or implied. The user is responsible for determining
-// any necessary third party rights or authorizations that may
-// be required for the use of the materials. Users are advised 
-// that they may need authorizations under certain patents from 
-// Microsoft and IBM, or others. Please see notice.txt file. 
-// VeriSign disclaims any obligation to notify the user of any 
-// such third party rights.
-//
+/*
+ * Copyright 2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 
+ * 
+ * Unless required by applicable law or agreed to in writing, software 
+ * distributed under the License is distributed on an "AS IS" BASIS, 
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
+ *
+ * See the License for the specific language governing permissions and 
+ * limitations under the License.
+ *
+ */
 
 package org.apache.tsik.xmlsig.tools; 
 
@@ -170,10 +172,14 @@
 
         Key key = ks.getKey(alias, password.toCharArray());
 
-        if (!"PKCS8".equals(key.getFormat())){
+        String keyFormat = key.getFormat();
+        boolean exportable = (("PKCS8".equals(keyFormat)) 
+                              || ("PKCS#8".equals(keyFormat)));
+
+        if (!exportable){
             throw new IllegalArgumentException("Key is not exportable in "
                                                +"PKCS #8 format (found " 
-                                               +key.getFormat() + " format)");
+                                               +keyFormat + " format)");
         }
         FileOutputStream fos = new FileOutputStream(keyFileName); 
         fos.write(key.getEncoded());
@@ -327,3 +333,4 @@
     }
 }
 
+ 



---------------------------------------------------------------------
To unsubscribe, e-mail: tsik-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: tsik-dev-help@ws.apache.org


Mime
View raw message