Package org.freedesktop.dbus.connections
Class SASL
- java.lang.Object
-
- org.freedesktop.dbus.connections.SASL
-
public class SASL extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SASL.Command
static class
SASL.SaslMode
-
Field Summary
Fields Modifier and Type Field Description static int
AUTH_ANON
static int
AUTH_EXTERNAL
static int
AUTH_NONE
static int
AUTH_SHA
static String
COOKIE_CONTEXT
static int
COOKIE_TIMEOUT
static int
EXPIRE_KEYS_TIMEOUT_SECONDS
static int
LOCK_TIMEOUT
static int
MAX_TIME_TRAVEL_SECONDS
static int
NEW_KEY_TIMEOUT_SECONDS
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
auth(SASL.SaslMode mode, int types, String guid, OutputStream out, InputStream in, Socket us)
performs SASL auth on the given streams.org.freedesktop.dbus.connections.SASL.SaslResult
doChallenge(int _auth, SASL.Command c)
org.freedesktop.dbus.connections.SASL.SaslResult
doResponse(int _auth, String _uid, String _kernelUid, SASL.Command _c)
String[]
getTypes(int types)
boolean
isFileDescriptorSupported()
SASL.Command
receive(InputStream s)
void
send(OutputStream out, org.freedesktop.dbus.connections.SASL.SaslCommand command, String... data)
-
-
-
Field Detail
-
LOCK_TIMEOUT
public static final int LOCK_TIMEOUT
- See Also:
- Constant Field Values
-
NEW_KEY_TIMEOUT_SECONDS
public static final int NEW_KEY_TIMEOUT_SECONDS
- See Also:
- Constant Field Values
-
EXPIRE_KEYS_TIMEOUT_SECONDS
public static final int EXPIRE_KEYS_TIMEOUT_SECONDS
- See Also:
- Constant Field Values
-
MAX_TIME_TRAVEL_SECONDS
public static final int MAX_TIME_TRAVEL_SECONDS
- See Also:
- Constant Field Values
-
COOKIE_TIMEOUT
public static final int COOKIE_TIMEOUT
- See Also:
- Constant Field Values
-
COOKIE_CONTEXT
public static final String COOKIE_CONTEXT
- See Also:
- Constant Field Values
-
AUTH_NONE
public static final int AUTH_NONE
- See Also:
- Constant Field Values
-
AUTH_EXTERNAL
public static final int AUTH_EXTERNAL
- See Also:
- Constant Field Values
-
AUTH_SHA
public static final int AUTH_SHA
- See Also:
- Constant Field Values
-
AUTH_ANON
public static final int AUTH_ANON
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SASL
public SASL()
Create a new SASL auth handler. Defaults to disable file descriptor passing.
-
SASL
public SASL(boolean _hasFileDescriptorSupport)
Create a new SASL auth handler.- Parameters:
_hasFileDescriptorSupport
- true to support file descriptor passing (usually only works with UNIX_SOCKET).
-
-
Method Detail
-
receive
public SASL.Command receive(InputStream s) throws IOException
- Throws:
IOException
-
send
public void send(OutputStream out, org.freedesktop.dbus.connections.SASL.SaslCommand command, String... data) throws IOException
- Throws:
IOException
-
doChallenge
public org.freedesktop.dbus.connections.SASL.SaslResult doChallenge(int _auth, SASL.Command c) throws IOException
- Throws:
IOException
-
doResponse
public org.freedesktop.dbus.connections.SASL.SaslResult doResponse(int _auth, String _uid, String _kernelUid, SASL.Command _c)
-
getTypes
public String[] getTypes(int types)
-
auth
public boolean auth(SASL.SaslMode mode, int types, String guid, OutputStream out, InputStream in, Socket us) throws IOException
performs SASL auth on the given streams. Mode selects whether to run as a SASL server or client. Types is a bitmask of the available auth types.- Parameters:
mode
- modetypes
- typesguid
- guidout
- outin
- inus
- us- Returns:
- true if the auth was successful and false if it failed.
- Throws:
IOException
- on failure
-
isFileDescriptorSupported
public boolean isFileDescriptorSupported()
-
-