- java.lang.Object
-
- javax.net.ssl.SSLEngineResult
-
public class SSLEngineResult extends Object
An encapsulation of the result state produced bySSLEngine
I/O calls.A
SSLEngine
provides a means for establishing secure communication sessions between two peers.SSLEngine
operations typically consume bytes from an input buffer and produce bytes in an output buffer. This class provides operational result values describing the state of theSSLEngine
, including indications of what operations are needed to finish an ongoing handshake. Lastly, it reports the number of bytes consumed and produced as a result of this operation.- Since:
- 1.5
- See Also:
SSLEngine
,SSLEngine.wrap(ByteBuffer, ByteBuffer)
,SSLEngine.unwrap(ByteBuffer, ByteBuffer)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
SSLEngineResult.HandshakeStatus
AnSSLEngineResult
enum describing the current handshaking state of thisSSLEngine
.static class
SSLEngineResult.Status
AnSSLEngineResult
enum describing the overall result of theSSLEngine
operation.
-
Constructor Summary
Constructors Constructor and Description SSLEngineResult(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced)
Initializes a new instance of this class.
-
Method Summary
Methods Modifier and Type Method and Description int
bytesConsumed()
Returns the number of bytes consumed from the input buffer.int
bytesProduced()
Returns the number of bytes written to the output buffer.SSLEngineResult.HandshakeStatus
getHandshakeStatus()
Gets the handshake status of thisSSLEngine
operation.SSLEngineResult.Status
getStatus()
Gets the return value of thisSSLEngine
operation.String
toString()
Returns a String representation of this object.
-
-
-
Constructor Detail
-
SSLEngineResult
public SSLEngineResult(SSLEngineResult.Status status, SSLEngineResult.HandshakeStatus handshakeStatus, int bytesConsumed, int bytesProduced)
Initializes a new instance of this class.- Parameters:
status
- the return value of the operation.handshakeStatus
- the current handshaking status.bytesConsumed
- the number of bytes consumed from the source ByteBufferbytesProduced
- the number of bytes placed into the destination ByteBuffer- Throws:
IllegalArgumentException
- if thestatus
orhandshakeStatus
arguments are null, or if <bytesConsumed
orbytesProduced
is negative.
-
-
Method Detail
-
getStatus
public final SSLEngineResult.Status getStatus()
Gets the return value of thisSSLEngine
operation.- Returns:
- the return value
-
getHandshakeStatus
public final SSLEngineResult.HandshakeStatus getHandshakeStatus()
Gets the handshake status of thisSSLEngine
operation.- Returns:
- the handshake status
-
bytesConsumed
public final int bytesConsumed()
Returns the number of bytes consumed from the input buffer.- Returns:
- the number of bytes consumed.
-
bytesProduced
public final int bytesProduced()
Returns the number of bytes written to the output buffer.- Returns:
- the number of bytes produced
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/net/ssl/SSLEngineResult.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.