Package net.schmizz.sshj.signature

Examples of net.schmizz.sshj.signature.Signature.update()


        H = sha1.digest();

        Signature signature = Factory.Named.Util.create(trans.getConfig().getSignatureFactories(),
                                                        KeyType.fromKey(hostKey).toString());
        signature.init(hostKey, null);
        signature.update(H, 0, H.length);
        if (!signature.verify(sig))
            throw new TransportException(DisconnectReason.KEY_EXCHANGE_FAILED,
                                         "KeyExchange signature verification failed");
        return true;
    }
View Full Code Here


        Signature sigger = Factory.Named.Util.create(params.getTransport().getConfig().getSignatureFactories(), kt);
        if (sigger == null)
            throw new UserAuthException("Could not create signature instance for " + kt + " key");

        sigger.init(null, key);
        sigger.update(new Buffer.PlainBuffer()
                              .putString(params.getTransport().getSessionID())
                              .putBuffer(reqBuf) // & rest of the data for sig
                              .getCompactData());
        reqBuf.putSignature(kt, sigger.sign());
        return reqBuf;
View Full Code Here

        H = sha1.digest();

        Signature signature = Factory.Named.Util.create(trans.getConfig().getSignatureFactories(),
                                                        KeyType.fromKey(hostKey).toString());
        signature.init(hostKey, null);
        signature.update(H, 0, H.length);
        if (!signature.verify(sig))
            throw new TransportException(DisconnectReason.KEY_EXCHANGE_FAILED,
                                         "KeyExchange signature verification failed");
        return true;
    }
View Full Code Here

        Signature sigger = Factory.Named.Util.create(params.getTransport().getConfig().getSignatureFactories(), kt);
        if (sigger == null)
            throw new UserAuthException("Could not create signature instance for " + kt + " key");

        sigger.init(null, key);
        sigger.update(new Buffer.PlainBuffer()
                              .putString(params.getTransport().getSessionID())
                              .putBuffer(reqBuf) // & rest of the data for sig
                              .getCompactData());
        reqBuf.putSignature(kt, sigger.sign());
        return reqBuf;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.