guides/java/crypto/BC25519.java
private static String obtainRaw(String filename, boolean secret){
		try{
			String raw = new String(Files.readAllBytes(Paths.get(filename)));
			//first remove the header lines
			if(secret){
				raw = raw.replaceAll("(-+BEGIN PRIVATE KEY-+\\r?\\n|-+END PRIVATE KEY-+\\r?\\n?)", "");
				//raw = raw.replace("-----BEGIN PRIVATE KEY-----", "");
				//raw = raw.replace("-----END PRIVATE KEY-----", "");
			}else{
				raw = raw.replaceAll("(-+BEGIN PUBLIC KEY-+\\r?\\n|-+END PUBLIC KEY-+\\r?\\n?)", "");
				//raw = raw.replace("-----BEGIN PUBLIC KEY-----", "");
				//raw = raw.replace("-----END PUBLIC KEY-----", "");
			}
			raw = raw.replace("\n", "");
			return raw;

		}catch(Exception e){
			System.out.println(e);
			return null;
		}
	}
/*
	 * Support function to obtain the raw base64 string, removing the header/trailer as well as newline chars
	 * if secret set to true, then the string BEGIN PRIVATE KEY will be searched for instead of BEGIN PUBLIC KEY
	 */
Support function to obtain the raw base64 string, removing the header/trailer as well as newline chars
if secret set to true, then the string BEGIN PRIVATE KEY will be searched for instead of BEGIN PUBLIC KEY
Support function to obtain the raw base64 string removing the header / trailer as well as newline chars if secret set to true then the string BEGIN PRIVATE KEY will be searched for instead of BEGIN PUBLIC KEY
private static String obtainRaw(String filename, boolean secret){
		try{
			String raw = new String(Files.readAllBytes(Paths.get(filename)));
			if(secret){
				raw = raw.replaceAll("(-+BEGIN PRIVATE KEY-+\\r?\\n|-+END PRIVATE KEY-+\\r?\\n?)", "");
			}else{
				raw = raw.replaceAll("(-+BEGIN PUBLIC KEY-+\\r?\\n|-+END PUBLIC KEY-+\\r?\\n?)", "");
			}
			raw = raw.replace("\n", "");
			return raw;
		}catch(Exception e){
			System.out.println(e);
			return null;
		}
	}
private static String obtainRaw ( String filename , boolean secret ) { try { String raw = new String ( Files . readAllBytes ( Paths . get ( filename ) ) ) ; if ( secret ) { raw = raw . replaceAll ( "(-+BEGIN PRIVATE KEY-+\\r?\\n|-+END PRIVATE KEY-+\\r?\\n?)" , "" ) ; } else { raw = raw . replaceAll ( "(-+BEGIN PUBLIC KEY-+\\r?\\n|-+END PUBLIC KEY-+\\r?\\n?)" , "" ) ; } raw = raw . replace ( "\n" , "" ) ; return raw ; } catch ( Exception e ) { System . out . println ( e ) ; return null ; } }
Support function to obtain the raw base64 string, removing the header/trailer as well as newline chars
 if secret set to true, then the string BEGIN PRIVATE KEY will be searched for instead of BEGIN PUBLIC KEY
Support function to obtain the raw base64 string removing the header / trailer as well as newline chars if secret set to true then the string BEGIN PRIVATE KEY will be searched for instead of BEGIN PUBLIC KEY
//first remove the header lines //raw = raw.replace("-----BEGIN PRIVATE KEY-----", ""); //raw = raw.replace("-----END PRIVATE KEY-----", ""); //raw = raw.replace("-----BEGIN PUBLIC KEY-----", ""); //raw = raw.replace("-----END PUBLIC KEY-----", "");