src/java.base/share/classes/sun/security/x509/X509Key.java
changeset 57950 4612a3cfb927
parent 48080 18a4438eb690
child 58519 6e017b301287
equal deleted inserted replaced
57945:e09c993ac476 57950:4612a3cfb927
     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 
   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();