Examples of Digest


Examples of ch.ethz.ssh2.crypto.digest.Digest

   * @param hostkey the hostkey
   * @return the raw fingerprint
   */
  static final private byte[] rawFingerPrint(String type, String keyType, byte[] hostkey)
  {
    Digest dig = null;

    if ("md5".equals(type))
    {
      dig = new MD5();
    }
    else if ("sha1".equals(type))
    {
      dig = new SHA1();
    }
    else
      throw new IllegalArgumentException("Unknown hash type " + type);

    if ("ssh-rsa".equals(keyType))
    {
    }
    else if ("ssh-dss".equals(keyType))
    {
    }
    else
      throw new IllegalArgumentException("Unknown key type " + keyType);

    if (hostkey == null)
      throw new IllegalArgumentException("hostkey is null");

    dig.update(hostkey);
    byte[] res = new byte[dig.getDigestLength()];
    dig.digest(res);
    return res;
  }
View Full Code Here

Examples of com.antimatterstudios.esftp.Digest

    //System.out.println("TRACE-> TransferDetails::getKey()");
    //  Cache the key so you only have to do this once per object
    if(m_key == null){
      //System,out.println("creating key");
      //  Obtain the hash object from the SftpPlugin object
      Digest h = Activator.getDefault().getHash();
     
      //  Create a single string from all the data for this server (DONT INCLUDE THE PASSWORD)
      String str = m_store.getString(IProperty.SERVER)+":"+m_store.getInt(IProperty.PORT)+":"+m_store.getString(IProperty.USERNAME)+":";
     
      m_key = h.getDigest(str);
    }//else System.out.println("TransferDetails::getKey(), using cached copy");
    return m_key;
  }
View Full Code Here

