public abstract class SaslWrapper extends Object
Constructor and Description |
---|
SaslWrapper() |
Modifier and Type | Method and Description |
---|---|
static SaslWrapper |
create(SaslClient saslClient)
Create a SASL wrapper for a SASL client.
|
static SaslWrapper |
create(SaslServer saslServer)
Create a SASL wrapper for a SASL server.
|
byte[] |
unwrap(byte[] bytes)
Unwrap a message.
|
abstract byte[] |
unwrap(byte[] bytes,
int off,
int len)
Unwrap a message.
|
abstract byte[] |
unwrap(ByteBuffer source)
Unwrap a message.
|
void |
unwrap(ByteBuffer destination,
ByteBuffer source)
Unwrap a message.
|
byte[] |
wrap(byte[] bytes)
Wrap a message.
|
abstract byte[] |
wrap(byte[] bytes,
int off,
int len)
Wrap a message.
|
abstract byte[] |
wrap(ByteBuffer source)
Wrap a message.
|
void |
wrap(ByteBuffer destination,
ByteBuffer source)
Wrap a message.
|
public abstract byte[] wrap(byte[] bytes, int off, int len) throws SaslException
bytes
- the incoming messageoff
- the offset into the byte arraylen
- the length of the byte array to wrapSaslException
- if a problem occurspublic final byte[] wrap(byte[] bytes) throws SaslException
bytes
- the incoming messageSaslException
- if a problem occurspublic abstract byte[] wrap(ByteBuffer source) throws SaslException
source
- the buffer from which bytes should be readSaslException
- if a problem occurspublic abstract byte[] unwrap(byte[] bytes, int off, int len) throws SaslException
bytes
- the incoming messageoff
- the offset into the byte arraylen
- the length of the byte array to wrapSaslException
- if a problem occurspublic final byte[] unwrap(byte[] bytes) throws SaslException
bytes
- the incoming messageSaslException
- if a problem occurspublic abstract byte[] unwrap(ByteBuffer source) throws SaslException
source
- the buffer from which bytes should be readSaslException
- if a problem occurspublic final void wrap(ByteBuffer destination, ByteBuffer source) throws SaslException
source
buffer should have its position and remaining length set to encompass exactly one SASL message
(without the length field). The SASL message itself does not encode any length information so it is up to the
protocol implementer to ensure that the message is properly framed.destination
- the buffer into which bytes should be writtensource
- the buffers from which bytes should be readSaslException
- if a SASL error occursSaslClient.wrap(byte[], int, int)
,
SaslServer.wrap(byte[], int, int)
public final void unwrap(ByteBuffer destination, ByteBuffer source) throws SaslException
The source
buffer should have its position and remaining length set to encompass exactly one SASL
message (without the length field). The SASL message itself does not encode any length information so it is up
to the protocol implementer to ensure that the message is properly framed.
destination
- the buffer into which bytes should be writtensource
- the buffers from which bytes should be readSaslException
- if a SASL error occursSaslClient.unwrap(byte[], int, int)
public static SaslWrapper create(SaslClient saslClient)
saslClient
- the SASL clientpublic static SaslWrapper create(SaslServer saslServer)
saslServer
- the SASL serverCopyright © 2020 JBoss by Red Hat. All rights reserved.