1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.conscrypt; 18 19 import java.security.cert.X509Certificate; 20 import java.util.List; 21 import javax.net.ssl.SSLPeerUnverifiedException; 22 import javax.net.ssl.SSLSession; 23 24 /** 25 * Extends the default interface for {@link SSLSession} to provide additional properties exposed 26 * by Conscrypt. 27 */ 28 interface ConscryptSession extends SSLSession { 29 30 String getRequestedServerName(); 31 32 /** 33 * Returns the OCSP stapled response. Returns a copy of the internal arrays. 34 * 35 * The method signature matches 36 * <a 37 * href="http://download.java.net/java/jdk9/docs/api/javax/net/ssl/ExtendedSSLSession.html#getStatusResponses--">Java 38 * 9</a>. 39 * 40 * @see <a href="https://tools.ietf.org/html/rfc6066">RFC 6066</a> 41 * @see <a href="https://tools.ietf.org/html/rfc6961">RFC 6961</a> 42 */ 43 List<byte[]> getStatusResponses(); 44 45 /** 46 * Returns the signed certificate timestamp (SCT) received from the peer. Returns a 47 * copy of the internal array. 48 * 49 * @see <a href="https://tools.ietf.org/html/rfc6962">RFC 6962</a> 50 */ 51 byte[] getPeerSignedCertificateTimestamp(); 52 53 @Override 54 X509Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException; 55 } 56