}
private static RSAPublicKey readRSAPublicKey(BufferedReader in, String endMarker) throws IOException {
Object asnObject = new ASN1InputStream(readBytes(in, endMarker)).readObject();
ASN1Sequence sequence = (ASN1Sequence) asnObject;
RSAPublicKeyStructure rsaPubStructure = new RSAPublicKeyStructure(sequence);
RSAPublicKeySpec keySpec = new RSAPublicKeySpec(
rsaPubStructure.getModulus(),
rsaPubStructure.getPublicExponent());
try {
KeyFactory keyFact = KeyFactory.getInstance("RSA");
return (RSAPublicKey) keyFact.generatePublic(keySpec);
} catch (NoSuchAlgorithmException e) {