src/macosx/classes/apple/security/KeychainStore.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -246,11 +246,11 @@
 
         if (entry != null && entry instanceof KeyEntry) {
             if (((KeyEntry)entry).chain == null) {
                 return null;
             } else {
-                return (Certificate[])((KeyEntry)entry).chain.clone();
+                return ((KeyEntry)entry).chain.clone();
             }
         } else {
             return null;
         }
     }

@@ -363,11 +363,11 @@
                 if (chain != null) {
                     if ((chain.length > 1) && !validateChain(chain)) {
                         throw new KeyStoreException("Certificate chain does not validate");
                     }
 
-                    entry.chain = (Certificate[])chain.clone();
+                    entry.chain = chain.clone();
                     entry.chainRefs = new long[entry.chain.length];
                 }
 
                 String lowerAlias = alias.toLowerCase();
                 if (entries.get(lowerAlias) != null) {

@@ -427,11 +427,11 @@
 
             entry.date = new Date();
 
             if ((chain != null) &&
                 (chain.length != 0)) {
-                entry.chain = (Certificate[])chain.clone();
+                entry.chain = chain.clone();
                 entry.chainRefs = new long[entry.chain.length];
             }
 
             String lowerAlias = alias.toLowerCase();
             if (entries.get(lowerAlias) != null) {

@@ -1120,11 +1120,11 @@
                                           + e.getMessage());
             uke.initCause(e);
             throw uke;
         }
 
-        return ((byte[])key);
+        return key;
     }
 
 
 }