Created
August 24, 2015 17:30
-
-
Save Ruzzz/3439ed89d61c8c29818e to your computer and use it in GitHub Desktop.
Convert x509 certificate from DER or PEM format to another format.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Contact: ruzzzua@gmail.com | |
:: Version: 2015.08.14 | |
:: Dependencies: OpenSSL | |
@echo off | |
if "%1"=="" goto :USAGE | |
if "%2"=="" goto :USAGE | |
if "%1"=="-toder" goto :TODER | |
:TOPEM | |
:: Convert from DER to PEM (Default) | |
openssl x509 -inform der -in %1 -out %2 | |
goto :eof | |
:TODER | |
:: Convert from PEM to DER (Default) | |
if "%3"=="" goto :USAGE | |
openssl x509 -outform der -in %2 -out %3 | |
goto :eof | |
:USAGE | |
echo Convert x509 certificate from DER or PEM format to another format. | |
echo Usage: %~nx0 [-toder] from-file to-file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment