jdk/src/share/classes/com/sun/crypto/provider/PBEKey.java
changeset 10336 0bb1999251f8
parent 5506 202f599c92aa
child 11835 c9e7cfc908b3
equal deleted inserted replaced
10335:3c7eda3ab2f5 10336:0bb1999251f8
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2011, 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
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package com.sun.crypto.provider;
    26 package com.sun.crypto.provider;
    27 
    27 
    28 import java.io.UnsupportedEncodingException;
       
    29 import java.security.KeyRep;
    28 import java.security.KeyRep;
    30 import java.security.spec.InvalidKeySpecException;
    29 import java.security.spec.InvalidKeySpecException;
    31 import javax.crypto.SecretKey;
    30 import javax.crypto.SecretKey;
    32 import javax.crypto.spec.PBEKeySpec;
    31 import javax.crypto.spec.PBEKeySpec;
    33 
    32 
    67         java.util.Arrays.fill(passwd, ' ');
    66         java.util.Arrays.fill(passwd, ' ');
    68         type = keytype;
    67         type = keytype;
    69     }
    68     }
    70 
    69 
    71     public byte[] getEncoded() {
    70     public byte[] getEncoded() {
    72         return (byte[])this.key.clone();
    71         return this.key.clone();
    73     }
    72     }
    74 
    73 
    75     public String getAlgorithm() {
    74     public String getAlgorithm() {
    76         return type;
    75         return type;
    77     }
    76     }
   116      */
   115      */
   117     private void readObject(java.io.ObjectInputStream s)
   116     private void readObject(java.io.ObjectInputStream s)
   118          throws java.io.IOException, ClassNotFoundException
   117          throws java.io.IOException, ClassNotFoundException
   119     {
   118     {
   120         s.defaultReadObject();
   119         s.defaultReadObject();
   121         key = (byte[])key.clone();
   120         key = key.clone();
   122     }
   121     }
   123 
   122 
   124 
   123 
   125     /**
   124     /**
   126      * Replace the PBE key to be serialized.
   125      * Replace the PBE key to be serialized.