Package com.sshtools.j2ssh.transport.publickey

Examples of com.sshtools.j2ssh.transport.publickey.OpenSSHPublicKeyFormat


*/
    public byte[] format(AuthorizedKeys keys)
        throws IOException, InvalidSshKeyException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        SshPublicKeyFile pubfile;
        OpenSSHPublicKeyFormat openssh = new OpenSSHPublicKeyFormat();
        Map.Entry entry;

        for (Iterator it = keys.getAuthorizedKeys().entrySet().iterator();
                (it != null) && it.hasNext();) {
            entry = (Map.Entry) it.next();
            openssh.setComment((String) entry.getValue());
            pubfile = SshPublicKeyFile.create((SshPublicKey) entry.getKey(),
                    openssh);
            out.write(pubfile.toString().getBytes("US-ASCII"));
            out.write('\n');
        }
View Full Code Here


                                JOptionPane.INFORMATION_MESSAGE);
                        } else if (keygen.getAction() == KeygenPanel.CONVERT_IETF_SECSH_TO_OPENSSH) {
                            monitor.setNote("Converting key file");
                            writeString(outputFile,
                                SshKeyGenerator.convertPublicKeyFile(
                                    inputFile, new OpenSSHPublicKeyFormat()));
                            monitor.setNote("Complete");
                            JOptionPane.showMessageDialog(Main.this,
                                "Key converted", "Key converted",
                                JOptionPane.INFORMATION_MESSAGE);
                        } else if (keygen.getAction() == KeygenPanel.CONVERT_OPENSSH_TO_IETF_SECSH) {
View Full Code Here

                                JOptionPane.INFORMATION_MESSAGE);
                        } else if (keygen.getAction() == KeygenPanel.CONVERT_IETF_SECSH_TO_OPENSSH) {
                            monitor.setNote("Converting key file");
                            writeString(outputFile,
                                SshKeyGenerator.convertPublicKeyFile(
                                    inputFile, new OpenSSHPublicKeyFormat()));
                            monitor.setNote("Complete");
                            JOptionPane.showMessageDialog(Main.this,
                                "Key converted", "Key converted",
                                JOptionPane.INFORMATION_MESSAGE);
                        } else if (keygen.getAction() == KeygenPanel.CONVERT_OPENSSH_TO_IETF_SECSH) {
View Full Code Here

*/
    public byte[] format(AuthorizedKeys keys)
        throws IOException, InvalidSshKeyException {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        SshPublicKeyFile pubfile;
        OpenSSHPublicKeyFormat openssh = new OpenSSHPublicKeyFormat();
        Map.Entry entry;

        for (Iterator it = keys.getAuthorizedKeys().entrySet().iterator();
                (it != null) && it.hasNext();) {
            entry = (Map.Entry) it.next();
            openssh.setComment((String) entry.getValue());
            pubfile = SshPublicKeyFile.create((SshPublicKey) entry.getKey(),
                    openssh);
            out.write(pubfile.toString().getBytes("US-ASCII"));
            out.write('\n');
        }
View Full Code Here

TOP

Related Classes of com.sshtools.j2ssh.transport.publickey.OpenSSHPublicKeyFormat

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.