1 /* GENERATED SOURCE. DO NOT MODIFY. */ 2 /* 3 * Copyright (C) 2009 The Android Open Source Project 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 package com.android.org.conscrypt; 19 20 import javax.net.ssl.SSLSession; 21 22 /** 23 * A persistent {@link javax.net.ssl.SSLSession} cache used by 24 * {@link javax.net.ssl.SSLSessionContext} to share client-side SSL sessions 25 * across processes. For example, this cache enables applications to 26 * persist and reuse sessions across restarts. 27 * 28 * <p>The {@code SSLSessionContext} implementation converts 29 * {@code SSLSession}s into raw bytes and vice versa. The exact makeup of the 30 * session data is dependent upon the caller's implementation and is opaque to 31 * the {@code SSLClientSessionCache} implementation. 32 * @hide This class is not part of the Android public SDK API 33 */ 34 @libcore.api.CorePlatformApi 35 @Internal 36 public interface SSLClientSessionCache { 37 /** 38 * Gets data from a pre-existing session for a given server host and port. 39 * 40 * @param host from {@link javax.net.ssl.SSLSession#getPeerHost()} 41 * @param port from {@link javax.net.ssl.SSLSession#getPeerPort()} 42 * @return the session data or null if none is cached 43 * @throws NullPointerException if host is null 44 */ getSessionData(String host, int port)45 byte[] getSessionData(String host, int port); 46 47 /** 48 * Stores session data for the given session. 49 * 50 * @param session to cache data for 51 * @param sessionData to cache 52 * @throws NullPointerException if session, result of 53 * {@code session.getPeerHost()} or data is null 54 */ putSessionData(SSLSession session, byte[] sessionData)55 void putSessionData(SSLSession session, byte[] sessionData); 56 }