You can use GnuPG for this. From man gpg:
--enarmor
--dearmor
Pack or unpack an arbitrary input into/from an OpenPGP ASCII armor.
This is a GnuPG extension to OpenPGP and in general not very useful.
--enarmorreads from stdin and displays the armored version on stdout, --dearmorworks the other way around. For ASCII backup of a binary key, use gpg --enarmor <file.key >file.asc.
, OpenPGP . ASCII- ASCII.