Examples of Digest


Examples of org.bouncycastle.crypto.Digest

     *
     **/
    public AuthorityKeyIdentifier(
        SubjectPublicKeyInfo    spki)
    {
        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);
    }
View Full Code Here

Examples of org.bouncycastle.crypto.Digest

    public AuthorityKeyIdentifier(
        SubjectPublicKeyInfo    spki,
        GeneralNames            name,
        BigInteger              serialNumber)
    {
        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);
        this.certissuer = GeneralNames.getInstance(name.toASN1Object());
        this.certserno = new DERInteger(serialNumber);
    }
View Full Code Here

Examples of org.bouncycastle2.crypto.Digest

    private void initFromSpec(
        OAEPParameterSpec pSpec)
        throws NoSuchPaddingException
    {
        MGF1ParameterSpec   mgfParams = (MGF1ParameterSpec)pSpec.getMGFParameters();
        Digest              digest = JCEDigestUtil.getDigest(mgfParams.getDigestAlgorithm());
       
        if (digest == null)
        {
            throw new NoSuchPaddingException("no match on OAEP constructor for digest algorithm: "+ mgfParams.getDigestAlgorithm());
        }
View Full Code Here

Examples of org.eclipse.php.internal.core.phar.digest.Digest

        buffer = new byte[4];
        read(bis, buffer);
        boolean found = false;
        for (Iterator<Digest> iterator = Digest.DIGEST_MAP.values()
            .iterator(); iterator.hasNext();) {
          Digest digest = iterator.next();
          if (PharUtil.byteArrayEquals(digest.getBitMap(), buffer)) {
            if (digest.getDigest().digest().length != signatureLength - 8
                || !PharUtil.checkSignature(file, digest,
                    signatureEntry.getPosition())) {
              throw new PharException(
                  Messages.Phar_Signature_Corrupted);
            } else {
View Full Code Here

Examples of org.jgroups.protocols.pbcast.Digest

        Vector members=new Vector();

        members.add(new IpAddress(1111));
        members.add(new IpAddress(2222));
        View v=new View(new IpAddress(1234), 322649, members);
        Digest d=new Digest(3);
        d.add(new IpAddress(3524), 1,2,3);
        d.add(new IpAddress(1324), 3,4,5);
        rsp=new JoinRsp();
        _testSize(rsp);
        rsp=new JoinRsp(v, d);
        _testSize(rsp);
        rsp=new JoinRsp("this is a failure");
View Full Code Here

Examples of org.jgroups.protocols.pbcast.Digest

        hdr=new STATE_TRANSFER.StateHeader(STATE_TRANSFER.StateHeader.STATE_REQ, addr, 322649, null, "my_state");
        _testSize(hdr);


        Digest digest=new Digest(2);
        digest.add(addr, 100, 200, 205);
        digest.add(new IpAddress(2314), 102, 104, 105);
        hdr=new STATE_TRANSFER.StateHeader(STATE_TRANSFER.StateHeader.STATE_RSP, addr, 322649, digest);
        _testSize(hdr);

        hdr=new STATE_TRANSFER.StateHeader(STATE_TRANSFER.StateHeader.STATE_RSP, addr, 322649, digest, "my_state");
        _testSize(hdr);
View Full Code Here

Examples of org.jgroups.protocols.pbcast.Digest

    }


    public void setUp() throws Exception {
        super.setUp();
        d=new Digest(3);
        a1=new IpAddress(5555);
        a2=new IpAddress(6666);
        a3=new IpAddress(7777);
        d.add(a1, 4, 500, 501);
        d.add(a2, 25, 26, 26);
View Full Code Here

Examples of org.jgroups.protocols.pbcast.Digest

        d.add(a2, 25, 26, 26);
        d.add(a3, 20, 25, 33);
    }

    public void testSize() {
        d2=new Digest(3);
        assertEquals(0, d2.size());
    }
View Full Code Here

Examples of org.jgroups.protocols.pbcast.Digest

        d.add(d2);
        assertEquals(3, d.size());
    }

    public void testAddDigest2() {
        d2=new Digest(4);
        d2.add(new IpAddress(1111), 1,2,3);
        d2.add(new IpAddress(2222), 1,2,3);
        d2.add(new IpAddress(5555), 1,2,3);
        d2.add(new IpAddress(6666), 1,2,3);
        d.add(d2);
View Full Code Here

Examples of org.jgroups.protocols.pbcast.Digest

        entry=d.get(a3);
        assertEquals(entry, new Digest.Entry(20,25,33));
    }

    public void testIncrementHighSeqno() {
        d2=new Digest(3);
        d2.add(a1, 1, 100);
        d2.add(a2, 3, 300);
        d2.add(a3, 7, 700);

        long tmp=d2.highSeqnoAt(a1);
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.