ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/util/net/SSLContextWrapper.java

Path
ttomcat-1778514358873.zip-extract/apache-tomcat-11.0.18-src/java/org/apache/tomcat/util/net/SSLContextWrapper.java
Status
scanned
Type
file
Name
SSLContextWrapper.java
Extension
.java
Programming language
Java
Mime type
text/plain
File type
ASCII text, with CRLF line terminators
Tag

      
    
Rootfs path

      
    
Size
2965 (2.9 KB)
MD5
bd211d0413eaf2bbd6672186e4b14e26
SHA1
7cc66c0c5f5e76461e338aa40defad43f86a1607
SHA256
6aef4f10c4db2c2a3eb579f00a00795ab4ae442313fa71232f14a71a9cce1a56
SHA512

      
    
SHA1_git
dbc7404eaf1812dd7fb6c8ee872c44bec7fdc909
Is binary

      
    
Is text
True
Is archive

      
    
Is media

      
    
Is legal

      
    
Is manifest

      
    
Is readme

      
    
Is top level

      
    
Is key file

      
    
SSLContextWrapper.java | 2.9 KB |

/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.tomcat.util.net; import java.security.SecureRandom; import java.security.cert.X509Certificate; import java.util.Objects; import javax.net.ssl.KeyManager; import javax.net.ssl.SSLEngine; import javax.net.ssl.SSLParameters; import javax.net.ssl.SSLServerSocketFactory; import javax.net.ssl.SSLSessionContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509KeyManager; import javax.net.ssl.X509TrustManager; /** * Wrapper class to simplify using a pre-configured {@code javax.net.ssl.SSLContext} instance with an * {@code SSLHostConfigCertificate}. */ class SSLContextWrapper implements SSLContext { private final javax.net.ssl.SSLContext sslContext; private final X509KeyManager keyManager; private final X509TrustManager trustManager; SSLContextWrapper(javax.net.ssl.SSLContext sslContext, X509KeyManager keyManager, X509TrustManager trustManager) { this.sslContext = Objects.requireNonNull(sslContext); this.keyManager = Objects.requireNonNull(keyManager); this.trustManager = Objects.requireNonNull(trustManager); } @Override public void init(KeyManager[] kms, TrustManager[] tms, SecureRandom sr) { // NO-OP as it is already initialized } @Override public void destroy() { } @Override public SSLSessionContext getServerSessionContext() { return sslContext.getServerSessionContext(); } @Override public SSLEngine createSSLEngine() { return sslContext.createSSLEngine(); } @Override public SSLServerSocketFactory getServerSocketFactory() { return sslContext.getServerSocketFactory(); } @Override public SSLParameters getSupportedSSLParameters() { return sslContext.getSupportedSSLParameters(); } @Override public X509Certificate[] getCertificateChain(String alias) { return keyManager.getCertificateChain(alias); } @Override public X509Certificate[] getAcceptedIssuers() { return trustManager.getAcceptedIssuers(); } }
Detected license expression
apache-2.0
Detected license expression (SPDX)
Apache-2.0
Percentage of license text
39.4
Copyrights

      
    
Holders

      
    
Authors

      
    
License detections License expression License expression SPDX
apache_2_0-4bde3f57-78aa-4201-96bf-531cba09e7de apache-2.0 Apache-2.0
URL Start line End line
http://www.apache.org/licenses/LICENSE-2.0 9 9