Class PeerIdentityTrustManagerFactory

java.lang.Object
javax.net.ssl.TrustManagerFactory
io.netty.handler.ssl.util.SimpleTrustManagerFactory
pt.unl.fct.di.novasys.babel2.ssl.PeerIdentityTrustManagerFactory

public class PeerIdentityTrustManagerFactory extends io.netty.handler.ssl.util.SimpleTrustManagerFactory
TrustManagerFactory implementation that produces PeerIdentityTrustManager instances for validating Babel 2 self-signed peer certificates.
  • Constructor Details

    • PeerIdentityTrustManagerFactory

      public PeerIdentityTrustManagerFactory(PeerIdentityTrustManager trustManager)
      Constructs a factory wrapping an existing PeerIdentityTrustManager.
      Parameters:
      trustManager - the trust manager to wrap
    • PeerIdentityTrustManagerFactory

      public PeerIdentityTrustManagerFactory(Set<String> authorizedPeerIdHashes)
      Constructs a factory with a set of authorized peer ID hex hashes.
      Parameters:
      authorizedPeerIdHashes - set of authorized SHA-256 peer ID hex strings, or null to trust all valid peer identities
    • PeerIdentityTrustManagerFactory

      public PeerIdentityTrustManagerFactory()
      Constructs a factory that trusts all valid Babel 2 self-signed peer certificates.
  • Method Details

    • engineInit

      protected void engineInit(KeyStore keyStore) throws Exception
      Specified by:
      engineInit in class io.netty.handler.ssl.util.SimpleTrustManagerFactory
      Throws:
      Exception
    • engineInit

      protected void engineInit(ManagerFactoryParameters managerFactoryParameters) throws Exception
      Specified by:
      engineInit in class io.netty.handler.ssl.util.SimpleTrustManagerFactory
      Throws:
      Exception
    • engineGetTrustManagers

      protected TrustManager[] engineGetTrustManagers()
      Specified by:
      engineGetTrustManagers in class io.netty.handler.ssl.util.SimpleTrustManagerFactory