forked from ESAPI/esapi-java-legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpersistEncryptedData.sh
More file actions
executable file
·29 lines (27 loc) · 1.27 KB
/
Copy pathpersistEncryptedData.sh
File metadata and controls
executable file
·29 lines (27 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Purpose: Persist some encrypted data by saving it to a file. Shows how
# the serialization works. See ../java/PersistedEncryptedData.java
# for details.
# Usage: ./persistEncryptedData.sh plaintext_string output_file {hex|base64|raw}
# The last argument refers to how the encrypted data will be encoded.
# The output file name will also be named with this as the file
# suffix.
##############################################################################
if [[ -z "$esapi_classpath" ]]
then
echo 2>&1 "esapi_classpath not set. Did you dot the appropriate env file?"
echo 2>&1 "If you are using ESAPI from downloaded zip file, use:"
echo 2>&1 " . ./setenv-zip.sh"
echo 2>&1 "If you are using ESAPI pulled from SVN repository, use:"
echo 2>&1 " . ./setenv-svn.sh"
exit 1
fi
cd ../java
set -x
# Since this is just an illustration, we will use the test ESAPI.properties in
# $esapi_resources_test. That way, it won't matter if the user has neglected
# to run the 'setMasterKey.sh' example before running this one.
java -Dlog4j.configuration="file:$log4j_properties" \
-Dorg.owasp.esapi.resources="$esapi_resources_test" \
-ea -classpath "$esapi_classpath" \
PersistedEncryptedData "$@"