< prev index next >

src/java.base/share/classes/java/security/cert/CertificateRevokedException.java

Print this page




 214     }
 215 
 216     /**
 217      * Deserialize the {@code CertificateRevokedException} instance.
 218      */
 219     private void readObject(ObjectInputStream ois)
 220         throws IOException, ClassNotFoundException {
 221         // Read in the non-transient fields
 222         // (revocationDate, reason, authority)
 223         ois.defaultReadObject();
 224 
 225         // Defensively copy the revocation date
 226         revocationDate = new Date(revocationDate.getTime());
 227 
 228         // Read in the size (number of mappings) of the extensions map
 229         // and create the extensions map
 230         int size = ois.readInt();
 231         if (size == 0) {
 232             extensions = Collections.emptyMap();
 233         } else {
 234             extensions = new HashMap<String, Extension>(size);
 235         }
 236 
 237         // Read in the extensions and put the mappings in the extensions map
 238         for (int i = 0; i < size; i++) {
 239             String oid = (String) ois.readObject();
 240             boolean critical = ois.readBoolean();
 241             int length = ois.readInt();
 242             byte[] extVal = new byte[length];
 243             ois.readFully(extVal);
 244             Extension ext = sun.security.x509.Extension.newExtension
 245                 (new ObjectIdentifier(oid), critical, extVal);
 246             extensions.put(oid, ext);
 247         }
 248     }
 249 }


 214     }
 215 
 216     /**
 217      * Deserialize the {@code CertificateRevokedException} instance.
 218      */
 219     private void readObject(ObjectInputStream ois)
 220         throws IOException, ClassNotFoundException {
 221         // Read in the non-transient fields
 222         // (revocationDate, reason, authority)
 223         ois.defaultReadObject();
 224 
 225         // Defensively copy the revocation date
 226         revocationDate = new Date(revocationDate.getTime());
 227 
 228         // Read in the size (number of mappings) of the extensions map
 229         // and create the extensions map
 230         int size = ois.readInt();
 231         if (size == 0) {
 232             extensions = Collections.emptyMap();
 233         } else {
 234             extensions = new HashMap<>(size);
 235         }
 236 
 237         // Read in the extensions and put the mappings in the extensions map
 238         for (int i = 0; i < size; i++) {
 239             String oid = (String) ois.readObject();
 240             boolean critical = ois.readBoolean();
 241             int length = ois.readInt();
 242             byte[] extVal = new byte[length];
 243             ois.readFully(extVal);
 244             Extension ext = sun.security.x509.Extension.newExtension
 245                 (new ObjectIdentifier(oid), critical, extVal);
 246             extensions.put(oid, ext);
 247         }
 248     }
 249 }
< prev index next >