code: def armor(blob, type_str):
      
      head = '-----BEGIN PGP {}-----\nVersion: GnuPG v2\n\n'.format(type_str)
      body = base64.b64encode(blob).decode('ascii')
      checksum = base64.b64encode(util.crc24(blob)).decode('ascii')
      tail = '-----END PGP {}-----\n'.format(type_str)
      return head + _split_lines(body, 64) + '=' + checksum + '\n' + tail
docs: See https://tools.ietf.org/html/rfc4880#section-6 for details.