mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-04-19 08:36:21 +00:00
Other cases
This commit is contained in:
parent
da7947909e
commit
4a1483e266
@ -58,9 +58,15 @@ public final class CredentialHelper {
|
||||
public static byte[] stripPemHeaderFooter(final String pemFile) {
|
||||
String strippedFile;
|
||||
strippedFile = pemFile.replace(CertificateVariables.PEM_HEADER, "");
|
||||
strippedFile = strippedFile.substring(0, strippedFile.indexOf(CertificateVariables.PEM_FOOTER));
|
||||
int keyFooterPos = strippedFile.indexOf(CertificateVariables.PEM_FOOTER);
|
||||
if (keyFooterPos >= 0) {
|
||||
strippedFile = strippedFile.substring(0, keyFooterPos);
|
||||
}
|
||||
strippedFile = strippedFile.replace(CertificateVariables.PEM_ATTRIBUTE_HEADER, "");
|
||||
strippedFile = strippedFile.substring(0, strippedFile.indexOf(CertificateVariables.PEM_ATTRIBUTE_FOOTER));
|
||||
int attrFooterPos = strippedFile.indexOf(CertificateVariables.PEM_ATTRIBUTE_FOOTER);
|
||||
if (attrFooterPos >= 0) {
|
||||
strippedFile = strippedFile.substring(0, attrFooterPos);
|
||||
}
|
||||
return Base64.decode(strippedFile);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user