Examples of sign()


Examples of org.apache.xml.security.signature.XMLSignature.sign()

    sig.addDocument("", transforms, org.apache.xml.security.utils.Constants.ALGO_ID_DIGEST_SHA1);
    String[] refs = options.getReferences();
    for (String ref : refs) sig.addDocument(ref);
    sig.addKeyInfo(cert);
    sig.addKeyInfo(cert.getPublicKey());
    sig.sign(signingKey);   
    return (T)domToFom(dom, options);
  }
 
  public <T extends Element>T sign(
    T entry,
View Full Code Here

Examples of org.bouncycastle.jce.netscape.NetscapeCertRequest.sign()

            kpg.initialize (1024);

            KeyPair kp = kpg.genKeyPair();

            nscr.setPublicKey (kp.getPublic());
            nscr.sign (kp.getPrivate());
           
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            DEROutputStream deros = new DEROutputStream (baos);
            deros.writeObject (nscr);
            deros.close();
View Full Code Here

Examples of org.ethereum.core.Transaction.sign()

        byte[] gas =      Hex.decode("4255");

        Transaction tx = new Transaction(null, value.toByteArray(),
                ecKey.getAddress(),  gasPrice, gas, null);

        tx.sign(privKey);
        tx.getEncoded();

        Set<Transaction> txs = new HashSet<>(Arrays.asList(tx));
        TransactionsMessage transactionsMessage = new TransactionsMessage(txs);
View Full Code Here

Examples of org.ethereum.crypto.ECKey.sign()

    ECKey key = ECKey.fromPrivate(privateKey).decompress();
        System.out.println("Secret\t: " + Hex.toHexString(key.getPrivKeyBytes()));
        System.out.println("Pubkey\t: " + Hex.toHexString(key.getPubKey()));
        System.out.println("Data\t: " + exampleMessage);
        byte[] messageHash = HashUtil.sha3(exampleMessage.getBytes());
        ECDSASignature signature = key.sign(messageHash);
        String output = signature.toBase64();
        System.out.println("Signtr\t: " + output + " (Base64, length: " + output.length() + ")");
        assertEquals(sigBase64, output);
  }
 
View Full Code Here

Examples of org.hive2hive.core.security.H2HSignatureFactory.sign()

    FuturePut futurePut = p1.put(lKey).setDomainKey(dKey).setData(cKey, data).setVersionKey(vKey).start();
    futurePut.awaitUninterruptibly();
    Assert.assertTrue(futurePut.isSuccess());

    // create signature with keys 1 having the data object
    byte[] signature1 = factory.sign(keyPair1.getPrivate(), data.buffer()).encode();

    // decrypt signature to get hash of the object
    Cipher rsa = Cipher.getInstance("RSA");
    rsa.init(Cipher.DECRYPT_MODE, keyPair1.getPublic());
    byte[] hash = rsa.doFinal(signature1);
View Full Code Here

Examples of org.jboss.aerogear.crypto.signature.SigningKey.sign()

    @Test
    public void testSignMessageAsBytes() throws Exception {
        SigningKey key = new SigningKey();
        byte[] signMessage = HEX.decode(SIGN_MESSAGE);
        byte[] signedMessage = key.sign(HEX.decode(SIGN_MESSAGE));
        VerifyKey verifyKey = new VerifyKey(key.getPublicKey());
        Boolean isValid = verifyKey.verify(signMessage, signedMessage);
        assertTrue("Message sign has failed", isValid);
    }
View Full Code Here

Examples of org.jboss.identity.federation.api.saml.v2.sig.SAML2Signature.sign()

      if(supportSignature && hasSAMLRequestInPostProfile())
      {
         try
         {
            SAML2Signature saml2Signature = new SAML2Signature();
            samlResponseDocument = saml2Signature.sign(responseType, keyManager.getSigningKeyPair());
        
         catch (Exception e)
         { 
            if(trace) log.trace(e);
         }
View Full Code Here

Examples of org.jboss.resteasy.security.doseta.DKIMSignature.sign()

      public Response badHash() throws Exception
      {
         DKIMSignature signature = new DKIMSignature();
         signature.setDomain("samplezone.org");
         signature.setSelector("test");
         signature.sign(new HashMap(), "hello world".getBytes(), keys.getPrivate());

         return Response.ok("hello").header(DKIMSignature.DKIM_SIGNATURE, signature.toString()).build();
      }

      @GET
View Full Code Here

Examples of org.jboss.resteasy.security.doseta.DKIMSignature.sign()

   {
      DKIMSignature signature = new DKIMSignature();
      signature.setTimestamp();
      signature.setSelector("test");
      signature.setDomain("samplezone.org");
      signature.sign(new HashMap(), "hello world".getBytes(), keys.getPrivate());
      String sig = signature.toString();
      System.out.println(DKIMSignature.DKIM_SIGNATURE + ": " + sig);
      signature = new DKIMSignature(sig);

   }
View Full Code Here

Examples of org.jboss.resteasy.security.doseta.DKIMSignature.sign()

      public Response badSignature() throws Exception
      {
         DKIMSignature signature = new DKIMSignature();
         signature.setDomain("samplezone.org");
         signature.setSelector("test");
         signature.sign(new HashMap(), "hello world".getBytes(), keys.getPrivate());

         byte[] sig = {0x0f, 0x03};
         String encodedBadSig = Base64.encodeBytes(sig);

         ParameterParser parser = new ParameterParser();
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.