Package org.apache.xml.security.signature

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


        }
       
       
        sig.addKeyInfo(issuerCerts[0]);
        sig.addKeyInfo(issuerCerts[0].getPublicKey());
        sig.sign(privateKey);
        return sig.getElement().getOwnerDocument();
    }
   
    private XMLSignature prepareEnvelopingSignature(Document doc,
                                                    String id,
View Full Code Here


        sig.addKeyInfo(certChain);
      } else {
        sig.addKeyInfo(this.cert);
      }

      sig.sign(this.privateKey);

      return sig.getElement();
    } catch (Exception e) {
      throw new CardModelException(CardModelException.DEFAULT, e);
    }
View Full Code Here

            transforms
                    .addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
            signature.addDocument(elementRefId, transforms,
                    MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1);

            signature.sign(signKey);
            return signature;

        } catch (XMLSecurityException se) {
            throw new XKMSException(se);
        }
View Full Code Here

                    MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1);

            signature.addKeyInfo(signCert);
            signature.addKeyInfo(signCert.getPublicKey());

            signature.sign(signKey);

        } catch (XMLSecurityException xmse) {
            throw new XKMSException(xmse);
        }
    }
View Full Code Here

                    transforms
                            .addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
                    keyBindingAuthSignature.addDocument(
                            prototypeKeyBindingRefId, transforms,
                            MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1);
                    keyBindingAuthSignature.sign(key);
                    authentication
                            .setKeyBindingAuthentication(keyBindingAuthSignature);

                } catch (XMLSecurityException xse) {
                    throw new XKMSException(xse);
View Full Code Here

      oTrans.addTransform(oTransforms[i]);
    }
    oSig.addDocument("#" + sID, oTrans);
   
    // now finally sign the thing
    oSig.sign(oKey);
   
    // now sub in this element
    Element oSigElem = oSig.getElement();
   
    // insert the signature in the right place
View Full Code Here

      oTrans.addTransform(oTransforms[i]);
    }
    oSig.addDocument("#" + sID, oTrans);
   
    // now finally sign the thing
    oSig.sign(oKey);
   
    // now sub in this element
    Element oSigElem = oSig.getElement();
   
    // insert the signature in the right place
View Full Code Here

      oTrans.addTransform(oTransforms[i]);
    }
    oSig.addDocument("#" + sID, oTrans);
   
    // now finally sign the thing
    oSig.sign(oKey);
   
    // now sub in this element
    Element oSigElem = oSig.getElement();
   
    // insert the signature in the right place
View Full Code Here

   
    // insert the signature in the right place
    oAssertionElem.insertBefore(oSigElem, oSubjectElem);
   
                // now finally sign the thing
    oSig.sign(oKey);
  }
 
  /**
   * This will verify the XRD against the given public key.  DOM
   * must already be associated with this descriptor.
View Full Code Here

                    sig.addDocument(referenceInfo.getResource(), transforms, referenceInfo.getDigestMethod());
                }
            }
        }

        sig.sign(signingKey);

        String expression = "//ds:Signature[1]";
        Element sigElement =
                (Element) xpath.evaluate(expression, document, XPathConstants.NODE);
        Assert.assertNotNull(sigElement);
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.