Package com.sshtools.j2ssh.io

Examples of com.sshtools.j2ssh.io.ByteArrayReader


     * @throws AlgorithmNotSupportedException
     */
    public static SshPrivateKey decodePrivateKey(byte[] encoded)
        throws InvalidSshKeyException, AlgorithmNotSupportedException {
        try {
            ByteArrayReader bar = new ByteArrayReader(encoded);
            String algorithm = bar.readString();

            if (supportsKey(algorithm)) {
                SshKeyPair pair = newInstance(algorithm);

                return pair.decodePrivateKey(encoded);
View Full Code Here


     * @throws AlgorithmNotSupportedException
     */
    public static SshPublicKey decodePublicKey(byte[] encoded)
        throws InvalidSshKeyException, AlgorithmNotSupportedException {
        try {
            ByteArrayReader bar = new ByteArrayReader(encoded);
            String algorithm = bar.readString();

            if (supportsKey(algorithm)) {
                SshKeyPair pair = newInstance(algorithm);

                return pair.decodePublicKey(encoded);
View Full Code Here

        Class cls = (Class) register.get(SshMessage.getMessageId(msgdata));

        try {
            SshMessage msg = (SshMessage) cls.newInstance();
            msg.fromByteArray(new ByteArrayReader(msgdata));
            addMessage(msg);
        } catch (IllegalAccessException iae) {
            throw new InvalidMessageException(
                "Illegal access for implementation class " + cls.getName());
        } catch (InstantiationException ie) {
View Full Code Here

        Class cls = (Class) register.get(SshMessage.getMessageId(msgdata));

        try {
            SshMessage msg = (SshMessage) cls.newInstance();
            msg.fromByteArray(new ByteArrayReader(msgdata));

            return msg;
        } catch (IllegalAccessException iae) {
            throw new InvalidMessageException(
                "Illegal access for implementation class " + cls.getName());
View Full Code Here

TOP

Related Classes of com.sshtools.j2ssh.io.ByteArrayReader

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.