From a9e9c4acfa90fc15a8a4b6b5ea6e1c2814ce940e Mon Sep 17 00:00:00 2001 From: sarthurdev <965089+sarthurdev@users.noreply.github.com> Date: Wed, 21 Jul 2021 14:36:48 +0200 Subject: pki: openvpn: T3642: Migrate OpenVPN to PKI and refactor --- python/vyos/pki.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'python/vyos/pki.py') diff --git a/python/vyos/pki.py b/python/vyos/pki.py index 1c6282d84..68ad73bf2 100644 --- a/python/vyos/pki.py +++ b/python/vyos/pki.py @@ -43,6 +43,8 @@ CSR_BEGIN='-----BEGIN CERTIFICATE REQUEST-----\n' CSR_END='\n-----END CERTIFICATE REQUEST-----' DH_BEGIN='-----BEGIN DH PARAMETERS-----\n' DH_END='\n-----END DH PARAMETERS-----' +OVPN_BEGIN = '-----BEGIN OpenVPN Static key V{0}-----\n' +OVPN_END = '\n-----END OpenVPN Static key V{0}-----' # Print functions @@ -227,6 +229,9 @@ def wrap_crl(raw_data): def wrap_dh_parameters(raw_data): return DH_BEGIN + raw_data + DH_END +def wrap_openvpn_key(raw_data, version='1'): + return OVPN_BEGIN.format(version) + raw_data + OVPN_END.format(version) + # Load functions def load_public_key(raw_data, wrap_tags=True): -- cgit v1.2.3