1. /*
  2. * @(#)file SnmpSecurityParameters.java
  3. * @(#)author Sun Microsystems, Inc.
  4. * @(#)version 1.17
  5. * @(#)date 04/09/15
  6. *
  7. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  8. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  9. *
  10. */
  11. package com.sun.jmx.snmp;
  12. import com.sun.jmx.snmp.SnmpStatusException;
  13. import com.sun.jmx.snmp.SnmpTooBigException;
  14. /**
  15. * Security parameters are security model dependent. Every security parameters class wishing to be passed to a security model must implement this marker interface.
  16. * This interface has to be implemented when developing customized security models.
  17. * <p><b>This API is a Sun Microsystems internal API and is subject
  18. * to change without notice.</b></p>
  19. * @since 1.5
  20. */
  21. public interface SnmpSecurityParameters {
  22. /**
  23. * BER encoding of security parameters.
  24. * @param outputBytes Array to fill.
  25. * @return Encoded parameters length.
  26. */
  27. int encode(byte[] outputBytes) throws SnmpTooBigException;
  28. /**
  29. * BER decoding of security parameters.
  30. * @param params Encoded parameters.
  31. */
  32. void decode(byte[] params) throws SnmpStatusException;
  33. /**
  34. * Principal coded inside the security parameters.
  35. * @return The security principal.
  36. */
  37. String getPrincipal();
  38. }