1. /*
  2. * @(#)X509EncodedKeySpec.java 1.10 01/11/29
  3. *
  4. * Copyright 2002 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 DER encoding of a public or private key,
  10. * according to the format specified in the X.509 standard.
  11. *
  12. * @author Jan Luehe
  13. *
  14. * @version 1.10 01/11/29
  15. *
  16. * @see java.security.Key
  17. * @see java.security.KeyFactory
  18. * @see KeySpec
  19. * @see EncodedKeySpec
  20. * @see PKCS8EncodedKeySpec
  21. *
  22. * @since JDK1.2
  23. */
  24. public class X509EncodedKeySpec extends EncodedKeySpec {
  25. /**
  26. * Creates a new X509EncodedKeySpec with the given encoded key.
  27. *
  28. * @param encodedKey the key, which is assumed to be
  29. * encoded according to the X.509 standard.
  30. */
  31. public X509EncodedKeySpec(byte[] encodedKey) {
  32. super(encodedKey);
  33. }
  34. /**
  35. * Returns the key bytes, encoded according to the X.509 standard.
  36. *
  37. * @return the X.509 encoding of the key.
  38. */
  39. public byte[] getEncoded() {
  40. return super.getEncoded();
  41. }
  42. /**
  43. * Returns the name of the encoding format associated with this
  44. * key specification.
  45. *
  46. * @return the string <code>"X.509"</code>.
  47. */
  48. public final String getFormat() {
  49. return "X.509";
  50. }
  51. }