String s = k.readString();
if (!s.equals(publicKeyAlgorithm)) {
throw new IOException("Invalid algorithm: " + s);
}
if (publicKeyAlgorithm.equals("ssh-rsa")) {
byte[] e = k.readBlob();
byte[] n = k.readBlob();
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
publicKey = new RsaSshPublicKey((RSAPublicKey) keyFactory.generatePublic(new RSAPublicKeySpec(new BigInteger(n), new BigInteger(e))));
} else if (publicKeyAlgorithm.equals("ssh-dss")) {
byte[] p = k.readBlob();