Top Description Fields Constructors Methods
org.conscrypt

pack-priv final Class DuckTypedPSKKeyManager

extends Object
implements PSKKeyManager
Class Inheritance
All Implemented Interfaces
org.conscrypt.PSKKeyManager, javax.net.ssl.KeyManager
Annotations
@Deprecated
Imports
java.lang.reflect.Method, java.net.Socket, javax.crypto.SecretKey, javax.net.ssl.SSLEngine

Deprecated

This abstraction is deprecated because it does not work with TLS 1.3.

Reflection-based 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.

Field Summary

Modifier and TypeField and Description
private final Object

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
chooseClientKeyIdentity(String
identity hint provided by the server or null if none provided.
identityHint
,
Socket socket)

Implements org.conscrypt.PSKKeyManager.chooseClientKeyIdentity.

Gets the PSK identity to report to the server to help agree on the PSK for the provided socket.
public String
chooseClientKeyIdentity(String
identity hint provided by the server or null if none provided.
identityHint
,
SSLEngine engine)

Implements org.conscrypt.PSKKeyManager.chooseClientKeyIdentity.

Gets the PSK identity to report to the server to help agree on the PSK for the provided engine.
public String
chooseServerKeyIdentityHint(Socket socket)

Implements org.conscrypt.PSKKeyManager.chooseServerKeyIdentityHint.

Gets the PSK identity hint to report to the client to help agree on the PSK for the provided socket.
public String
chooseServerKeyIdentityHint(SSLEngine engine)

Implements org.conscrypt.PSKKeyManager.chooseServerKeyIdentityHint.

Gets the PSK identity hint to report to the client to help agree on the PSK for the provided engine.
pack-priv static DuckTypedPSKKeyManager
getInstance(Object obj)

Deprecated as a consequence of DuckTypedPSKKeyManager being deprecated.
Gets an instance of DuckTypedPSKKeyManager which delegates all invocations of methods of the PSKKeyManager interface to the same methods of the provided object.
public SecretKey
getKey(String
identity hint provided by the server to help select the key or null if none provided.
identityHint
,
String
identity provided by the client to help select the key.
identity
,
Socket socket)

Implements org.conscrypt.PSKKeyManager.getKey.

Gets the PSK to use for the provided socket.
public SecretKey
getKey(String
identity hint provided by the server to help select the key or null if none provided.
identityHint
,
String
identity provided by the client to help select the key.
identity
,
SSLEngine engine)

Implements org.conscrypt.PSKKeyManager.getKey.

Gets the PSK to use for the provided engine.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mDelegateback to summary
private final Object mDelegate

Constructor Detail

DuckTypedPSKKeyManagerback to summary
private DuckTypedPSKKeyManager(Object delegate)

Method Detail

chooseClientKeyIdentityback to summary
public String chooseClientKeyIdentity(String identityHint, Socket socket)

Implements org.conscrypt.PSKKeyManager.chooseClientKeyIdentity.

Doc from org.conscrypt.PSKKeyManager.chooseClientKeyIdentity.

Gets the PSK identity to report to the server to help agree on the PSK for the provided socket.

Parameters
identityHint:String

identity hint provided by the server or null if none provided.

Returns:String

PSK identity to provide to the server. null is permitted but will be converted into an empty string.

Annotations
@Override
chooseClientKeyIdentityback to summary
public String chooseClientKeyIdentity(String identityHint, SSLEngine engine)

Implements org.conscrypt.PSKKeyManager.chooseClientKeyIdentity.

Doc from org.conscrypt.PSKKeyManager.chooseClientKeyIdentity.

Gets the PSK identity to report to the server to help agree on the PSK for the provided engine.

Parameters
identityHint:String

identity hint provided by the server or null if none provided.

Returns:String

PSK identity to provide to the server. null is permitted but will be converted into an empty string.

Annotations
@Override
chooseServerKeyIdentityHintback to summary
public String chooseServerKeyIdentityHint(Socket socket)

Implements org.conscrypt.PSKKeyManager.chooseServerKeyIdentityHint.

Doc from org.conscrypt.PSKKeyManager.chooseServerKeyIdentityHint.

Gets the PSK identity hint to report to the client to help agree on the PSK for the provided socket.

Returns:String

PSK identity hint to be provided to the client or null to provide no hint.

Annotations
@Override
chooseServerKeyIdentityHintback to summary
public String chooseServerKeyIdentityHint(SSLEngine engine)

Implements org.conscrypt.PSKKeyManager.chooseServerKeyIdentityHint.

Doc from org.conscrypt.PSKKeyManager.chooseServerKeyIdentityHint.

Gets the PSK identity hint to report to the client to help agree on the PSK for the provided engine.

Returns:String

PSK identity hint to be provided to the client or null to provide no hint.

Annotations
@Override
getInstanceback to summary
pack-priv static DuckTypedPSKKeyManager getInstance(Object obj) throws NoSuchMethodException

Deprecated

as a consequence of DuckTypedPSKKeyManager being deprecated. See corresponding docs for further information.

Gets an instance of DuckTypedPSKKeyManager which delegates all invocations of methods of the PSKKeyManager interface to the same methods of the provided object.

Exceptions
NoSuchMethodException:
if obj does not implement a method of the PSKKeyManager interface.
getKeyback to summary
public SecretKey getKey(String identityHint, String identity, Socket socket)

Implements org.conscrypt.PSKKeyManager.getKey.

Doc from org.conscrypt.PSKKeyManager.getKey.

Gets the PSK to use for the provided socket.

Parameters
identityHint:String

identity hint provided by the server to help select the key or null if none provided.

identity:String

identity provided by the client to help select the key.

Returns:SecretKey

key or null to signal to peer that no suitable key is available and to abort the handshake.

Annotations
@Override
getKeyback to summary
public SecretKey getKey(String identityHint, String identity, SSLEngine engine)

Implements org.conscrypt.PSKKeyManager.getKey.

Doc from org.conscrypt.PSKKeyManager.getKey.

Gets the PSK to use for the provided engine.

Parameters
identityHint:String

identity hint provided by the server to help select the key or null if none provided.

identity:String

identity provided by the client to help select the key.

Returns:SecretKey

key or null to signal to peer that no suitable key is available and to abort the handshake.

Annotations
@Override