Examples of com.esri.gpt.framework.security.codec.Digest

    setResponseCode(httpCon.getResponseCode());
    setResponseCodeText(httpCon.getResponseMessage());

    // not authenticated; setup digest authentication and resend request
    if (getResponseCode() == 401) {
      Digest digResp = Digest.extractFrom(httpCon);
      if (digResp.isValid()) {

        // reconnect
        httpCon.disconnect();
        httpCon = openConnection(sMethod, bSendData);
        // setup credentials
        digResp.injectTo(httpCon,(UsernamePasswordCredentials)getCredentials());
        // send data if required
        if (bSendData) {
          sendData(httpCon);
        }
View Full Code Here

Examples of com.google.wave.api.SearchResult.Digest

  }

  public void testSearchWrapsSearchProvidersResult() throws InvalidRequestException {
    String title = "title";
    SearchResult.Digest digest =
        new Digest(title, "", WAVE_ID.serialise(), ImmutableList.of(PARTICIPANT.getAddress(),
            OTHER_PARTICIPANT.getAddress()), -1L, -1L, 1, 1);
    String query = "in:inbox";
    SearchResult searchResult = new SearchResult(query);
    searchResult.addDigest(digest);
    when(searchProvider.search(USER, query, 0, 10)).thenReturn(searchResult);
View Full Code Here

Examples of com.google.wave.api.SearchResult.Digest

      new TestingWaveletData(WAVE_ID, CONVERSATION_WAVELET_ID, PARTICIPANT, false);
    final Collection<WaveViewData> providerResults = Arrays.asList(data.copyViewData());

    String query = "in:inbox";
    SearchResult.Digest digest =
        new Digest("", "", WAVE_ID.serialise(), ImmutableList.of(PARTICIPANT.getAddress()), -1L,
            -1L, 1, 1);
    SearchResult searchResult = new SearchResult(query);
    searchResult.addDigest(digest);
    when(searchProvider.search(USER, query, 0, 10)).thenReturn(searchResult);
    service.execute(operation, context, USER);
View Full Code Here

Examples of com.google.wave.api.SearchResult.Digest

        SearchResult results = (SearchResult) resultsObj;

        assertEquals(query, results.getQuery());
        assertEquals(1, results.getNumResults());

        Digest digest = results.getDigests().get(0);
        assertEquals(title, digest.getTitle());
        assertEquals(ApiIdSerializer.instance().serialiseWaveId(waveId), digest.getWaveId());

        Builder<ParticipantId> participantIds = ImmutableSet.builder();
        for (String name : digest.getParticipants()) {
          participantIds.add(ParticipantId.ofUnsafe(name));
        }
        assertEquals(participants, participantIds.build());

        assertEquals(unreadCount, digest.getUnreadCount());
        assertEquals(blipCount, digest.getBlipCount());
        return true;
      }

      @Override
      public void describeTo(Description description) {
View Full Code Here

Examples of com.subhajit.diagrams.codeanalysis.Digest

      for (String sourcePath : StrUtils.parse(args[3], IConstants.COMMA)) {
        sourceDirs.add(new File(sourcePath));
      }
      final File outputFile = new File(args[4]);

      Digest digest = new Digest(new ZipFile(digestFile));
      DigestBasedSequenceDiagramGenerator gen = new DigestBasedSequenceDiagramGenerator(
          digest);
      DigestBasedSequenceDiagramContext ctx = new DigestBasedSequenceDiagramContext();
      ctx.setFilters(filters);
      ctx.setFollowInvokedMethods(true);
      ctx.setShowInstructions(false);
      ctx.setShowSourceCode(true);
      ctx.setSrcCodeManager(new SourceCodeManager(sourceDirs
          .toArray(IConstants.ZERO_LENGTH_FILE_ARRAY)));

      ctx.setClassName(className);
      // Create a temporary directory under which the diagrams will be
      // generated.
      final File tempDir = new File(IConstants.JAVA_IO_TMPDIR_PATH, UUID
          .randomUUID().toString());
      try {
        if (!tempDir.mkdirs()) {
          throw new IOException(
              "Could not create temporary directory - "
                  + tempDir.getAbsolutePath());
        }
        Set<MethodInfo> methods = digest.load(className).keySet();
        for (MethodInfo method : methods) {
          ctx.setMethod(method);
          try {
            // Generate the sequence diagram specification.
            final String sequenceDiagramSpec = gen
View Full Code Here

Examples of flex2.compiler.swc.Digest

            Swc swc = swcContext.getSwc(swcPath);

            // write digest for each rsl in the list
            boolean secureRsls = configuration.getVerifyDigests();
            Boolean isSigned = (Boolean)info.getSignedFlags().get(i);
            Digest digest = swc.getDigest(Swc.LIBRARY_SWF,
                    Digest.SHA_256,
                    isSigned.booleanValue());

            if (digest == null || !digest.hasDigest())
            {
                // if the digest is not available then throw an exception,
                // "No digest found in catalog.xml. Either compile the application with
                // the -verify-digests=false or compile the library with
                // -create-digest=true"
                if (isSigned.booleanValue()) {
                    ThreadLocalToolkit.log(new MissingSignedLibraryDigest(swc.getLocation()));
                }
                else {
                    ThreadLocalToolkit.log(new MissingUnsignedLibraryDigest(swc.getLocation()));
                }
                return;
            }
           
            buf.append("\"" + digest.getValue() + "\",\n");
            buf.append("\"" + digest.getType() + "\",");
            buf.append(info.getSignedFlags().get(i) + ",");
            buf.append(secureRsls + ",");
            buf.append("\"" +  rslSettingsConfig.getApplicationDomain(swcPath) + "\"");
           
            // end of one object in the array
View Full Code Here

Examples of net.schmizz.sshj.transport.digest.Digest

    }

    /* See Sec. 7.2. "Output from Key Exchange", RFC 4253 */

    private void gotNewKeys() {
        final Digest hash = kex.getHash();

        final byte[] H = kex.getH();

        if (sessionID == null)
            // session id is 'H' from the first key exchange and does not change thereafter
            sessionID = H;

        final Buffer.PlainBuffer hashInput = new Buffer.PlainBuffer()
                .putMPInt(kex.getK())
                .putRawBytes(H)
                .putByte((byte) 0) // <placeholder>
                .putRawBytes(sessionID);
        final int pos = hashInput.available() - sessionID.length - 1; // Position of <placeholder>

        hashInput.array()[pos] = 'A';
        hash.update(hashInput.array(), 0, hashInput.available());
        final byte[] initialIV_C2S = hash.digest();

        hashInput.array()[pos] = 'B';
        hash.update(hashInput.array(), 0, hashInput.available());
        final byte[] initialIV_S2C = hash.digest();

        hashInput.array()[pos] = 'C';
        hash.update(hashInput.array(), 0, hashInput.available());
        final byte[] encryptionKey_C2S = hash.digest();

        hashInput.array()[pos] = 'D';
        hash.update(hashInput.array(), 0, hashInput.available());
        final byte[] encryptionKey_S2C = hash.digest();

        hashInput.array()[pos] = 'E';
        hash.update(hashInput.array(), 0, hashInput.available());
        final byte[] integrityKey_C2S = hash.digest();

        hashInput.array()[pos] = 'F';
        hash.update(hashInput.array(), 0, hashInput.available());
        final byte[] integrityKey_S2C = hash.digest();

        final Cipher cipher_C2S = Factory.Named.Util.create(transport.getConfig().getCipherFactories(),
                                                            negotiatedAlgs.getClient2ServerCipherAlgorithm());
        cipher_C2S.init(Cipher.Mode.Encrypt,
                        resizedKey(encryptionKey_C2S, cipher_C2S.getBlockSize(), hash, kex.getK(), kex.getH()),
View Full Code Here

Examples of org.apache.sshd.common.Digest

        byte[] Es2c;
        byte[] MACc2s;
        byte[] MACs2c;
        byte[] K = kex.getK();
        byte[] H = kex.getH();
        Digest hash = kex.getHash();
        Cipher s2ccipher;
        Cipher c2scipher;
        Mac s2cmac;
        Mac c2smac;
        Compression s2ccomp;
        Compression c2scomp;

        if (sessionId == null) {
            sessionId = new byte[H.length];
            System.arraycopy(H, 0, sessionId, 0, H.length);
        }

        Buffer buffer = new Buffer();
        buffer.putMPInt(K);
        buffer.putRawBytes(H);
        buffer.putByte((byte) 0x41);
        buffer.putRawBytes(sessionId);
        int pos = buffer.available();
        byte[] buf = buffer.array();
        hash.update(buf, 0, pos);
        IVc2s = hash.digest();

        int j = pos - sessionId.length - 1;

        buf[j]++;
        hash.update(buf, 0, pos);
        IVs2c = hash.digest();

        buf[j]++;
        hash.update(buf, 0, pos);
        Ec2s = hash.digest();

        buf[j]++;
        hash.update(buf, 0, pos);
        Es2c = hash.digest();

        buf[j]++;
        hash.update(buf, 0, pos);
        MACc2s = hash.digest();

        buf[j]++;
        hash.update(buf, 0, pos);
        MACs2c = hash.digest();

        s2ccipher = NamedFactory.Utils.create(factoryManager.getCipherFactories(), negotiated[SshConstants.PROPOSAL_ENC_ALGS_STOC]);
        Es2c = resizeKey(Es2c, s2ccipher.getBlockSize(), hash, K, H);
        s2ccipher.init(isServer ? Cipher.Mode.Encrypt : Cipher.Mode.Decrypt, Es2c, IVs2c);
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.