removePEMHeadersAndFooters function
Implementation
String removePEMHeadersAndFooters(String pemString) {
// Split the PEM string into lines
List<String> lines = pemString.split('\n');
// Filter out lines that are headers or footers
List<String> keyLines = lines
.where((line) => !line.startsWith('-'))
.map((e) => e.trim())
.toList();
// Join the remaining lines to get the actual key content
String keyContent = keyLines.join('');
return keyContent;
}