#!/bin/bash
#pem转cer
openssl x509 -outform der -in 3324861__ksjgs.com.pem -out ksjgs-bak.cer
#aes 128加密并用base64编码
openssl enc -aes-128-cbc -in ksjgs-bak.cer -out ksjgs-bak-enc.log -a
#解密
#base64解码
base64 -d ksjgs-bak-enc.log > ksjgs-bak-unbase64.log
#aes 128解密
openssl enc -d -aes-128-cbc -in ksjgs-bak-unbase64.log -out ksjgs-bak-unbase64-jiemi.log
#对比证书文件
md5sum ksjgs-bak.cer
md5sum ksjgs-bak-unbase64-jiemi.log