Java SaslClient unwrap() method with example method Unwraps a byte array received from the server. This method can be called only after the authentication exchange has completed (i.e., when
isComplete() returns true) and only if the authentication exchange has negotiated integrity and/or privacy as the quality of protection; otherwise, an
IllegalStateException is thrown.

incoming is the contents of the SASL buffer as defined in RFC 2222 without the leading four octet field that represents the length. offset and len specify the portion of incoming to use.

SaslClient unwrap() method Signature

byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException


incoming – A non-null byte array containing the encoded bytes from the server.
offset – The starting position at
incoming of the bytes to use.
len – The number of bytes from
incoming to use.


A non-null byte array containing the decoded bytes.


SaslException – if
incoming cannot be successfully unwrapped.
IllegalStateException – if the authentication exchange has not completed, or if the negotiated quality of protection has neither integrity nor privacy. method Implementation

byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException{

SaslClient unwrap() method Example


public class UnwrapMethodExample {

	public static void main(String[] args) {




Ask your questions in eHowToNow Forum

Post your technical, non-technical doubts, questions in our site. Get answer as soon as possible, meanwhile you can help others by answering, unanswered questions.
To Ask new Question : Ask Question
Check our existing discussions : Questions & Answers

  1. Java MultiColorChooserUI createUI() method with example
  2. Java DatagramSocket getBroadcast() method with example
  3. Java – XMLSignContext Interface
  4. Java DatagramChannel send() method with example
  5. Java SynthEditorPaneUI installDefaults() method with example
  6. Java Scrollbar getAccessibleContext() method with example
  7. Java JTable addColumn() method with example
  8. org.omg.PortableServer.POAPackage Package
  9. Java JEditorPane getScrollableTracksViewportWidth() method with example
  10. Java InetSocketAddress getHostName() method with example
  11. Java PreparedStatement getMetaData() method with example
  12. Java StringMonitor getNotifyDiffer() method with example
  13. Java – AWTException Exception
  14. Java TrayIcon removeMouseMotionListener() method with example
  15. Java RenderingHints.Key equals() method with example

Be the first to comment