001: /*
002: * SSHTools - Java SSH2 API
003: *
004: * Copyright (C) 2002-2003 Lee David Painter and Contributors.
005: *
006: * Contributions made by:
007: *
008: * Brett Smith
009: * Richard Pernavas
010: * Erwin Bolwidt
011: *
012: * This program is free software; you can redistribute it and/or
013: * modify it under the terms of the GNU General Public License
014: * as published by the Free Software Foundation; either version 2
015: * of the License, or (at your option) any later version.
016: *
017: * This program is distributed in the hope that it will be useful,
018: * but WITHOUT ANY WARRANTY; without even the implied warranty of
019: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
020: * GNU General Public License for more details.
021: *
022: * You should have received a copy of the GNU General Public License
023: * along with this program; if not, write to the Free Software
024: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
025: */
026: package com.sshtools.common.automate;
027:
028: import com.sshtools.j2ssh.transport.publickey.InvalidSshKeyException;
029:
030: import java.io.IOException;
031:
032: /**
033: *
034: *
035: * @author $author$
036: * @version $Revision: 1.13 $
037: */
038: public interface AuthorizedKeysFormat {
039: /**
040: *
041: *
042: * @param keys
043: *
044: * @return
045: *
046: * @throws IOException
047: * @throws InvalidSshKeyException
048: */
049: public byte[] format(AuthorizedKeys keys) throws IOException,
050: InvalidSshKeyException;
051:
052: /**
053: *
054: *
055: * @param keys
056: * @param saver
057: *
058: * @return
059: *
060: * @throws IOException
061: * @throws InvalidSshKeyException
062: */
063: public byte[] format(AuthorizedKeys keys,
064: AuthorizedKeysFileSaver saver) throws IOException,
065: InvalidSshKeyException;
066:
067: /**
068: *
069: *
070: * @param formatted
071: *
072: * @return
073: *
074: * @throws IOException
075: * @throws InvalidSshKeyException
076: */
077: public AuthorizedKeys unformat(byte[] formatted)
078: throws IOException, InvalidSshKeyException;
079:
080: /**
081: *
082: *
083: * @param formatted
084: * @param loader
085: *
086: * @return
087: *
088: * @throws IOException
089: * @throws InvalidSshKeyException
090: */
091: public AuthorizedKeys unformat(byte[] formatted,
092: AuthorizedKeysFileLoader loader) throws IOException,
093: InvalidSshKeyException;
094:
095: /**
096: *
097: *
098: * @return
099: */
100: public boolean requiresKeyFiles();
101: }
|