diff options
Diffstat (limited to 'lib/_ak_gpg')
-rwxr-xr-x | lib/_ak_gpg | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/_ak_gpg b/lib/_ak_gpg index bdb8829..7832ca1 100755 --- a/lib/_ak_gpg +++ b/lib/_ak_gpg @@ -17,10 +17,11 @@ ### You should have received a copy of the GNU General Public License ### along with this program. If not, see <http://www.gnu.org/licenses/>. ### -source $AK_LIBDIR/_ak_log -source $AK_LIBDIR/_ak_ipfs -source $AK_LIBDIR/_ak_config -source $AK_LIBDIR/_ak_settings +source $AK_LIBDIR/_ak_lib_load +_ak_lib_load _ak_log +_ak_lib_load _ak_ipfs +_ak_lib_load _ak_config +_ak_lib_load _ak_settings export AK_FINGERPRINT="$(_ak_settings_get gpg.fingerprint)" @@ -133,10 +134,19 @@ function _ak_gpg_sign_clear(){ fi } +function _ak_gpg_sign_clear_with_key(){ + if [ ! -z $1 ] && [ -n "$1" ] && [ ! -z $2 ] && [ -n "$2" ] && [ ! -z $3 ] && [ -n "$3" ] + then + _ak_gpg --clear-sign --sign-with $3 --armor --output $1 $2 + else + exit 1 + fi +} + function _ak_gpg_encrypt_sign(){ if [ ! -z $1 ] && [ -n "$1" ] && [ ! -z $2 ] && [ -n "$2" ] && [ ! -z $3 ] && [ -n "$3" ] then - _ak_gpg --sign-with $AK_FINGERPRINT --encypt -r $3 --armor --output $1 $2 + _ak_gpg --sign-with $AK_FINGERPRINT --encrypt -r $3 --armor --output $1 $2 else exit 1 fi @@ -145,7 +155,7 @@ function _ak_gpg_encrypt_sign(){ function _ak_gpg_encrypt_sign_for_self(){ if [ ! -z $1 ] && [ -n "$1" ] && [ ! -z $2 ] && [ -n "$2" ] then - _ak_gpg --sign-with $AK_FINGERPRINT --encypt -r $AK_FINGERPRINT --armor --output $1 $2 + _ak_gpg --sign-with $AK_FINGERPRINT --encrypt -r $AK_FINGERPRINT --armor --output $1 $2 else exit 1 fi @@ -154,7 +164,7 @@ function _ak_gpg_encrypt_sign_for_self(){ function _ak_gpg_encrypt(){ if [ ! -z $1 ] && [ -n "$1" ] && [ ! -z $2 ] && [ -n "$2" ] && [ ! -z $3 ] && [ -n "$3" ] then - _ak_gpg --encypt -r $3 --armor --output $1 $2 + _ak_gpg --encrypt -r $3 --armor --output $1 $2 else exit 1 fi @@ -163,7 +173,7 @@ function _ak_gpg_encrypt(){ function _ak_gpg_encrypt_for_self(){ if [ ! -z $1 ] && [ -n "$1" ] && [ ! -z $2 ] && [ -n "$2" ] then - _ak_gpg --encypt -r $AK_FINGERPRINT --armor --output $1 $2 + _ak_gpg --encrypt -r $AK_FINGERPRINT --armor --output $1 $2 else exit 1 fi @@ -299,3 +309,5 @@ function _ak_gpg_delete_secret_key(){ fi fi } + +_ak_log_debug "_ak_gpg loaded $(caller)" |