public TlsProvider build() {
        final Map<String, TlsKeyPair> keyPairMappings = tlsKeyPairsBuilder.build();
        if (keyPairMappings.isEmpty()) {
            throw new IllegalStateException("No TLS key pair is set.");
        }

        final Map<String, List<X509Certificate>> trustedCerts = x509CertificateBuilder.build();
        if (keyPairMappings.size() == 1 && keyPairMappings.containsKey("*") && trustedCerts.isEmpty()) {
            return new StaticTlsProvider(keyPairMappings.get("*"));
        }

        return new MappedTlsProvider(keyPairMappings, trustedCerts);
    }
Returns a newly-created {@link TlsProvider} instance.
core/src/main/java/com/linecorp/armeria/common/TlsProviderBuilder.java