BASE64にEncodeすることで、バイナリを可読テキストで表現できる。
Windows
コマンド
certutil -encode src.txt b64.txt
certutil -decode b64.txt b64_dec.txt
サンプル
type src.txt
テスト
certutil -encode src.txt b64.txt
type b64.txt
-----BEGIN CERTIFICATE-----
g2WDWINnIA0K
-----END CERTIFICATE-----
certutil -decode b64.txt b64_dec.txt
type b64_dec.txt
テスト
Linux
コマンド
cat src.txt | base64 > b64.txt
cat b64.txt | base64 -d > b64_dec.txt
サンプル
echo "test" | base64
dGVzdA==
echo "dGVzdA==" | base64 -b
test