@Deprecated @Internal public class DuckTypedPSKKeyManager extends Object implements PSKKeyManager
PSKKeyManager adaptor for objects which expose all the methods of the
PSKKeyManager interface but do not implement the interface.
This is expected to be useful on platforms where there are multiple instances of the
PSKKeyManager interface.
Visible for testing only.
MAX_IDENTITY_HINT_LENGTH_BYTES, MAX_IDENTITY_LENGTH_BYTES, MAX_KEY_LENGTH_BYTES| Modifier and Type | Method and Description |
|---|---|
String |
chooseClientKeyIdentity(String identityHint,
Socket socket)
Deprecated.
Gets the PSK identity to report to the server to help agree on the PSK for the provided
socket.
|
String |
chooseClientKeyIdentity(String identityHint,
SSLEngine engine)
Deprecated.
Gets the PSK identity to report to the server to help agree on the PSK for the provided
engine.
|
String |
chooseServerKeyIdentityHint(Socket socket)
Deprecated.
Gets the PSK identity hint to report to the client to help agree on the PSK for the provided
socket.
|
String |
chooseServerKeyIdentityHint(SSLEngine engine)
Deprecated.
Gets the PSK identity hint to report to the client to help agree on the PSK for the provided
engine.
|
static DuckTypedPSKKeyManager |
getInstance(Object obj)
Deprecated.
Gets an instance of
DuckTypedPSKKeyManager which delegates all invocations of methods
of the PSKKeyManager interface to the same methods of the provided object. |
SecretKey |
getKey(String identityHint,
String identity,
Socket socket)
Deprecated.
Gets the PSK to use for the provided socket.
|
SecretKey |
getKey(String identityHint,
String identity,
SSLEngine engine)
Deprecated.
Gets the PSK to use for the provided engine.
|
public static DuckTypedPSKKeyManager getInstance(Object obj) throws NoSuchMethodException
DuckTypedPSKKeyManager which delegates all invocations of methods
of the PSKKeyManager interface to the same methods of the provided object.NoSuchMethodException - if obj does not implement a method of the
PSKKeyManager interface.public String chooseServerKeyIdentityHint(Socket socket)
PSKKeyManagerchooseServerKeyIdentityHint in interface PSKKeyManagernull to provide no hint.public String chooseServerKeyIdentityHint(SSLEngine engine)
PSKKeyManagerchooseServerKeyIdentityHint in interface PSKKeyManagernull to provide no hint.public String chooseClientKeyIdentity(String identityHint, Socket socket)
PSKKeyManagerchooseClientKeyIdentity in interface PSKKeyManageridentityHint - identity hint provided by the server or null if none provided.null is permitted but will be
converted into an empty string.public String chooseClientKeyIdentity(String identityHint, SSLEngine engine)
PSKKeyManagerchooseClientKeyIdentity in interface PSKKeyManageridentityHint - identity hint provided by the server or null if none provided.null is permitted but will be
converted into an empty string.public SecretKey getKey(String identityHint, String identity, Socket socket)
PSKKeyManagergetKey in interface PSKKeyManageridentityHint - identity hint provided by the server to help select the key or
null if none provided.identity - identity provided by the client to help select the key.null to signal to peer that no suitable key is available and to abort
the handshake.public SecretKey getKey(String identityHint, String identity, SSLEngine engine)
PSKKeyManagergetKey in interface PSKKeyManageridentityHint - identity hint provided by the server to help select the key or
null if none provided.identity - identity provided by the client to help select the key.null to signal to peer that no suitable key is available and to abort
the handshake.