/** * Writes the public key with the specified comment to the output stream in * the format defined in http://www.ietf.org/rfc/rfc4716.txt * @param name file name * @param comment comment * @see #writeSECSHPublicKey(java.io.OutputStream out, String comment) */ public void writeSECSHPublicKey(String name, String comment) throws java.io.FileNotFoundException, java.io.IOException{ FileOutputStream fos=new FileOutputStream(name); writeSECSHPublicKey(fos, comment); fos.close(); }
public void writeSECSHPublicKey(String name, String comment) throws java.io.FileNotFoundException, java.io.IOException{ FileOutputStream fos=new FileOutputStream(name); writeSECSHPublicKey(fos, comment); fos.close(); }
/** * Writes the public key with the specified comment to the output stream in * the format defined in http://www.ietf.org/rfc/rfc4716.txt * @param name file name * @param comment comment * @see #writeSECSHPublicKey(java.io.OutputStream out, String comment) */ public void writeSECSHPublicKey(String name, String comment) throws java.io.FileNotFoundException, java.io.IOException{ FileOutputStream fos=new FileOutputStream(name); writeSECSHPublicKey(fos, comment); fos.close(); }
/** * Writes the public key with the specified comment to the output stream in * the format defined in http://www.ietf.org/rfc/rfc4716.txt * * @param name file name * @param comment comment * @see #writeSECSHPublicKey(java.io.OutputStream out, String comment) */ public void writeSECSHPublicKey(String name, String comment) throws java.io.FileNotFoundException, java.io.IOException { FileOutputStream fos = new FileOutputStream(name); writeSECSHPublicKey(fos, comment); fos.close(); }
/** * Writes the public key with the specified comment to the output stream in * the format defined in <a href="http://tools.ietf.org/html/rfc4716">RFC 4716, * The Secure Shell (SSH) Public Key File Format</a> * @param name file name * @param comment comment * @see #writeSECSHPublicKey(java.io.OutputStream out, String comment) */ public void writeSECSHPublicKey(String name, String comment) throws java.io.FileNotFoundException, java.io.IOException{ FileOutputStream fos=new FileOutputStream(name); writeSECSHPublicKey(fos, comment); fos.close(); }
public byte[] getFormattedKey() throws IOException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); switch (format) { case SshPublicKeyFile.SECSH_FORMAT: jschKey.keyPair.writeSECSHPublicKey(baos, comment); break; case SshPublicKeyFile.OPENSSH_FORMAT: jschKey.keyPair.writePublicKey(baos, comment); break; default: throw new UnsupportedOperationException("Public key file format not supported."); } return baos.toByteArray(); }