Java SaslClient unwrap() method with example

javax.security.sasl.SaslClient.unwrap() 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

Parameters:

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.

Returns:

A non-null byte array containing the decoded bytes.

Throws:

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.

javax.security.sasl.SaslClient.unwrap() method Implementation

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

SaslClient unwrap() method Example

package com.ehowtonow.javax.security.sasl.saslclient;

public class UnwrapMethodExample {

	public static void main(String[] args) {

	}

}

Output


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 – KeyRep Class
  2. Java JComboBox getPopupMenuListeners() method with example
  3. Java DocFlavor equals() method with example
  4. Java Graphics getClipBounds() method with example 1
  5. Java X509KeyManager getCertificateChain() method with example
  6. Java SAXParserFactory setXIncludeAware() method with example
  7. Java DirContext getAttributes() method with example 2
  8. Java Checkbox processEvent() method with example
  9. Java – BlockingQueue Interface
  10. Java AffineTransform createTransformedShape() method with example
  11. Java ObjectImpl equals() method with example
  12. Java Component move() method with example
  13. Java MetalIconFactory.FolderIcon16 getIconWidth() method with example 1
  14. Java BasicSplitPaneUI.FocusHandler focusGained() method with example
  15. Java MetalInternalFrameUI uninstallUI() method with example

Be the first to comment

Leave a Reply