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 / X509EncodedKeySpec.java < prev   
Encoding:
Java Source  |  1998-03-20  |  1.6 KB  |  67 lines

  1. /*
  2.  * @(#)X509EncodedKeySpec.java    1.6 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 the DER encoding of a public or private key,
  19.  * according to the format specified in the X.509 standard.
  20.  *
  21.  * @author Jan Luehe
  22.  *
  23.  * @version 1.6, 98/03/18
  24.  *
  25.  * @see java.security.Key
  26.  * @see java.security.KeyFactory
  27.  * @see KeySpec
  28.  * @see EncodedKeySpec
  29.  * @see PKCS8EncodedKeySpec
  30.  *
  31.  * @since JDK1.2
  32.  */
  33.  
  34. public class X509EncodedKeySpec extends EncodedKeySpec {
  35.  
  36.     private byte[] encodedKey;
  37.  
  38.     /**
  39.      * Creates a new X509EncodedKeySpec with the specified encoded key.
  40.      * 
  41.      * @param encodedKey the key, which is assumed to be 
  42.      * encoded according to the X.509 standard.
  43.      */
  44.     public X509EncodedKeySpec(byte[] encodedKey) {
  45.     this.encodedKey = encodedKey;
  46.     }
  47.  
  48.     /**
  49.      * Returns the key bytes, encoded according to the X.509 standard.
  50.      *
  51.      * @return the X.509 encoding of the key.
  52.      */
  53.     public byte[] getEncoded() {
  54.     return this.encodedKey;
  55.     }
  56.  
  57.     /**
  58.      * Returns the name of the encoding format associated with this
  59.      * key specification.
  60.      *
  61.      * @return the string <code>"X.509"</code>.
  62.      */
  63.     public final String getFormat() {
  64.     return "X.509";
  65.     }
  66. }
  67.