SSLEngine 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 the SSLEngine, 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.
SSLEngine, SSLEngine#wrap(ByteBuffer, ByteBuffer), SSLEngine#unwrap(ByteBuffer, ByteBuffer)
| Modifier and Type | Class and Description |
|---|---|
| public static enum | SSLEngineResult.
An |
| public static enum | SSLEngineResult.
An |
| Modifier and Type | Field and Description |
|---|---|
| private final int | |
| private final int | |
| private final SSLEngineResult. | |
| private final long | |
| private final SSLEngineResult. |
| Access | Constructor and Description |
|---|---|
| public | SSLEngineResult(SSLEngineResult.
the return value of the operation. status,the current handshaking status. handshakeStatus,the number of bytes consumed from the source ByteBuffer bytesConsumed, int the number of bytes placed into the destination ByteBuffer bytesProduced)Initializes a new instance of this class. |
| public | SSLEngineResult(SSLEngineResult.
the return value of the operation. status,the current handshaking status. handshakeStatus,the number of bytes consumed from the source ByteBuffer bytesConsumed, int the number of bytes placed into the destination ByteBuffer bytesProduced, long the sequence number (unsigned long) of the produced or
consumed SSL/TLS/DTLS record, or sequenceNumber)-1L if no record
produced or consumedInitializes a new instance of this class. |
| Modifier and Type | Method and Description |
|---|---|
| public final int | Returns: the number of bytes consumed.Returns the number of bytes consumed from the input buffer. |
| public final int | Returns: the number of bytes producedReturns the number of bytes written to the output buffer. |
| public final SSLEngineResult. | Returns: the handshake statusGets the handshake status of this |
| public final SSLEngineResult. | |
| public final long | Returns: the sequence number of the produced or consumed SSL/TLS/DTLS record; or-1L if no record is produced or consumed,
or this operation is not supported by the underlying providerReturns the sequence number of the produced or consumed SSL/TLS/DTLS record (optional operation). |
| public String |
| bytesConsumed | back to summary |
|---|---|
| private final int bytesConsumed | |
| bytesProduced | back to summary |
|---|---|
| private final int bytesProduced | |
| handshakeStatus | back to summary |
|---|---|
| private final SSLEngineResult. | |
| sequenceNumber | back to summary |
|---|---|
| private final long sequenceNumber | |
| status | back to summary |
|---|---|
| private final SSLEngineResult. | |
| SSLEngineResult | back to summary |
|---|---|
| public SSLEngineResult(SSLEngineResult. Initializes a new instance of this class.
| |
| SSLEngineResult | back to summary |
|---|---|
| public SSLEngineResult(SSLEngineResult. Initializes a new instance of this class.
| |
| bytesConsumed | back to summary |
|---|---|
| public final int bytesConsumed() Returns the number of bytes consumed from the input buffer.
| |
| bytesProduced | back to summary |
|---|---|
| public final int bytesProduced() Returns the number of bytes written to the output buffer.
| |
| getHandshakeStatus | back to summary |
|---|---|
| public final SSLEngineResult. Gets the handshake status of this
| |
| getStatus | back to summary |
|---|---|
| public final SSLEngineResult. Gets the return value of this
| |
| sequenceNumber | back to summary |
|---|---|
| public final long sequenceNumber() Returns the sequence number of the produced or consumed SSL/TLS/DTLS record (optional operation). API Note Note that sequence number is an unsigned long and cannot
exceed For DTLS protocols, the first 16 bits of the sequence number is a counter value (epoch) that is incremented on every cipher state change. The remaining 48 bits on the right side of the sequence number represents the sequence of the record, which is maintained separately for each epoch. Implementation Note It is recommended that providers should never allow the
sequence number incremented to
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a String representation of this object.
| |
SSLEngineResult enum describing the current
handshaking state of this SSLEngine.
| Modifier and Type | Field and Description |
|---|---|
| public static final SSLEngineResult. | FINISHED
The |
| public static final SSLEngineResult. | NEED_TASK
The |
| public static final SSLEngineResult. | NEED_UNWRAP
The |
| public static final SSLEngineResult. | NEED_UNWRAP_AGAIN
The |
| public static final SSLEngineResult. | NEED_WRAP
The |
| public static final SSLEngineResult. | NOT_HANDSHAKING
The |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static SSLEngineResult. | |
| public static SSLEngineResult. |
| FINISHED | back to summary |
|---|---|
| public static final SSLEngineResult. The
This value is only generated by a call to
| |
| NEED_TASK | back to summary |
|---|---|
| public static final SSLEngineResult. The
| |
| NEED_UNWRAP | back to summary |
|---|---|
| public static final SSLEngineResult. The | |
| NEED_UNWRAP_AGAIN | back to summary |
|---|---|
| public static final SSLEngineResult. The This value is used to indicate that not-yet-interpreted data has been previously received from the remote side, and does not need to be received again. This handshake status only applies to DTLS.
| |
| NEED_WRAP | back to summary |
|---|---|
| public static final SSLEngineResult. The | |
| NOT_HANDSHAKING | back to summary |
|---|---|
| public static final SSLEngineResult. The | |
| HandshakeStatus | back to summary |
|---|---|
| private HandshakeStatus() | |
| valueOf | back to summary |
|---|---|
| public static SSLEngineResult. | |
| values | back to summary |
|---|---|
| public static SSLEngineResult. | |
SSLEngineResult enum describing the overall result
of the SSLEngine operation.
The Status value does not reflect the
state of a SSLEngine handshake currently
in progress. The SSLEngineResult's HandshakeStatus
should be consulted for that information.
| Modifier and Type | Field and Description |
|---|---|
| public static final SSLEngineResult. | BUFFER_OVERFLOW
The |
| public static final SSLEngineResult. | BUFFER_UNDERFLOW
The |
| public static final SSLEngineResult. | CLOSED
The operation just closed this side of the
|
| public static final SSLEngineResult. | OK
The |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static SSLEngineResult. | |
| public static SSLEngineResult. |
| BUFFER_OVERFLOW | back to summary |
|---|---|
| public static final SSLEngineResult. The Repeat the call once more bytes are available. | |
| BUFFER_UNDERFLOW | back to summary |
|---|---|
| public static final SSLEngineResult. The Repeat the call once more bytes are available. | |
| CLOSED | back to summary |
|---|---|
| public static final SSLEngineResult. The operation just closed this side of the
| |
| OK | back to summary |
|---|---|
| public static final SSLEngineResult. The | |
| Status | back to summary |
|---|---|
| private Status() | |
| valueOf | back to summary |
|---|---|
| public static SSLEngineResult. | |
| values | back to summary |
|---|---|
| public static SSLEngineResult. | |