private CredentialValue getCredentialValueForAlias(String alias) { GatewayServices services = (GatewayServices)request.getServletContext(). getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE); String clusterName = (String) request.getServletContext().getAttribute(GatewayServices.GATEWAY_CLUSTER_ATTRIBUTE); AliasService as = services.getService(GatewayServices.ALIAS_SERVICE); char[] credential = null; try { credential = as.getPasswordFromAliasForCluster(clusterName, alias); } catch (AliasServiceException e) { e.printStackTrace(); } if (credential != null) { return new CredentialValue(alias, new String(credential)); } return null; }
private CredentialValue getCredentialValueForAlias(String alias) { GatewayServices services = (GatewayServices)request.getServletContext(). getAttribute(GatewayServices.GATEWAY_SERVICES_ATTRIBUTE); String clusterName = (String) request.getServletContext().getAttribute(GatewayServices.GATEWAY_CLUSTER_ATTRIBUTE); AliasService as = services.getService(GatewayServices.ALIAS_SERVICE); char[] credential = null; try { credential = as.getPasswordFromAliasForCluster(clusterName, alias); } catch (AliasServiceException e) { e.printStackTrace(); } if (credential != null) { return new CredentialValue(alias, new String(credential)); } return null; }
@Override public void initializeContribution(DeploymentContext context) { super.initializeContribution(context); String clusterName = context.getTopology().getName(); // we don't want to overwrite an existing alias from a previous topology deployment // so we can't just blindly generateAlias here. // this version of getPassword will generate a value for it only if missing try { this.as.getPasswordFromAliasForCluster(clusterName, "encryptQueryString", true); } catch (AliasServiceException e) { log.unableCreatePasswordForEncryption(e); } }
@Override public void initializeContribution(DeploymentContext context) { super.initializeContribution(context); String clusterName = context.getTopology().getName(); // we don't want to overwrite an existing alias from a previous topology deployment // so we can't just blindly generateAlias here. // this version of getPassword will generate a value for it only if missing try { this.as.getPasswordFromAliasForCluster(clusterName, EncryptUriDescriptor.PASSWORD_ALIAS, true); } catch (AliasServiceException e) { log.unableCreatePasswordForEncryption(e); } }
password = aliasService.getPasswordFromAliasForCluster(clusterName, systemPass); } catch (AliasServiceException e) { LOG.unableToGetPassword(e);
@Override public void initializeContribution(DeploymentContext context) { super.initializeContribution(context); String clusterName = context.getTopology().getName(); // we don't want to overwrite an existing alias from a previous topology deployment // so we can't just blindly generateAlias here. // this version of getPassword will generate a value for it only if missing try { this.as.getPasswordFromAliasForCluster(clusterName, "encryptQueryString", true); } catch (AliasServiceException e) { log.unableCreatePasswordForEncryption(e); } }
out.println("No keystore has been created for the gateway. Please use the create-cert command or populate with a CA signed cert of your own."); char[] passphrase = as.getPasswordFromAliasForCluster(GATEWAY_CREDENTIAL_STORE_NAME, GATEWAY_IDENTITY_PASSPHRASE); if (passphrase == null) { MasterService ms = services.getService("MasterService");
password = aliasService.getPasswordFromAliasForCluster(clusterName, systemPass); } catch (AliasServiceException e) { LOG.unableToGetPassword(e);
char[] signingKeystorePassphrase = null; if(signingKeystorePassphraseAlias != null) { signingKeystorePassphrase = as.getPasswordFromAliasForCluster(clusterName, signingKeystorePassphraseAlias);
@Override public EncryptionResult encryptForCluster(String clusterName, String alias, byte[] clear) { char[] password = null; try { password = as.getPasswordFromAliasForCluster(clusterName, alias); } catch (AliasServiceException e2) { e2.printStackTrace(); } if (password != null) { try { return getEncryptor(clusterName,password).encrypt( clear ); } catch (Exception e) { LOG.failedToEncryptPasswordForCluster( clusterName, e ); } } return null; }
char[] signingKeystorePassphrase = null; if(signingKeystorePassphraseAlias != null) { signingKeystorePassphrase = as.getPasswordFromAliasForCluster(clusterName, signingKeystorePassphraseAlias);
@Override public byte[] decryptForCluster(String clusterName, String alias, byte[] cipherText, byte[] iv, byte[] salt) { try { char[] password = null; ConfigurableEncryptor encryptor = null; password = as.getPasswordFromAliasForCluster(clusterName, alias); if (password != null) { encryptor = getEncryptor(clusterName,password ); try { return encryptor.decrypt( salt, iv, cipherText); } catch (Exception e) { LOG.failedToDecryptPasswordForCluster( clusterName, e ); } } else { LOG.failedToDecryptCipherForClusterNullPassword( clusterName ); } } catch (AliasServiceException e1) { LOG.failedToDecryptCipherForClusterNullPassword( clusterName ); } return null; }
@Override public byte[] decryptForCluster(String clusterName, String alias, byte[] cipherText, byte[] iv, byte[] salt) { try { char[] password; ConfigurableEncryptor encryptor; password = as.getPasswordFromAliasForCluster(clusterName, alias); if (password != null) { encryptor = getEncryptor(clusterName,password ); try { return encryptor.decrypt( salt, iv, cipherText); } catch (Exception e) { LOG.failedToDecryptPasswordForCluster( clusterName, e ); } } else { LOG.failedToDecryptCipherForClusterNullPassword( clusterName ); } } catch (AliasServiceException e1) { LOG.failedToDecryptCipherForClusterNullPassword( clusterName ); } return null; }
@Override public EncryptionResult encryptForCluster(String clusterName, String alias, byte[] clear) { char[] password = null; try { password = as.getPasswordFromAliasForCluster(clusterName, alias); } catch (AliasServiceException e2) { e2.printStackTrace(); } if (password != null) { try { return getEncryptor(clusterName,password).encrypt( clear ); } catch (NoSuchAlgorithmException e1) { LOG.failedToEncryptPasswordForCluster( clusterName, e1 ); } catch (InvalidKeyException e) { LOG.failedToEncryptPasswordForCluster( clusterName, e ); } catch (Exception e) { LOG.failedToEncryptPasswordForCluster( clusterName, e ); } } return null; }
if(aliases.contains(key)) { try { value = String.valueOf(this.as.getPasswordFromAliasForCluster(clusterName, key)); } catch (AliasServiceException e) { log.unableToGetPassword(key, e);
if(aliases.contains(key)) { try { value = String.valueOf(this.as.getPasswordFromAliasForCluster(clusterName, key)); } catch (AliasServiceException e) { log.unableToGetPassword(key, e);
.getPasswordFromAliasForCluster(clusterName, alias, generate);
.getPasswordFromAliasForCluster(clusterName, alias, generate);
char[] passphrase = as.getPasswordFromAliasForCluster(GATEWAY_CREDENTIAL_STORE_NAME, GATEWAY_IDENTITY_PASSPHRASE); if (passphrase == null) { MasterService ms = services.getService("MasterService");
char[] passphrase = as.getPasswordFromAliasForCluster(GATEWAY_CREDENTIAL_STORE_NAME, GATEWAY_IDENTITY_PASSPHRASE); if (passphrase == null) { MasterService ms = services.getService("MasterService");