encodeASN1ObjectToPem static method
Encode the given asn1Object
to PEM format and adding the begin
and end
.
Implementation
static String encodeASN1ObjectToPem(
ASN1Object asn1Object, String begin, String end,
{String newLine = '\n'}) {
var bytes = asn1Object.encode();
var chunks = StringUtils.chunk(base64.encode(bytes), 64);
return '$begin$newLine${chunks.join(newLine)}$newLine$end';
}