Home / Function/ Signature() — netty Function Reference

Signature() — netty Function Reference

Architecture documentation for the Signature() function in JdkDelegatingPrivateKeyMethod.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  339c1277_dcf2_7681_429a_f03a7cf5bfe8["Signature()"]
  2c92da02_7d89_acb4_f8d8_102366ec64e7["JdkDelegatingPrivateKeyMethod"]
  339c1277_dcf2_7681_429a_f03a7cf5bfe8 -->|defined in| 2c92da02_7d89_acb4_f8d8_102366ec64e7
  11620690_a7bc_1191_c393_c3ca19b17cda["CacheKey()"]
  339c1277_dcf2_7681_429a_f03a7cf5bfe8 -->|calls| 11620690_a7bc_1191_c393_c3ca19b17cda
  a4801e64_db66_2026_c781_2c5880096719["configureOpenSslAlgorithmParameters()"]
  339c1277_dcf2_7681_429a_f03a7cf5bfe8 -->|calls| a4801e64_db66_2026_c781_2c5880096719
  style 339c1277_dcf2_7681_429a_f03a7cf5bfe8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/JdkDelegatingPrivateKeyMethod.java lines 110–152

    private Signature createSignature(int opensslAlgorithm)
            throws NoSuchAlgorithmException {
        String jdkAlgorithm = SSL_TO_JDK_SIGNATURE_ALGORITHM.get(opensslAlgorithm);
        if (jdkAlgorithm == null) {
            String errorMsg = "Unsupported signature algorithm: " + opensslAlgorithm;
            throw new NoSuchAlgorithmException(errorMsg);
        }

        CacheKey cacheKey = new CacheKey(jdkAlgorithm, privateKeyTypeName);

        // Try cached provider first
        String cachedProviderName = PROVIDER_CACHE.get(cacheKey);
        if (cachedProviderName != null) {
            try {
                Signature signature = Signature.getInstance(jdkAlgorithm, cachedProviderName);
                configureOpenSslAlgorithmParameters(signature, opensslAlgorithm);
                signature.initSign(privateKey);
                if (logger.isDebugEnabled()) {
                    logger.debug("Using cached provider {} for OpenSSL algorithm {} ({}) with key type {}",
                            cachedProviderName, opensslAlgorithm, jdkAlgorithm, privateKeyTypeName);
                }
                return signature;
            } catch (Exception e) {
                // Cache is stale, remove it and try full discovery
                PROVIDER_CACHE.remove(cacheKey);
                if (logger.isDebugEnabled()) {
                    logger.debug("Cached provider {} failed for key type {}, removing from cache: {}",
                            cachedProviderName, privateKeyTypeName, e.getMessage());
                }
            }
        }

        // Do full discovery and cache result
        Signature signature = findCompatibleSignature(opensslAlgorithm, jdkAlgorithm);
        PROVIDER_CACHE.put(cacheKey, signature.getProvider().getName());

        if (logger.isDebugEnabled()) {
            logger.debug("Discovered and cached provider {} for OpenSSL algorithm {} ({}) with key type {}",
                    signature.getProvider().getName(), opensslAlgorithm, jdkAlgorithm, privateKeyTypeName);
        }

        return signature;
    }

Domain

Subdomains

Frequently Asked Questions

What does Signature() do?
Signature() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/JdkDelegatingPrivateKeyMethod.java.
Where is Signature() defined?
Signature() is defined in handler/src/main/java/io/netty/handler/ssl/JdkDelegatingPrivateKeyMethod.java at line 110.
What does Signature() call?
Signature() calls 2 function(s): CacheKey, configureOpenSslAlgorithmParameters.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free