2017-06-01 66 views
0

在我的電腦:特拉維斯加密文件Maven的部署

travis login --org 
Username: xxxxxx 
Password: xxxxxx 
Successfully logged in as xxxxxx! 
travis encrypt-file codesigning.asc -r XXXXXX/XXXXXX 
encrypting codesigning.asc for XXXXXX/XXXXXX 
storing result as codesigning.asc.enc 
storing secure env variables for decryption 

Please add the following to your build script (before_install stage in your .travis.yml, for instance): 

    openssl aes-256-cbc -K $encrypted_abcd1234_key -iv $encrypted_abcd1234_iv -in codesigning.asc.enc -out codesigning.asc -d 

Pro Tip: You can add it automatically by running with --add. 

Make sure to add codesigning.asc.enc to the git repository. 
Make sure not to add codesigning.asc to the git repository. 
Commit all changes to your .travis.yml. 

在我的特拉維斯帳戶:

enter image description here

在我的GitHub庫:

我粘貼codesigning.asc.enc文件在test文件夾中test/codesigning.asc.enc

我添加這個shell腳本:

if [ "$TRAVIS_BRANCH" = 'master' ] && [ "$TRAVIS_PULL_REQUEST" == 'false' ]; then 
    echo "******** Starting gpg" 
    openssl aes-256-cbc -K "$encrypted_abcd1234_key" -iv "$encrypted_abcd1234_iv" -in test/codesigning.asc.enc -out test/codesigning.asc -d 
    gpg --fast-import test/codesigning.asc 
fi 

我有我的特拉維斯控制檯上的錯誤:

bad decrypt 
139864985556640:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:539: 
gpg: invalid radix64 character FE skipped 
gpg: invalid radix64 character C4 skipped 
gpg: read_block: read error: invalid packet 
gpg: import from `test/codesigning.asc' failed: invalid keyring 
gpg: Total number processed: 0 

回答

0

的OpenPGP(密碼由gpg實施協議)和X.509(中OpenSSL使用的密碼協議)不兼容。您無法將此密鑰導入到GnuPG(您可以使用實現X.509的gpgsm,但這不是您想要使用的正常gpg)。您必須堅持使用OpenSSL或GnuTLS來處理密鑰和加密消息。