• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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(status = libcore.api.CorePlatformApi.Status.STABLE)
35 public interface SSLClientSessionCache {
36     /**
37      * Gets data from a pre-existing session for a given server host and port.
38      *
39      * @param host from {@link javax.net.ssl.SSLSession#getPeerHost()}
40      * @param port from {@link javax.net.ssl.SSLSession#getPeerPort()}
41      * @return the session data or null if none is cached
42      * @throws NullPointerException if host is null
43      */
getSessionData(String host, int port)44     byte[] getSessionData(String host, int port);
45 
46     /**
47      * Stores session data for the given session.
48      *
49      * @param session to cache data for
50      * @param sessionData to cache
51      * @throws NullPointerException if session, result of
52      *  {@code session.getPeerHost()} or data is null
53      */
putSessionData(SSLSession session, byte[] sessionData)54     void putSessionData(SSLSession session, byte[] sessionData);
55 }
56