home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / security / spec / EncodedKeySpec.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.6 KB  |  59 lines

  1. /*
  2.  * @(#)EncodedKeySpec.java    1.7 98/03/18
  3.  *
  4.  * Copyright 1997 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.security.spec;
  16.  
  17. /**
  18.  * This class represents a public or private key in encoded format.
  19.  *
  20.  * @author Jan Luehe
  21.  *
  22.  * @version 1.7, 98/03/18
  23.  *
  24.  * @see java.security.Key
  25.  * @see java.security.KeyFactory
  26.  * @see KeySpec
  27.  * @see X509EncodedKeySpec
  28.  * @see PKCS8EncodedKeySpec
  29.  *
  30.  * @since JDK1.2
  31.  */
  32.  
  33. public abstract class EncodedKeySpec implements KeySpec {
  34.  
  35.     /**
  36.      * Returns the encoded key.
  37.      *
  38.      * @return the encoded key.
  39.      */
  40.     public abstract byte[] getEncoded();
  41.  
  42.     /**
  43.      * Returns the name of the encoding format associated with this
  44.      * key specification.
  45.      * 
  46.      * <p>If the opaque representation of a key 
  47.      * (see <a href = "java.security.Key.html">Key</a>) can be transformed
  48.      * (see <a href = "java.security.KeyFactory.html">KeyFactory</a>) 
  49.      * into this key specification (or a subclass of it),
  50.      * <code>getFormat</code> called
  51.      * on the opaque key returns the same value as the 
  52.      * <code>getFormat</code> method
  53.      * of this key specification.
  54.      * 
  55.      * @return a string representation of the encoding format.
  56.      */
  57.     public abstract String getFormat();
  58. }
  59.