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