// 
// Decompiled by Procyon v0.6.0
// 

package io.netty.handler.codec.quic;

import java.util.Arrays;

public final class SslSessionTicketKey
{
    public static final int NAME_SIZE = 16;
    public static final int HMAC_KEY_SIZE = 16;
    public static final int AES_KEY_SIZE = 16;
    public static final int TICKET_KEY_SIZE = 48;
    final byte[] name;
    final byte[] hmacKey;
    final byte[] aesKey;
    
    public SslSessionTicketKey(final byte[] name, final byte[] hmacKey, final byte[] aesKey) {
        if (name == null || name.length != 16) {
            throw new IllegalArgumentException("Length of name must be 16");
        }
        if (hmacKey == null || hmacKey.length != 16) {
            throw new IllegalArgumentException("Length of hmacKey must be 16");
        }
        if (aesKey == null || aesKey.length != 16) {
            throw new IllegalArgumentException("Length of aesKey must be 16");
        }
        this.name = name.clone();
        this.hmacKey = hmacKey.clone();
        this.aesKey = aesKey.clone();
    }
    
    public byte[] name() {
        return this.name.clone();
    }
    
    public byte[] hmacKey() {
        return this.hmacKey.clone();
    }
    
    public byte[] aesKey() {
        return this.aesKey.clone();
    }
    
    @Override
    public boolean equals(final Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || this.getClass() != o.getClass()) {
            return false;
        }
        final SslSessionTicketKey that = (SslSessionTicketKey)o;
        return Arrays.equals(this.name, that.name) && Arrays.equals(this.hmacKey, that.hmacKey) && Arrays.equals(this.aesKey, that.aesKey);
    }
    
    @Override
    public int hashCode() {
        int result = Arrays.hashCode(this.name);
        result = 31 * result + Arrays.hashCode(this.hmacKey);
        result = 31 * result + Arrays.hashCode(this.aesKey);
        return result;
    }
    
    @Override
    public String toString() {
        return "SessionTicketKey{name=" + Arrays.toString(this.name) + ", hmacKey=" + Arrays.toString(this.hmacKey) + ", aesKey=" + Arrays.toString(this.aesKey) + '}';
    }
}
