Examples of sign()


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

        Document doc = dbf.newDocumentBuilder().newDocument();
        XMLSignature sig = new XMLSignature
            (doc, null, XMLSignature.ALGO_ID_MAC_HMAC_SHA1, 40,
             Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
        try {
            sig.sign(getSecretKey("secret".getBytes("ASCII")));
            System.out.println("FAILED");
            atLeastOneFailed = true;
        } catch (XMLSignatureException xse) {
            System.out.println(xse.getMessage());
            System.out.println("PASSED");
View Full Code Here

Examples of com.sun.xml.ws.security.opt.crypto.dsig.internal.HmacSHA1.sign()

        HmacSHA1 mac = new HmacSHA1();
        mac.init((Key) keySpec, keylength);
        mac.update(data);

        byte[] signature = mac.sign();

        return signature;

    }
View Full Code Here

Examples of com.sun.xml.wss.saml.Assertion.sign()

        final PrivateKey stsPrivKey = (PrivateKey)ctx.getOtherProperties().get(IssuedTokenContext.STS_PRIVATE_KEY);
           
        // Sign the assertion with STS's private key
        Element signedAssertion = null;
        try{           
            signedAssertion = assertion.sign(stsCert, stsPrivKey, true, ctx.getSignatureAlgorithm(), ctx.getCanonicalizationAlgorithm());           
            //signedAssertion = assertion.sign(stsCert, stsPrivKey, true);           
            //signedAssertion = assertion.sign(stsCert, stsPrivKey);
        }catch (SAMLException ex){
            log.log(Level.SEVERE,
                    LogStringsMessages.WST_0032_ERROR_CREATING_SAML_ASSERTION(), ex);
View Full Code Here

Examples of com.valhalla.misc.GnuPG.sign()

            gnupg = new GnuPG();

            String gnupgSecretKeyID = Settings.getInstance().getProperty(
                    "gnupgSecretKeyID");

            if (gnupg.sign("1", gnupgSecretKeyID, pass)) {
                BuddyList.getInstance().setGnuPGPassword(pass);
            } else {
                BuddyList.getInstance().setGnuPGPassword(null);
                Standard.warningMessage(null, "GnuPG", resources
                        .getString("gnupgBadSavedPassword"));
View Full Code Here

Examples of com.valhalla.misc.GnuPG.sign()

            while (true) {
                PasswordDialog dialog = new PasswordDialog(BuddyList.getInstance().getContainerFrame(),resources
                        .getString("gnupgKeyPassword"));
                gnupgTempPass = dialog.getText();
                if ((gnupgTempPass != null)
                        && (gnupg.sign("1", gnupgSecretKey, gnupgTempPass))) {
                    BuddyList.getInstance().setGnuPGPassword(gnupgTempPass);
                    break;
                } else {
                    BuddyList.getInstance().getStatusMenu()
                            .stopBlinkTimer();
View Full Code Here

Examples of com.valhalla.misc.GnuPG.sign()

            } else {
                check = false;
            }

            if (!check
                    || ((gnupgTempPass != null) && (gnupg.sign("1",
                            gnupgSecretKeyID, gnupgTempPass)))) {
                BuddyList.getInstance().setGnuPGPassword(gnupgTempPass);
            } else {
                BuddyList.getInstance().setGnuPGPassword(null);
                Standard
View Full Code Here

Examples of gnu.java.security.sig.ISignature.sign()

                buf = serverRandom.getEncoded();
                sig.update(buf, 0, buf.length);
                updateSig(sig, pubkey.getParams().getP());
                updateSig(sig, pubkey.getParams().getG());
                updateSig(sig, pubkey.getY());
                s = new Signature(sig.sign(), suite.getSignature());
              }
            skex = new ServerKeyExchange(pubkey, s);
          }
        else if (suite.getKeyExchange() == "SRP")
          {
View Full Code Here

Examples of iaik.x509.X509Certificate.sign()

      String comment = getEntry("A comment for the certificate user", "");
      if (!comment.equals("")) {
    cert.addExtension(new NetscapeComment(comment));
      }
      cert.sign(AlgorithmID.md5WithRSAEncryption,kp.getPrivate());

      X509Certificate[] chain = new X509Certificate[1];
      chain[0] = cert;

      /* encrypt the key and save the cert */
 
View Full Code Here

Examples of java.security.Signature.sign()

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(tbsCert);
        v.add(sigAlgId);
        v.add(new DERBitString(sig.sign()));

        return new X509CertificateObject(new X509CertificateStructure(new DERSequence(v)));
    }
}
View Full Code Here

Examples of java.security.Signature.sign()

    // control over auto-update process and prevent people from injecting
    // potentially huge bogus updates
 
    signature.update( encode( hash, version, size ));

    return( signature.sign());
  }
 
  protected static boolean
  verify(
    byte[]    public_key,
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.