home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / java / io / SerializablePermission.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  3.5 KB  |  117 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)SerializablePermission.java    1.8 98/06/29
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17. import java.security.*;
  18. import java.util.Enumeration;
  19. import java.util.Hashtable;
  20. import java.util.StringTokenizer;
  21.  
  22. /**
  23.  * This class is for Serializable permissions. A SerializablePermission
  24.  * contains a name (also referred to as a "target name") but
  25.  * no actions list; you either have the named permission
  26.  * or you don't.
  27.  *
  28.  * <P>
  29.  * The target name is the name of the Serializable permission (see below).
  30.  *
  31.  * <P>
  32.  * The following table lists all the possible SerializablePermission target names,
  33.  * and for each provides a description of what the permission allows
  34.  * and a discussion of the risks of granting code the permission.
  35.  * <P>
  36.  *
  37.  * <table border=1 cellpadding=5>
  38.  * <tr>
  39.  * <th>Permission Target Name</th>
  40.  * <th>What the Permission Allows</th>
  41.  * <th>Risks of Allowing this Permission</th>
  42.  * </tr>
  43.  *
  44.  * <tr>
  45.  *   <td>enableSubclassImplementation</td>
  46.  *   <td>Subclass implementation of ObjectOutputStream or ObjectInputStream
  47.  * to override the default serialization or deserialization, respectively,
  48.  * of objects</td>
  49.  *   <td>Code can use this to serialize or
  50.  * deserialize classes in a purposefully malfeasant manner. For example,
  51.  * during serialization, malicious code can use this to
  52.  * purposefully store confidential private field data in a way easily accessible
  53.  * to attackers. Or, during deserializaiton it could, for example, deserialize
  54.  * a class with all its private fields zeroed out.</td>
  55.  * </tr>
  56.  *
  57.  * <tr>
  58.  *   <td>enableSubstitution</td>
  59.  *   <td>Substitution of one object for another during
  60.  * serialization or deserialization</td>
  61.  *   <td>This is dangerous because malicious code
  62.  * can replace the actual object with one which has incorrect or
  63.  * malignant data.</td>
  64.  * </tr>
  65.  *
  66.  * </table>
  67.  *
  68.  * @see java.security.BasicPermission
  69.  * @see java.security.Permission
  70.  * @see java.security.Permissions
  71.  * @see java.security.PermissionCollection
  72.  * @see java.lang.SecurityManager
  73.  *
  74.  * @version 1.2
  75.  *
  76.  * @author Joe Fialli
  77.  */
  78.  
  79. /* code was borrowed originally from java.lang.RuntimePermission. */
  80.  
  81. public final class SerializablePermission extends BasicPermission {
  82.  
  83.     /**
  84.      * @serial
  85.      */
  86.     private String actions;
  87.  
  88.     /**
  89.      * Creates a new SerializablePermission with the specified name.
  90.      * The name is the symbolic name of the SerializablePermission, such as
  91.      * "enableSubstitution", etc.
  92.      *
  93.      * @param name the name of the SerializablePermission.
  94.      */
  95.  
  96.  
  97.     public SerializablePermission(String name)
  98.     {
  99.     super(name);
  100.     }
  101.  
  102.     /**
  103.      * Creates a new SerializablePermission object with the specified name.
  104.      * The name is the symbolic name of the SerializablePermission, and the
  105.      * actions String is currently unused and should be null.  This
  106.      * constructor exists for use by the <code>Policy</code> object
  107.      * to instantiate new Permission objects.
  108.      *
  109.      * @param name the name of the SerializablePermission.
  110.      */
  111.  
  112.     public SerializablePermission(String name, String actions)
  113.     {
  114.     super(name, actions);
  115.     }
  116. }
  117.