public static byte[] encryptString(String keyStorePath, String keyAlias, KeyStorePasswordCallback passwordCallback, String value) throws GeneralSecurityException, IOException { return encrypt(keyStorePath, keyAlias, passwordCallback, value.getBytes(CHARSET_ENCODING)); }
byte[] array = byteArrayOutputStream.toByteArray(); try { return SecurityUtil.encrypt(this.keyStorePath, this.secretKeyAlias, this.keyStorePasswordCallback, array); } catch (GeneralSecurityException e) { throw new CredentialStoreException("Error encrypting data", e);