Class X509AliasKeyManager

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

    public class X509AliasKeyManager
    extends javax.net.ssl.X509ExtendedKeyManager
    An X509ExtendedKeyManager wrapper which always chooses and only returns the given alias, and defers retrieval to the delegate key manager.
    • Constructor Summary

      Constructors 
      Constructor Description
      X509AliasKeyManager​(java.lang.String alias, javax.net.ssl.X509ExtendedKeyManager delegate)
      Creates a new alias manager with the provided configuration
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String chooseClientAlias​(java.lang.String[] keyType, java.security.Principal[] issuers, java.net.Socket socket)  
      java.lang.String chooseEngineClientAlias​(java.lang.String[] keyType, java.security.Principal[] issuers, javax.net.ssl.SSLEngine engine)  
      java.lang.String chooseEngineServerAlias​(java.lang.String keyType, java.security.Principal[] issuers, javax.net.ssl.SSLEngine engine)  
      java.lang.String chooseServerAlias​(java.lang.String keyType, java.security.Principal[] issuers, java.net.Socket socket)  
      java.security.cert.X509Certificate[] getCertificateChain​(java.lang.String alias)  
      java.lang.String[] getClientAliases​(java.lang.String keyType, java.security.Principal[] issuers)  
      java.security.PrivateKey getPrivateKey​(java.lang.String alias)  
      java.lang.String[] getServerAliases​(java.lang.String keyType, java.security.Principal[] issuers)  
      • Methods inherited from class java.lang.Object

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

      • X509AliasKeyManager

        public X509AliasKeyManager​(java.lang.String alias,
                                   javax.net.ssl.X509ExtendedKeyManager delegate)
                            throws java.lang.IllegalArgumentException
        Creates a new alias manager with the provided configuration
        Parameters:
        alias - The alias value to be used.
        delegate - A delegate that will be used by this manager instance.
        Throws:
        java.lang.IllegalArgumentException - if no alias is provided for this manager.
    • Method Detail

      • chooseClientAlias

        public java.lang.String chooseClientAlias​(java.lang.String[] keyType,
                                                  java.security.Principal[] issuers,
                                                  java.net.Socket socket)
      • chooseServerAlias

        public java.lang.String chooseServerAlias​(java.lang.String keyType,
                                                  java.security.Principal[] issuers,
                                                  java.net.Socket socket)
      • getCertificateChain

        public java.security.cert.X509Certificate[] getCertificateChain​(java.lang.String alias)
      • getClientAliases

        public java.lang.String[] getClientAliases​(java.lang.String keyType,
                                                   java.security.Principal[] issuers)
      • getPrivateKey

        public java.security.PrivateKey getPrivateKey​(java.lang.String alias)
      • getServerAliases

        public java.lang.String[] getServerAliases​(java.lang.String keyType,
                                                   java.security.Principal[] issuers)
      • chooseEngineClientAlias

        public java.lang.String chooseEngineClientAlias​(java.lang.String[] keyType,
                                                        java.security.Principal[] issuers,
                                                        javax.net.ssl.SSLEngine engine)
        Overrides:
        chooseEngineClientAlias in class javax.net.ssl.X509ExtendedKeyManager
      • chooseEngineServerAlias

        public java.lang.String chooseEngineServerAlias​(java.lang.String keyType,
                                                        java.security.Principal[] issuers,
                                                        javax.net.ssl.SSLEngine engine)
        Overrides:
        chooseEngineServerAlias in class javax.net.ssl.X509ExtendedKeyManager