/* * 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.jsse;
/** * JSSESupport. * * Concrete implementation class for JSSE Support classes. * * @author EKR * @author Craig R. McClanahan * Parts cribbed from JSSECertCompat * Parts cribbed from CertificatesValve
*/ publicclass JSSESupport implements SSLSupport, SSLSessionManager {
privatestaticfinal StringManager sm = StringManager.getManager(JSSESupport.class);
privatestaticfinal Map<String,Integer> keySizeCache = new HashMap<>();
static { for (Cipher cipher : Cipher.values()) { for (String jsseName : cipher.getJsseNames()) {
keySizeCache.put(jsseName, Integer.valueOf(cipher.getStrength_bits()));
}
}
}
/* * NO-OP method provided to make it easy for other classes in this package * to trigger the loading of this class and the population of the * keySizeCache.
*/ staticvoid init() { // NO-OP
}
@Override public String getCipherSuite() throws IOException { // Look up the current SSLSession if (session == null) { returnnull;
} return session.getCipherSuite();
}
@Override public X509Certificate[] getLocalCertificateChain() { if (session == null) { returnnull;
} return convertCertificates(session.getLocalCertificates());
}
@Override public X509Certificate[] getPeerCertificateChain() throws IOException { // Look up the current SSLSession if (session == null) { returnnull;
}
/** * {@inheritDoc} * <p> * This returns the effective bits for the current cipher suite.
*/
@Override public Integer getKeySize() throws IOException { // Look up the current SSLSession if (session == null) { returnnull;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.