src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java
changeset 57950 4612a3cfb927
parent 51504 c9a3e3cac9c7
equal deleted inserted replaced
57945:e09c993ac476 57950:4612a3cfb927
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2019, 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
    42  * @author Jan Luehe
    42  * @author Jan Luehe
    43  *
    43  *
    44  */
    44  */
    45 final class PBEKey implements SecretKey {
    45 final class PBEKey implements SecretKey {
    46 
    46 
       
    47     @java.io.Serial
    47     static final long serialVersionUID = -2234768909660948176L;
    48     static final long serialVersionUID = -2234768909660948176L;
    48 
    49 
    49     private byte[] key;
    50     private byte[] key;
    50 
    51 
    51     private String type;
    52     private String type;
   144 
   145 
   145     /**
   146     /**
   146      * readObject is called to restore the state of this key from
   147      * readObject is called to restore the state of this key from
   147      * a stream.
   148      * a stream.
   148      */
   149      */
       
   150     @java.io.Serial
   149     private void readObject(java.io.ObjectInputStream s)
   151     private void readObject(java.io.ObjectInputStream s)
   150          throws java.io.IOException, ClassNotFoundException
   152          throws java.io.IOException, ClassNotFoundException
   151     {
   153     {
   152         s.defaultReadObject();
   154         s.defaultReadObject();
   153         key = key.clone();
   155         key = key.clone();
   160      * @return the standard KeyRep object to be serialized
   162      * @return the standard KeyRep object to be serialized
   161      *
   163      *
   162      * @throws java.io.ObjectStreamException if a new object representing
   164      * @throws java.io.ObjectStreamException if a new object representing
   163      * this PBE key could not be created
   165      * this PBE key could not be created
   164      */
   166      */
       
   167     @java.io.Serial
   165     private Object writeReplace() throws java.io.ObjectStreamException {
   168     private Object writeReplace() throws java.io.ObjectStreamException {
   166         return new KeyRep(KeyRep.Type.SECRET,
   169         return new KeyRep(KeyRep.Type.SECRET,
   167                         getAlgorithm(),
   170                         getAlgorithm(),
   168                         getFormat(),
   171                         getFormat(),
   169                         getEncoded());
   172                         getEncoded());