Package org.conscrypt

Class DuckTypedPSKKeyManager

  • All Implemented Interfaces:
    javax.net.ssl.KeyManager, PSKKeyManager

    @Deprecated
    final class DuckTypedPSKKeyManager
    extends java.lang.Object
    implements PSKKeyManager
    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.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private DuckTypedPSKKeyManager​(java.lang.Object delegate)
      Deprecated.
       
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.String chooseClientKeyIdentity​(java.lang.String identityHint, java.net.Socket socket)
      Deprecated.
      Gets the PSK identity to report to the server to help agree on the PSK for the provided socket.
      java.lang.String chooseClientKeyIdentity​(java.lang.String identityHint, javax.net.ssl.SSLEngine engine)
      Deprecated.
      Gets the PSK identity to report to the server to help agree on the PSK for the provided engine.
      java.lang.String chooseServerKeyIdentityHint​(java.net.Socket socket)
      Deprecated.
      Gets the PSK identity hint to report to the client to help agree on the PSK for the provided socket.
      java.lang.String chooseServerKeyIdentityHint​(javax.net.ssl.SSLEngine engine)
      Deprecated.
      Gets the PSK identity hint to report to the client to help agree on the PSK for the provided engine.
      (package private) static DuckTypedPSKKeyManager getInstance​(java.lang.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.
      javax.crypto.SecretKey getKey​(java.lang.String identityHint, java.lang.String identity, java.net.Socket socket)
      Deprecated.
      Gets the PSK to use for the provided socket.
      javax.crypto.SecretKey getKey​(java.lang.String identityHint, java.lang.String identity, javax.net.ssl.SSLEngine engine)
      Deprecated.
      Gets the PSK to use for the provided engine.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mDelegate

        private final java.lang.Object mDelegate
        Deprecated.
    • Constructor Detail

      • DuckTypedPSKKeyManager

        private DuckTypedPSKKeyManager​(java.lang.Object delegate)
        Deprecated.
    • Method Detail

      • getInstance

        static DuckTypedPSKKeyManager getInstance​(java.lang.Object obj)
                                           throws java.lang.NoSuchMethodException
        Deprecated.
        Gets an instance of DuckTypedPSKKeyManager which delegates all invocations of methods of the PSKKeyManager interface to the same methods of the provided object.
        Throws:
        java.lang.NoSuchMethodException - if obj does not implement a method of the PSKKeyManager interface.
      • chooseServerKeyIdentityHint

        public java.lang.String chooseServerKeyIdentityHint​(java.net.Socket socket)
        Deprecated.
        Description copied from interface: PSKKeyManager
        Gets the PSK identity hint to report to the client to help agree on the PSK for the provided socket.
        Specified by:
        chooseServerKeyIdentityHint in interface PSKKeyManager
        Returns:
        PSK identity hint to be provided to the client or null to provide no hint.
      • chooseServerKeyIdentityHint

        public java.lang.String chooseServerKeyIdentityHint​(javax.net.ssl.SSLEngine engine)
        Deprecated.
        Description copied from interface: PSKKeyManager
        Gets the PSK identity hint to report to the client to help agree on the PSK for the provided engine.
        Specified by:
        chooseServerKeyIdentityHint in interface PSKKeyManager
        Returns:
        PSK identity hint to be provided to the client or null to provide no hint.
      • chooseClientKeyIdentity

        public java.lang.String chooseClientKeyIdentity​(java.lang.String identityHint,
                                                        java.net.Socket socket)
        Deprecated.
        Description copied from interface: PSKKeyManager
        Gets the PSK identity to report to the server to help agree on the PSK for the provided socket.
        Specified by:
        chooseClientKeyIdentity in interface PSKKeyManager
        Parameters:
        identityHint - identity hint provided by the server or null if none provided.
        Returns:
        PSK identity to provide to the server. null is permitted but will be converted into an empty string.
      • chooseClientKeyIdentity

        public java.lang.String chooseClientKeyIdentity​(java.lang.String identityHint,
                                                        javax.net.ssl.SSLEngine engine)
        Deprecated.
        Description copied from interface: PSKKeyManager
        Gets the PSK identity to report to the server to help agree on the PSK for the provided engine.
        Specified by:
        chooseClientKeyIdentity in interface PSKKeyManager
        Parameters:
        identityHint - identity hint provided by the server or null if none provided.
        Returns:
        PSK identity to provide to the server. null is permitted but will be converted into an empty string.
      • getKey

        public javax.crypto.SecretKey getKey​(java.lang.String identityHint,
                                             java.lang.String identity,
                                             java.net.Socket socket)
        Deprecated.
        Description copied from interface: PSKKeyManager
        Gets the PSK to use for the provided socket.
        Specified by:
        getKey in interface PSKKeyManager
        Parameters:
        identityHint - 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.
        Returns:
        key or null to signal to peer that no suitable key is available and to abort the handshake.
      • getKey

        public javax.crypto.SecretKey getKey​(java.lang.String identityHint,
                                             java.lang.String identity,
                                             javax.net.ssl.SSLEngine engine)
        Deprecated.
        Description copied from interface: PSKKeyManager
        Gets the PSK to use for the provided engine.
        Specified by:
        getKey in interface PSKKeyManager
        Parameters:
        identityHint - 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.
        Returns:
        key or null to signal to peer that no suitable key is available and to abort the handshake.