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 ButtonModel isPressed() method with example
  2. Java KeyEvent paramString() method with example
  3. Java – PosixFilePermission Enum
  4. Java MinguoDate plus() method with example 1
  5. Java – CompoundName Class
  6. Java BasicMenuBarUI uninstallKeyboardActions() method with example
  7. Java StringContent getPositionsInRange() method with example
  8. Java LocalDate lengthOfYear() method with example
  9. Java MetalLookAndFeel isSupportedLookAndFeel() method with example
  10. Java MessageDigest digest() method with example
  11. Java StreamResult setSystemId() method with example
  12. Java BasicSliderUI getTickLength() method with example
  13. Java CustomMarshal marshal() method with example
  14. Java ImageReader reset() method with example
  15. Java RMIConnectionImpl setAttribute() method with example

Be the first to comment

Leave a Reply