src/java.base/share/classes/sun/security/x509/X509Key.java
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 48080 18a4438eb690
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
     1 /*
     1 /*
     2  * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1996, 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
    57  * @author David Brownell
    57  * @author David Brownell
    58  */
    58  */
    59 public class X509Key implements PublicKey {
    59 public class X509Key implements PublicKey {
    60 
    60 
    61     /** use serialVersionUID from JDK 1.1. for interoperability */
    61     /** use serialVersionUID from JDK 1.1. for interoperability */
       
    62     @java.io.Serial
    62     private static final long serialVersionUID = -5359250853002055002L;
    63     private static final long serialVersionUID = -5359250853002055002L;
    63 
    64 
    64     /* The algorithm information (name, parameters, etc). */
    65     /* The algorithm information (name, parameters, etc). */
    65     protected AlgorithmId algid;
    66     protected AlgorithmId algid;
    66 
    67 
    81      */
    82      */
    82     @Deprecated
    83     @Deprecated
    83     private int unusedBits = 0;
    84     private int unusedBits = 0;
    84 
    85 
    85     /* BitArray form of key */
    86     /* BitArray form of key */
    86     private BitArray bitStringKey = null;
    87     private transient BitArray bitStringKey = null;
    87 
    88 
    88     /* The encoding for the key. */
    89     /* The encoding for the key. */
    89     protected byte[] encodedKey;
    90     protected byte[] encodedKey;
    90 
    91 
    91     /**
    92     /**
   403 
   404 
   404     /**
   405     /**
   405      * Serialization write ... X.509 keys serialize as
   406      * Serialization write ... X.509 keys serialize as
   406      * themselves, and they're parsed when they get read back.
   407      * themselves, and they're parsed when they get read back.
   407      */
   408      */
       
   409     @java.io.Serial
   408     private void writeObject(ObjectOutputStream stream) throws IOException {
   410     private void writeObject(ObjectOutputStream stream) throws IOException {
   409         stream.write(getEncoded());
   411         stream.write(getEncoded());
   410     }
   412     }
   411 
   413 
   412     /**
   414     /**
   413      * Serialization read ... X.509 keys serialize as
   415      * Serialization read ... X.509 keys serialize as
   414      * themselves, and they're parsed when they get read back.
   416      * themselves, and they're parsed when they get read back.
   415      */
   417      */
       
   418     @java.io.Serial
   416     private void readObject(ObjectInputStream stream) throws IOException {
   419     private void readObject(ObjectInputStream stream) throws IOException {
   417         try {
   420         try {
   418             decode(stream);
   421             decode(stream);
   419         } catch (InvalidKeyException e) {
   422         } catch (InvalidKeyException e) {
   420             e.printStackTrace();
   423             e.printStackTrace();