public void putValue(String s, Object o) { unwrap().putValue(s, o); }
@Override public String select(List<String> strings) { ALPN.remove(engine); for (String p : protocols) { if (strings.contains(p)) { engine.getHandshakeSession().putValue(PROTOCOL_KEY, p); return p; } } return null; } });
@Override public void selected(String s) { ALPN.remove(sslEngine); selected = s; sslEngine.getHandshakeSession().putValue(PROTOCOL_KEY, selected); } }
/** * Replace the given key's value with a new value. If there is no value for the given key, no action is performed. * This method is atomic with respect to other methods on this class. * * @param sslSession the SSL session (must not be {@code null}) * @param key the key to retrieve (must not be {@code null}) * @param newValue the value to set (must not be {@code null}) * @return the existing value, or {@code null} if the value was not set */ public static Object replaceSessionValue(SSLSession sslSession, String key, Object newValue) { Assert.checkNotNullParam("sslSession", sslSession); Assert.checkNotNullParam("key", key); Assert.checkNotNullParam("newValue", newValue); synchronized (sslSession) { final Object existing = sslSession.getValue(key); if (existing != null) sslSession.putValue(key, newValue); return existing; } }
/** * Replace the given key's value with a new value if (and only if) it is mapped to the given existing value. * This method is atomic with respect to other methods on this class. * * @param sslSession the SSL session (must not be {@code null}) * @param key the key to retrieve (must not be {@code null}) * @param oldValue the value to match (must not be {@code null}) * @param newValue the value to set (must not be {@code null}) * @return {@code true} if the value was matched and replaced, or {@code false} if the value did not match and no action was taken */ public static boolean replaceSessionValue(SSLSession sslSession, String key, Object oldValue, Object newValue) { Assert.checkNotNullParam("sslSession", sslSession); Assert.checkNotNullParam("key", key); Assert.checkNotNullParam("oldValue", oldValue); Assert.checkNotNullParam("newValue", newValue); synchronized (sslSession) { final Object existing = sslSession.getValue(key); if (Objects.equals(existing, oldValue)) { sslSession.putValue(key, newValue); return true; } else { return false; } } }
/** * Get or compute the value for the given key, storing the computed value (if one is generated). The function * must not generate a {@code null} value or an unspecified exception will result. * * @param sslSession the SSL session (must not be {@code null}) * @param key the key to retrieve (must not be {@code null}) * @param mappingFunction the function to apply to acquire the value (must not be {@code null}) * @return the stored or new value (not {@code null}) */ public static <R> R computeIfAbsent(SSLSession sslSession, String key, Function<String, R> mappingFunction) { Assert.checkNotNullParam("sslSession", sslSession); Assert.checkNotNullParam("key", key); Assert.checkNotNullParam("mappingFunction", mappingFunction); synchronized (sslSession) { final R existing = (R) sslSession.getValue(key); if (existing == null) { R newValue = mappingFunction.apply(key); Assert.assertNotNull(newValue); sslSession.putValue(key, newValue); return newValue; } else { return existing; } } } }
/** * Put a value on the session if the value is not yet set. This method is atomic with respect to other methods * on this class. * * @param sslSession the SSL session (must not be {@code null}) * @param key the key to retrieve (must not be {@code null}) * @param newValue the value to set (must not be {@code null}) * @return the existing value, or {@code null} if the value was successfully set */ public static Object putSessionValueIfAbsent(SSLSession sslSession, String key, Object newValue) { Assert.checkNotNullParam("sslSession", sslSession); Assert.checkNotNullParam("key", key); Assert.checkNotNullParam("newValue", newValue); synchronized (sslSession) { final Object existing = sslSession.getValue(key); if (existing == null) { sslSession.putValue(key, newValue); return null; } else { return existing; } } }
/** * Copied from <code>org.apache.catalina.valves.CertificateValve</code> */ public Integer getKeySize() throws IOException { // Look up the current SSLSession /* SJSAS 6439313 SSLSession session = ssl.getSession(); */ SSLSupport.CipherData c_aux[]=ciphers; if (session == null) return null; Integer keySize = (Integer) session.getValue(KEY_SIZE_KEY); if (keySize == null) { int size = 0; String cipherSuite = session.getCipherSuite(); for (int i = 0; i < c_aux.length; i++) { if (cipherSuite.indexOf(c_aux[i].phrase) >= 0) { size = c_aux[i].keySize; break; } } keySize = size; session.putValue(KEY_SIZE_KEY, keySize); } return keySize; }
authenticationContext.succeed(); if (handshakeSession != null) { handshakeSession.putValue(SSLUtils.SSL_SESSION_IDENTITY_KEY, authenticationContext.getAuthorizedIdentity());
session.putValue(SNI_X509,x509); return a;
@Override public void putValue(String s, Object o) { delegate().putValue(s, o); }
@Override public void putValue(String s, Object o) { unwrap().putValue(s, o); }
@Override public void putValue(String s, Object o) { unwrap().putValue(s, o); }
@Override public void putValue(String s, Object o) { unwrap().putValue(s, o); }
public void putValue(String s, Object o) { unwrap().putValue(s, o); }
public void putValue(String s, Object o) { unwrap().putValue(s, o); }
@Override public String select(List<String> strings) { ALPN.remove(engine); for (String p : protocols) { if (strings.contains(p)) { engine.getHandshakeSession().putValue(PROTOCOL_KEY, p); return p; } } return null; } });
@Override public String select(List<String> strings) { ALPN.remove(engine); for (String p : protocols) { if (strings.contains(p)) { engine.getHandshakeSession().putValue(PROTOCOL_KEY, p); return p; } } return null; } });
@Override public void selected(String s) { ALPN.remove(sslEngine); selected = s; sslEngine.getHandshakeSession().putValue(PROTOCOL_KEY, selected); } }
@Override public void selected(String s) { ALPN.remove(sslEngine); selected = s; sslEngine.getHandshakeSession().putValue(PROTOCOL_KEY, selected); } }