1. /*
  2. * @(#)X509EncodedKeySpec.java 1.14 00/02/02
  3. *
  4. * Copyright 1997-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.security.spec;
  11. /**
  12. * This class represents the ASN.1 encoding of a public key,
  13. * encoded according to the ASN.1 type <code>SubjectPublicKeyInfo</code>,
  14. * whose syntax is defined in the X.509 standard, as follows:
  15. *
  16. * <pre>
  17. * SubjectPublicKeyInfo ::= SEQUENCE {
  18. * algorithm AlgorithmIdentifier,
  19. * subjectPublicKey BIT STRING }
  20. * </pre>
  21. *
  22. * @author Jan Luehe
  23. *
  24. * @version 1.14, 02/02/00
  25. *
  26. * @see java.security.Key
  27. * @see java.security.KeyFactory
  28. * @see KeySpec
  29. * @see EncodedKeySpec
  30. * @see PKCS8EncodedKeySpec
  31. *
  32. * @since 1.2
  33. */
  34. public class X509EncodedKeySpec extends EncodedKeySpec {
  35. /**
  36. * Creates a new X509EncodedKeySpec with the given encoded key.
  37. *
  38. * @param encodedKey the key, which is assumed to be
  39. * encoded according to the X.509 standard.
  40. */
  41. public X509EncodedKeySpec(byte[] encodedKey) {
  42. super(encodedKey);
  43. }
  44. /**
  45. * Returns the key bytes, encoded according to the X.509 standard.
  46. *
  47. * @return the X.509 encoding of the key.
  48. */
  49. public byte[] getEncoded() {
  50. return super.getEncoded();
  51. }
  52. /**
  53. * Returns the name of the encoding format associated with this
  54. * key specification.
  55. *
  56. * @return the string <code>"X.509"</code>.
  57. */
  58. public final String getFormat() {
  59. return "X.509";
  60. }
  61. }