Home / Function/ setTicketKeys() — netty Function Reference

setTicketKeys() — netty Function Reference

Architecture documentation for the setTicketKeys() function in OpenSslSessionContext.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  168f6c87_ca42_17ae_cf76_9ec18a09b228["setTicketKeys()"]
  6761f03c_910d_c89a_256f_4472ec59d426["OpenSslSessionContext"]
  168f6c87_ca42_17ae_cf76_9ec18a09b228 -->|defined in| 6761f03c_910d_c89a_256f_4472ec59d426
  style 168f6c87_ca42_17ae_cf76_9ec18a09b228 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/OpenSslSessionContext.java lines 120–143

    @Deprecated
    public void setTicketKeys(byte[] keys) {
        if (keys.length % SessionTicketKey.TICKET_KEY_SIZE != 0) {
            throw new IllegalArgumentException("keys.length % " + SessionTicketKey.TICKET_KEY_SIZE  + " != 0");
        }
        SessionTicketKey[] tickets = new SessionTicketKey[keys.length / SessionTicketKey.TICKET_KEY_SIZE];
        for (int i = 0, a = 0; i < tickets.length; i++) {
            byte[] name = Arrays.copyOfRange(keys, a, SessionTicketKey.NAME_SIZE);
            a += SessionTicketKey.NAME_SIZE;
            byte[] hmacKey = Arrays.copyOfRange(keys, a, SessionTicketKey.HMAC_KEY_SIZE);
            i += SessionTicketKey.HMAC_KEY_SIZE;
            byte[] aesKey = Arrays.copyOfRange(keys, a, SessionTicketKey.AES_KEY_SIZE);
            a += SessionTicketKey.AES_KEY_SIZE;
            tickets[i] = new SessionTicketKey(name, hmacKey, aesKey);
        }
        Lock writerLock = context.ctxLock.writeLock();
        writerLock.lock();
        try {
            SSLContext.clearOptions(context.ctx, SSL.SSL_OP_NO_TICKET);
            SSLContext.setSessionTicketKeys(context.ctx, tickets);
        } finally {
            writerLock.unlock();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does setTicketKeys() do?
setTicketKeys() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/OpenSslSessionContext.java.
Where is setTicketKeys() defined?
setTicketKeys() is defined in handler/src/main/java/io/netty/handler/ssl/OpenSslSessionContext.java at line 120.

Analyze Your Own Codebase

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

Try Supermodel Free