Package net.schmizz.sshj.common

Examples of net.schmizz.sshj.common.SSHRuntimeException


    public boolean verify(byte[] sig) {
        sig = extractSig(sig);
        try {
            return signature.verify(sig);
        } catch (SignatureException e) {
            throw new SSHRuntimeException(e);
        }
    }
View Full Code Here


                mac.doFinal(tmp, 0);
                System.arraycopy(tmp, 0, buf, offset, bsize);
            } else
                mac.doFinal(buf, offset);
        } catch (ShortBufferException e) {
            throw new SSHRuntimeException(e);
        }
    }
View Full Code Here

        SecretKeySpec skey = new SecretKeySpec(key, algorithm);
        try {
            mac = SecurityUtils.getMAC(algorithm);
            mac.init(skey);
        } catch (GeneralSecurityException e) {
            throw new SSHRuntimeException(e);
        }
    }
View Full Code Here

        super.notifyError(error);
    }

    private void checkReuse() {
        if (usedUp)
            throw new SSHRuntimeException("This session channel is all used up");
    }
View Full Code Here

    public DH() {
        try {
            generator = SecurityUtils.getKeyPairGenerator("DH");
            agreement = SecurityUtils.getKeyAgreement("DH");
        } catch (GeneralSecurityException e) {
            throw new SSHRuntimeException(e);
        }
    }
View Full Code Here

    @Override
    public void init() {
        try {
            md = SecurityUtils.getMessageDigest(algorithm);
        } catch (GeneralSecurityException e) {
            throw new SSHRuntimeException(e);
        }
    }
View Full Code Here

            stream.avail_out = BUF_SIZE;
            final int status = stream.deflate(JZlib.Z_PARTIAL_FLUSH);
            if (status == JZlib.Z_OK) {
                buffer.putRawBytes(tempBuf, 0, BUF_SIZE - stream.avail_out);
            } else {
                throw new SSHRuntimeException("compress: deflate returned " + status);
            }
        } while (stream.avail_out == 0);
    }
View Full Code Here

            cipher = SecurityUtils.getCipher(transformation);
            cipher.init((mode == Mode.Encrypt ? javax.crypto.Cipher.ENCRYPT_MODE : javax.crypto.Cipher.DECRYPT_MODE),
                        new SecretKeySpec(key, algorithm), new IvParameterSpec(iv));
        } catch (GeneralSecurityException e) {
            cipher = null;
            throw new SSHRuntimeException(e);
        }
    }
View Full Code Here

    @Override
    public void update(byte[] input, int inputOffset, int inputLen) {
        try {
            cipher.update(input, inputOffset, inputLen, input, inputOffset);
        } catch (ShortBufferException e) {
            throw new SSHRuntimeException(e);
        }
    }
View Full Code Here

        public void consume(long howMuch) {
            try {
                super.consume(howMuch);
            } catch (ConnectionException e) { // It's a bug if we consume more than remote allowed
                throw new SSHRuntimeException(e);
            }
        }
View Full Code Here

TOP

Related Classes of net.schmizz.sshj.common.SSHRuntimeException

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.