@Test public void testEncodeAsOpenSSH() throws IOException, InvalidKeySpecException, NoSuchAlgorithmException { String dsa = Strings2.toStringAndClose(getClass().getResourceAsStream("/ssh-dsa.pub")); DSAPublicKeySpec spec = DSAKeys.publicKeySpecFromOpenSSH(dsa); DSAPublicKey key = (DSAPublicKey) KeyFactory.getInstance("DSA").generatePublic(spec); assertEquals(DSAKeys.encodeAsOpenSSH(key), dsa); }
public static String encodeAsOpenSSH(DSAPublicKey key) { DSAParams params = key.getParams(); byte[] keyBlob = keyBlob(params.getP(), params.getQ(), params.getG(), key.getY()); return "ssh-dss " + base64().encode(keyBlob); }
DSAKeys { public static String encodeAsOpenSSH(DSAPublicKey key) { DSAParams params = key.getParams(); byte[] keyBlob = keyBlob(params.getP(), params.getQ(), params.getG(), key.getY()); return "ssh-dss " + base64().encode(keyBlob); } }
DSAKeys { public static String encodeAsOpenSSH(DSAPublicKey key) { DSAParams params = key.getParams(); byte[] keyBlob = keyBlob(params.getP(), params.getQ(), params.getG(), key.getY()); return "ssh-dss " + base64().encode(keyBlob); }  }
DSAKeys { public static String encodeAsOpenSSH(DSAPublicKey key) { DSAParams params = key.getParams(); byte[] keyBlob = keyBlob(params.getP(), params.getQ(), params.getG(), key.getY()); return "ssh-dss " + base64().encode(keyBlob); }  static String encodeAsOpenSSH(DSAPublicKey key); static DSAPublicKeySpec publicKeySpecFromOpenSSH(String idDsaPub); static DSAPublicKeySpec publicKeySpecFromOpenSSH(ByteSource supplier); static String fingerprintPublicKey(String publicKeyOpenSSH); static String fingerprint(BigInteger p, BigInteger q, BigInteger g, BigInteger y); }
DSAKeys { public static String encodeAsOpenSSH(DSAPublicKey key) { DSAParams params = key.getParams(); byte[] keyBlob = keyBlob(params.getP(), params.getQ(), params.getG(), key.getY()); return "ssh-dss " + base64().encode(keyBlob); }  static String encodeAsOpenSSH(DSAPublicKey key); static DSAPublicKeySpec publicKeySpecFromOpenSSH(String idDsaPub); static DSAPublicKeySpec publicKeySpecFromOpenSSH(ByteSource supplier); static String fingerprintPublicKey(String publicKeyOpenSSH); static String fingerprint(BigInteger p, BigInteger q, BigInteger g, BigInteger y);  }