Examples of doFinal()


Examples of org.bouncycastle2.crypto.Digest.doFinal()

        Digest  digest = new SHA1Digest();
        byte[]  resBuf = new byte[digest.getDigestSize()];

        byte[] bytes = spki.getPublicKeyData().getBytes();
        digest.update(bytes, 0, bytes.length);
        digest.doFinal(resBuf, 0);
        this.keyidentifier = new DEROctetString(resBuf);
    }

    /**
     * create an AuthorityKeyIdentifier with the GeneralNames tag and
View Full Code Here

Examples of org.bouncycastle2.crypto.Mac.doFinal()

        //
        // add the text
        //
        cMac.update(data, dataOff, dataLen);

        return cMac.doFinal(macBlock, 0);
    }

    private boolean hasAssociatedText()
    {
        return associatedText != null && associatedText.length != 0;
View Full Code Here

Examples of org.bouncycastle2.crypto.digests.SHA1Digest.doFinal()

        Digest  digest = new SHA1Digest();
        byte[]  resBuf = new byte[digest.getDigestSize()];

        byte[] bytes = spki.getPublicKeyData().getBytes();
        digest.update(bytes, 0, bytes.length);
        digest.doFinal(resBuf, 0);
        this.keyidentifier = new DEROctetString(resBuf);
    }

    /**
     * create an AuthorityKeyIdentifier with the GeneralNames tag and
View Full Code Here

Examples of org.bouncycastle2.crypto.macs.CBCBlockCipherMac.doFinal()

        //
        // add the text
        //
        cMac.update(data, dataOff, dataLen);

        return cMac.doFinal(macBlock, 0);
    }

    private boolean hasAssociatedText()
    {
        return associatedText != null && associatedText.length != 0;
View Full Code Here

Examples of org.bouncycastle2.crypto.macs.HMac.doFinal()

            loadStore(mIn);

            // Finalise our mac calculation
            byte[] mac = new byte[hMac.getMacSize()];
            hMac.doFinal(mac, 0);

            // TODO Should this actually be reading the remainder of the stream?
            // Read the original mac from the stream
            byte[] oldMac = new byte[hMac.getMacSize()];
            dIn.readFully(oldMac);
View Full Code Here

Examples of org.spongycastle.crypto.Digest.doFinal()

    public static byte[] ripemd160(byte[] message) {
      Digest digest = new RIPEMD160Digest();
        if (message != null) {
          byte[] resBuf = new byte[digest.getDigestSize()];
          digest.update(message, 0, message.length);
          digest.doFinal(resBuf, 0);
          return resBuf;
      }
      throw new NullPointerException("Can't hash a NULL value");
    }
View Full Code Here

Examples of org.spongycastle.crypto.digests.RIPEMD160Digest.doFinal()

    public static byte[] ripemd160(byte[] message) {
      Digest digest = new RIPEMD160Digest();
        if (message != null) {
          byte[] resBuf = new byte[digest.getDigestSize()];
          digest.update(message, 0, message.length);
          digest.doFinal(resBuf, 0);
          return resBuf;
      }
      throw new NullPointerException("Can't hash a NULL value");
    }
View Full Code Here

Examples of org.vngx.jsch.hash.MAC.doFinal()

      synchronized( macsha1 ) {  // MAC is not thread-safe
        macsha1.init(_salt);
        byte[] hostBytes = Util.str2byte(_host);
        macsha1.update(hostBytes, 0, hostBytes.length);
        _hashedHost = new byte[macsha1.getBlockSize()];
        macsha1.doFinal(_hashedHost, 0);
      }
    } catch(Exception e) {
      throw new JSchException("Failed to create HashedHostKey: " + e, e);
    }
View Full Code Here

Examples of tools.elgamal.Cipher.doFinal()

    ChatterContext.put(getCk().getB(), SHARED_KEY, plainKey);
    try {
      Cipher elgamal = new ElgamalCipher();
      elgamal.init(Cipher.ENCRYPT_MODE, key);
      elgamal.update(plainKey);
      this.encryptedKey = elgamal.doFinal();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of tools.elgamal.ElgamalCipher.doFinal()

    ChatterContext.put(getCk().getB(), SHARED_KEY, plainKey);
    try {
      Cipher elgamal = new ElgamalCipher();
      elgamal.init(Cipher.ENCRYPT_MODE, key);
      elgamal.update(plainKey);
      this.encryptedKey = elgamal.doFinal();
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
  }
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.