jdk/src/share/classes/javax/crypto/spec/SecretKeySpec.java
changeset 25402 0c24d9aa8fb9
parent 23010 6dadb192ad81
equal deleted inserted replaced
25401:2e2b5a66a787 25402:0c24d9aa8fb9
     1 /*
     1 /*
     2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    24  */
    24  */
    25 
    25 
    26 package javax.crypto.spec;
    26 package javax.crypto.spec;
    27 
    27 
    28 import java.security.spec.KeySpec;
    28 import java.security.spec.KeySpec;
       
    29 import java.util.Locale;
    29 import javax.crypto.SecretKey;
    30 import javax.crypto.SecretKey;
    30 
    31 
    31 /**
    32 /**
    32  * This class specifies a secret key in a provider-independent fashion.
    33  * This class specifies a secret key in a provider-independent fashion.
    33  *
    34  *
   192             retval += this.key[i] * i;
   193             retval += this.key[i] * i;
   193         }
   194         }
   194         if (this.algorithm.equalsIgnoreCase("TripleDES"))
   195         if (this.algorithm.equalsIgnoreCase("TripleDES"))
   195             return (retval ^= "desede".hashCode());
   196             return (retval ^= "desede".hashCode());
   196         else
   197         else
   197             return (retval ^= this.algorithm.toLowerCase().hashCode());
   198             return (retval ^=
       
   199                     this.algorithm.toLowerCase(Locale.ENGLISH).hashCode());
   198     }
   200     }
   199 
   201 
   200    /**
   202    /**
   201      * Tests for equality between the specified object and this
   203      * Tests for equality between the specified object and this
   202      * object. Two SecretKeySpec objects are considered equal if
   204      * object. Two SecretKeySpec objects are considered equal if