Package com.maverick.util

Examples of com.maverick.util.ByteArrayReader.readBinaryString()


                if (type.equals("3DES-CBC")) {
                    bar.read(iv);
                }

                keyblob = bar.readBinaryString();

                Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding");
                KeySpec keyspec = new DESedeKeySpec(keydata);
                Key key = SecretKeyFactory.getInstance("DESede").generateSecret(keyspec);
                cipher.init(Cipher.DECRYPT_MODE, key,
View Full Code Here


                ByteArrayReader data = new ByteArrayReader(cipher.doFinal(
                            keyblob));

                if (data.readInt() == cookie) {
                    keyblob = data.readBinaryString();
                } else {
                    throw new InvalidKeyException(
                        "The host key is invalid, check the passphrase supplied");
                }
            } else {
View Full Code Here

        throws InvalidSignatureException {
        try {
            // Check for older versions of the transport protocol
            if (signature.length != 128) {
                ByteArrayReader bar = new ByteArrayReader(signature);
                byte[] sig = bar.readBinaryString();
                String header = new String(sig);

                if (!header.equals(getAlgorithmName())) {
                    throw new InvalidSignatureException();
                }
View Full Code Here

                if (!header.equals(getAlgorithmName())) {
                    throw new InvalidSignatureException();
                }

                signature = bar.readBinaryString();
            }

            Signature s = Signature.getInstance("SHA1withRSA");
            s.initVerify(pubKey);
            s.update(data);
View Full Code Here

        throws InvalidSignatureException {
        try {
            // Check for differing version of the transport protocol
            if (signature.length != 40) {
                ByteArrayReader bar = new ByteArrayReader(signature);
                byte[] sig = bar.readBinaryString();

                //if (log.isDebugEnabled()) {log.debug("Signature blob is " + new String(sig));}
                String header = new String(sig);
                if (log.isDebugEnabled())
                  log.debug("Header is " + header);
View Full Code Here

                if (!header.equals("ssh-dss")) {
                    throw new InvalidSignatureException();
                }

                signature = bar.readBinaryString();

                //if (log.isDebugEnabled()) {log.debug("Read signature from blob: " + new String(signature));}
            }

            // Using a SimpleASNWriter
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.