public static void setSessionTicketKeys ( long ctx , SessionTicketKey [ ] keys ) { if ( keys == null || keys . length == 0 ) { throw new IllegalArgumentException ( "Length of the keys should be longer than 0." ) ; } byte [ ] binaryKeys = new byte [ keys . length * SessionTicketKey . TICKET_KEY_SIZE ] ; for ( int i = 0 ; i < keys . length ; i ++ ) { SessionTicketKey key = keys [ i ] ; int dstCurPos = SessionTicketKey . TICKET_KEY_SIZE * i ; System . arraycopy ( key . name , 0 , binaryKeys , dstCurPos , SessionTicketKey . NAME_SIZE ) ; dstCurPos += SessionTicketKey . NAME_SIZE ; System . arraycopy ( key . hmacKey , 0 , binaryKeys , dstCurPos , SessionTicketKey . HMAC_KEY_SIZE ) ; dstCurPos += SessionTicketKey . HMAC_KEY_SIZE ; System . arraycopy ( key . aesKey , 0 , binaryKeys , dstCurPos , SessionTicketKey . AES_KEY_SIZE ) ; } setSessionTicketKeys0 ( ctx , binaryKeys ) ; }
Set TLS session ticket keys .