Package org.bouncycastle.crypto.io

Examples of org.bouncycastle.crypto.io.DigestInputStream


            Cipher cipher = this.makePBECipher(cipherAlg, Cipher.DECRYPT_MODE, password, salt, iterationCount);
            CipherInputStream cIn = new CipherInputStream(dIn, cipher);

            Digest dig = new SHA1Digest();
            DigestInputStream  dgIn = new DigestInputStream(cIn, dig);
   
            this.loadStore(dgIn);

            // Finalise our digest calculation
            byte[] hash = new byte[dig.getDigestSize()];
View Full Code Here


                cipher = this.makePBECipher(STORE_CIPHER, Cipher.DECRYPT_MODE, password, salt, iterationCount);
            }
   
            CipherInputStream  cIn = new CipherInputStream(dIn, cipher);
   
            DigestInputStream  dgIn = new DigestInputStream(cIn, new SHA1Digest());
   
            this.loadStore(dgIn);
   
            Digest  dig = dgIn.getDigest();
            int     digSize = dig.getDigestSize();
            byte[]  hash = new byte[digSize];
            byte[]  oldHash = new byte[digSize];
   
            dig.doFinal(hash, 0);
View Full Code Here

            Cipher cipher = this.makePBECipher(cipherAlg, Cipher.DECRYPT_MODE, password, salt, iterationCount);
            CipherInputStream cIn = new CipherInputStream(dIn, cipher);

            Digest dig = new SHA1Digest();
            DigestInputStream  dgIn = new DigestInputStream(cIn, dig);
   
            this.loadStore(dgIn);

            // Finalise our digest calculation
            byte[] hash = new byte[dig.getDigestSize()];
View Full Code Here

                cipher = this.makePBECipher(STORE_CIPHER, Cipher.DECRYPT_MODE, password, salt, iterationCount);
            }
   
            CipherInputStream  cIn = new CipherInputStream(dIn, cipher);
   
            DigestInputStream  dgIn = new DigestInputStream(cIn, new SHA1Digest());
   
            this.loadStore(dgIn);
   
            Digest  dig = dgIn.getDigest();
            int     digSize = dig.getDigestSize();
            byte[]  hash = new byte[digSize];
            byte[]  oldHash = new byte[digSize];
   
            dig.doFinal(hash, 0);
View Full Code Here

    } catch (FileNotFoundException e) {
      return null;
    }

    MD5Digest digest = new MD5Digest();
    DigestInputStream dis = new DigestInputStream(fis, digest);
    do {
      numRead = dis.read(buffer);
      if (numRead > 0) {
        digest.update(buffer, 0, numRead);
      }
    } while (numRead != -1);
    dis.close();
    fis.close();

    byte[] md5 = new byte[digest.getDigestSize()];
    digest.doFinal(md5, 0);
View Full Code Here

                cipher = this.makePBECipher(STORE_CIPHER, Cipher.DECRYPT_MODE, password, salt, iterationCount);
            }
   
            CipherInputStream  cIn = new CipherInputStream(dIn, cipher);
   
            DigestInputStream  dgIn = new DigestInputStream(cIn, new SHA1Digest());
   
            this.loadStore(dgIn);
   
            Digest  dig = dgIn.getDigest();
            int     digSize = dig.getDigestSize();
            byte[]  hash = new byte[digSize];
            byte[]  oldHash = new byte[digSize];
   
            dig.doFinal(hash, 0);
View Full Code Here

TOP

Related Classes of org.bouncycastle.crypto.io.DigestInputStream

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.