Arising from the review of PR #287...
Code that converts PEM data to base64 (i.e. deletes headers and newlines, making heavy use of strstr and memmove) appears in several places, and is inefficient (quadratic in number of input lines - although this has not proven to be a problem yet).
strstr
memmove
The code should be consolidated in a single subroutine, and made more efficient and (hopefully?) more readable.