1. /*
  2. * @(#)CertStoreParameters.java 1.5 03/12/19
  3. *
  4. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.security.cert;
  8. /**
  9. * A specification of <code>CertStore</code> parameters.
  10. * <p>
  11. * The purpose of this interface is to group (and provide type safety for)
  12. * all <code>CertStore</code> parameter specifications. All
  13. * <code>CertStore</code> parameter specifications must implement this
  14. * interface.
  15. * <p>
  16. * Typically, a <code>CertStoreParameters</code> object is passed as a parameter
  17. * to one of the {@link CertStore#getInstance CertStore.getInstance} methods.
  18. * The <code>getInstance</code> method returns a <code>CertStore</code> that
  19. * is used for retrieving <code>Certificate</code>s and <code>CRL</code>s. The
  20. * <code>CertStore</code> that is returned is initialized with the specified
  21. * parameters. The type of parameters needed may vary between different types
  22. * of <code>CertStore</code>s.
  23. *
  24. * @see CertStore#getInstance
  25. *
  26. * @version 1.5 12/19/03
  27. * @since 1.4
  28. * @author Steve Hanna
  29. */
  30. public interface CertStoreParameters extends Cloneable {
  31. /**
  32. * Makes a copy of this <code>CertStoreParameters</code>.
  33. * <p>
  34. * The precise meaning of "copy" may depend on the class of
  35. * the <code>CertStoreParameters</code> object. A typical implementation
  36. * performs a "deep copy" of this object, but this is not an absolute
  37. * requirement. Some implementations may perform a "shallow copy" of some
  38. * or all of the fields of this object.
  39. * <p>
  40. * Note that the <code>CertStore.getInstance</code> methods make a copy
  41. * of the specified <code>CertStoreParameters</code>. A deep copy
  42. * implementation of <code>clone</code> is safer and more robust, as it
  43. * prevents the caller from corrupting a shared <code>CertStore</code> by
  44. * subsequently modifying the contents of its initialization parameters.
  45. * However, a shallow copy implementation of <code>clone</code> is more
  46. * appropriate for applications that need to hold a reference to a
  47. * parameter contained in the <code>CertStoreParameters</code>. For example,
  48. * a shallow copy clone allows an application to release the resources of
  49. * a particular <code>CertStore</code> initialization parameter immediately,
  50. * rather than waiting for the garbage collection mechanism. This should
  51. * be done with the utmost care, since the <code>CertStore</code> may still
  52. * be in use by other threads.
  53. * <p>
  54. * Each subclass should state the precise behavior of this method so
  55. * that users and developers know what to expect.
  56. *
  57. * @return a copy of this <code>CertStoreParameters</code>
  58. */
  59. Object clone();
  60. }