[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tsik-dev
Subject:    svn commit: r326931 -
From:       hans () apache ! org
Date:       2005-10-20 16:12:30
Message-ID: 20051020161231.85556.qmail () minotaur ! apache ! org
[Download RAW message or body]

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic