标签:for local 地方 文件 txt XML gpg custom dev
pgp 在做解密和加密的时候,命令行的方式总是需要手动输入密码和指定ID,比较繁琐,所以写了一个自动脚本。@echo off
:: todo
setlocal enabledelayedexpansion
set /a j=0
for /f "tokens=1-3 delims=" %%i in (ps.txt) do (
set /a j+=1
rem set /a j+=1
rem echo !j!
rem echo %%i
if !j!==1 set ps=%%i
rem if !j!==2 set txt=%%i
)
rem echo %ps%
rem echo %txt%
set inputfile=%1%
echo -----------------------------------------------------------
echo Decrypt the pgp file from WideVine portal - %inputfile%
echo -----------------------------------------------------------
echo;
set outputfile=%inputfile:~0,-28%xml
rem echo Output file - %outputfile%
gpg --passphrase %ps% --decrypt %inputfile% > %outputfile%
echo -----------------------------------------------------------
echo Decrypt the pgp file successfully.
echo Encrypt the %outputfile% with customer key
echo -----------------------------------------------------------
echo;
gpg -r widevine_keys -e %outputfile%
rm %outputfile%
标签:for local 地方 文件 txt XML gpg custom dev
原文地址:http://blog.51cto.com/wb127/2173864