@Override public HopsSSLCryptoMaterial check(UserGroupInformation ugi, Set<String> proxySuperUsers, Configuration configuration, CertificateLocalization certificateLocalization) throws IOException { String username = ugi.getUserName(); if (username.matches(HopsSSLSocketFactory.USERNAME_PATTERN) || !proxySuperUsers.contains(username)) { if (certificateLocalization != null) { try { String appId = ugi.getApplicationId(); if (appId == null) { throw new IOException("UserGroupInformation does NOT contain the Application ID"); } CryptoMaterial material = certificateLocalization.getMaterialLocation(username, appId); return new HopsSSLCryptoMaterial( material.getKeyStoreLocation().toString(), material.getKeyStorePass(), material.getTrustStoreLocation().toString(), material.getTrustStorePass()); } catch (InterruptedException ex) { throw new IOException(ex); } } } return null; } }
FileChannel keyStoreChannel = new FileOutputStream(event.cryptoMaterial.getKeyStoreLocation().toFile(), false) .getChannel(); keyStoreChannel.write(event.cryptoMaterial.getKeyStoreMem()); Files.setPosixFilePermissions(event.cryptoMaterial.getKeyStoreLocation(), materialPermissions); Files.setPosixFilePermissions(event.cryptoMaterial.getTrustStoreLocation(), materialPermissions); Files.setPosixFilePermissions(event.cryptoMaterial.getPasswdLocation(), materialPermissions);
CryptoMaterial cryptoMaterial = context .getCertificateLocalizationService().getMaterialLocation(applicationUser, applicationId); Path keyStoreLocation = cryptoMaterial.getKeyStoreLocation(); Path trustStoreLocation = cryptoMaterial.getTrustStoreLocation(); Path passwdLocation = cryptoMaterial.getPasswdLocation();
.getValue(), context.getCertificateLocalizationService() .getMaterialLocation(user, appId.toString()).getKeyStoreLocation().toString());