void setKeyMaterialServerSide(ReferenceCountedOpenSslEngine engine) throws SSLException { long ssl = engine.sslPointer(); String[] authMethods = SSL.authenticationMethods(ssl); Set<String> aliases = new HashSet<String>(authMethods.length); for (String authMethod : authMethods) { String type = KEY_TYPES.get(authMethod); if (type != null) { String alias = chooseServerAlias(engine, type); if (alias != null && aliases.add(alias)) { setKeyMaterial(engine, alias); } } } }
void setKeyMaterialServerSide(ReferenceCountedOpenSslEngine engine) throws SSLException { long ssl = engine.sslPointer(); String[] authMethods = SSL.authenticationMethods(ssl); Set<String> aliases = new HashSet<String>(authMethods.length); for (String authMethod : authMethods) { String type = KEY_TYPES.get(authMethod); if (type != null) { String alias = chooseServerAlias(engine, type); if (alias != null && aliases.add(alias)) { OpenSslKeyMaterial keyMaterial = null; try { keyMaterial = provider.chooseKeyMaterial(engine.alloc, alias); if (keyMaterial != null) { SSL.setKeyMaterialServerSide( ssl, keyMaterial.certificateChainAddress(), keyMaterial.privateKeyAddress()); } } catch (SSLException e) { throw e; } catch (Exception e) { throw new SSLException(e); } finally { if (keyMaterial != null) { keyMaterial.release(); } } } } } }
void setKeyMaterialServerSide(ReferenceCountedOpenSslEngine engine) throws SSLException { long ssl = engine.sslPointer(); String[] authMethods = SSL.authenticationMethods(ssl); Set<String> aliases = new HashSet<String>(authMethods.length); for (String authMethod : authMethods) { String type = KEY_TYPES.get(authMethod); if (type != null) { String alias = chooseServerAlias(engine, type); if (alias != null && aliases.add(alias)) { setKeyMaterial(engine, alias); } } } }
void setKeyMaterial(ReferenceCountedOpenSslEngine engine) throws SSLException { long ssl = engine.sslPointer(); String[] authMethods = SSL.authenticationMethods(ssl); Set<String> aliases = new HashSet<String>(authMethods.length); for (String authMethod : authMethods) { String type = KEY_TYPES.get(authMethod); if (type != null) { String alias = chooseServerAlias(engine, type); if (alias != null && aliases.add(alias)) { setKeyMaterial(ssl, alias); } } } }
void setKeyMaterial(ReferenceCountedOpenSslEngine engine) throws SSLException { long ssl = engine.sslPointer(); String[] authMethods = SSL.authenticationMethods(ssl); Set<String> aliases = new HashSet<String>(authMethods.length); for (String authMethod : authMethods) { String type = KEY_TYPES.get(authMethod); if (type != null) { String alias = chooseServerAlias(engine, type); if (alias != null && aliases.add(alias)) { setKeyMaterial(ssl, alias); } } } }
void setKeyMaterialServerSide(ReferenceCountedOpenSslEngine engine) throws SSLException { long ssl = engine.sslPointer(); String[] authMethods = SSL.authenticationMethods(ssl); Set<String> aliases = new HashSet<String>(authMethods.length); for (String authMethod : authMethods) { String type = KEY_TYPES.get(authMethod); if (type != null) { String alias = chooseServerAlias(engine, type); if (alias != null && aliases.add(alias)) { OpenSslKeyMaterial keyMaterial = null; try { keyMaterial = provider.chooseKeyMaterial(engine.alloc, alias); if (keyMaterial != null) { SSL.setKeyMaterialServerSide( ssl, keyMaterial.certificateChainAddress(), keyMaterial.privateKeyAddress()); } } catch (SSLException e) { throw e; } catch (Exception e) { throw new SSLException(e); } finally { if (keyMaterial != null) { keyMaterial.release(); } } } } } }