Examples of KeyInfo


Examples of org.apache.xml.security.keys.KeyInfo

        if (includeki && kek != null && dek != null) {
          XMLCipher keyCipher = XMLCipher.getInstance(kalg);
          keyCipher.init(XMLCipher.WRAP_MODE, kek);
          enckey = keyCipher.encryptKey(dom, dek);
          EncryptedData encdata = xmlCipher.getEncryptedData();
          KeyInfo keyInfo = new KeyInfo(dom);
          keyInfo.add(enckey);
          encdata.setKeyInfo(keyInfo);
        }
        dom = xmlCipher.doFinal(dom, dom.getDocumentElement(), false);
        return domToFom(dom, options);
      } catch (Exception e) {
View Full Code Here

Examples of org.apache.xml.security.keys.KeyInfo

            if (signedElement.hasAttributeNS(null, "Id")) {
                signedElement.setIdAttributeNS(null, "Id", true);
            }
           
            // See also WSS4J SAMLUtil.getCredentialFromKeyInfo
            KeyInfo keyInfo = signature.getKeyInfo();
           
            X509Certificate cert = keyInfo.getX509Certificate();
            if (cert != null) {
                valid = signature.checkSignatureValue(cert);
            } else {
                PublicKey pk = keyInfo.getPublicKey();
                if (pk != null) {
                    valid = signature.checkSignatureValue(pk);
                }
            }
           
            // validate trust
            new TrustValidator().validateTrust(crypto, cert, keyInfo.getPublicKey());
           
            if (valid && persistSignature) {
                message.setContent(XMLSignature.class, signature);
                message.setContent(Element.class, signedElement);
            }
View Full Code Here

Examples of org.apache.xml.security.keys.KeyInfo

    private void embedKeyInfoInEncryptedData(Document document, XMLCipher keyCipher, XMLCipher xmlCipher, Key dataEncryptionkey)
        throws XMLEncryptionException {

        EncryptedKey encryptedKey = keyCipher.encryptKey(document, dataEncryptionkey, mgfAlgorithm, null);
        KeyInfo keyInfo = new KeyInfo(document);
        keyInfo.add(encryptedKey);   
        EncryptedData encryptedDataElement = xmlCipher.getEncryptedData();
        encryptedDataElement.setKeyInfo(keyInfo);
    }
View Full Code Here

Examples of org.apache.xml.security.keys.KeyInfo

    private void embedKeyInfoInEncryptedData(Document document, XMLCipher keyCipher, XMLCipher xmlCipher, Key dataEncryptionkey)
        throws XMLEncryptionException {

        EncryptedKey encryptedKey = keyCipher.encryptKey(document, dataEncryptionkey);
        KeyInfo keyInfo = new KeyInfo(document);
        keyInfo.add(encryptedKey);   
        EncryptedData encryptedDataElement = xmlCipher.getEncryptedData();
        encryptedDataElement.setKeyInfo(keyInfo);
    }
View Full Code Here

Examples of org.apache.xml.security.keys.KeyInfo

        // If it exists use it, but it's not mandatory
        if (keyInfoElem != null &&
            keyInfoElem.getNamespaceURI().equals(Constants.SignatureSpecNS) &&
            keyInfoElem.getLocalName().equals(Constants._TAG_KEYINFO)) {
            this._keyInfo = new KeyInfo(keyInfoElem, BaseURI);
        }

        this._state = MODE_VERIFY;
    }
View Full Code Here

Examples of org.apache.xml.security.keys.KeyInfo

        // check to see if we are signing and if we have to create a keyinfo
        if (this._state == MODE_SIGN && this._keyInfo == null) {

            // create the KeyInfo
            this._keyInfo = new KeyInfo(this._doc);

            // get the Element from KeyInfo
            Element keyInfoElement = this._keyInfo.getElement();
            Element firstObject = XMLUtils.selectDsNode
                (this._constructionElement.getFirstChild(),
View Full Code Here

Examples of org.apache.xml.security.keys.KeyInfo

    private void embedKeyInfoInEncryptedData(Document document, XMLCipher keyCipher, XMLCipher xmlCipher, Key dataEncryptionkey)
        throws XMLEncryptionException {

        EncryptedKey encryptedKey = keyCipher.encryptKey(document, dataEncryptionkey, mgfAlgorithm, null);
        KeyInfo keyInfo = new KeyInfo(document);
        keyInfo.add(encryptedKey);   
        EncryptedData encryptedDataElement = xmlCipher.getEncryptedData();
        encryptedDataElement.setKeyInfo(keyInfo);
    }
View Full Code Here

Examples of org.boco.seamwebappgen.info.KeyInfo

            localSearchCondition += "\t\t\t\tqb.addSingleValueListBoxWhere(\"o." + Utils.makeMethod2Field(attr.getRelationship().getName()) + ".id = \"+localSearch" + attr.getRelationship().getName() + Utils.makeFirstLetterUpperCase(attr.getName()) + ".getId(), localSearch" + attr.getRelationship().getName() + Utils.makeFirstLetterUpperCase(attr.getName()) + ".getId().toString());\r\n";
          else
          {
            for (int h = 0; h < keyInfo.size(); h++)
            {
              KeyInfo ki = keyInfo.get(h);

              if (ki.isString())
                localSearchCondition += "\t\t\t\tqb.addSingleValueListBoxWhere(\"o." + Utils.makeMethod2Field(attr.getRelationship().getName()) + ".id." + ki.getField() + " ='\"+localSearch" + attr.getRelationship().getName() + Utils.makeFirstLetterUpperCase(attr.getName()) + ".getId()." + ki.getMethod() + "()+\"'\", localSearch" + attr.getRelationship().getName() + Utils.makeFirstLetterUpperCase(attr.getName()) + ".getId().toString());\r\n";
              else
                localSearchCondition += "\t\t\t\tqb.addSingleValueListBoxWhere(\"o." + Utils.makeMethod2Field(attr.getRelationship().getName()) + ".id." + ki.getField() + " = \"+localSearch" + attr.getRelationship().getName() + Utils.makeFirstLetterUpperCase(attr.getName()) + ".getId()." + ki.getMethod() + "(), localSearch" + attr.getRelationship().getName() + Utils.makeFirstLetterUpperCase(attr.getName()) + ".getId().toString());\r\n";
            }
          }
          localSearchCondition += "\t\t\t}\r\n";
        }
        else
View Full Code Here

Examples of org.opensaml.xml.signature.KeyInfo

        if (samlAssertion.isSigned()) {
            // Check for compliance against the defined AlgorithmSuite
            AlgorithmSuite algorithmSuite = data.getSamlAlgorithmSuite();
           
            Signature sig = samlAssertion.getSignature();
            KeyInfo keyInfo = sig.getKeyInfo();
            if (keyInfo == null) {
                throw new WSSecurityException(
                    WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
                    "cannot get certificate or key"
                );
            }
            SAMLKeyInfo samlKeyInfo =
                SAMLUtil.getCredentialFromKeyInfo(
                    keyInfo.getDOM(), new WSSSAMLKeyInfoProcessor(data, docInfo), data.getSigVerCrypto()
                );
           
            if (algorithmSuite != null) {
                AlgorithmSuiteValidator algorithmSuiteValidator = new
                    AlgorithmSuiteValidator(algorithmSuite);
View Full Code Here

Examples of org.opensaml.xml.signature.KeyInfo

    public static SubjectConfirmationData createSubjectConfirmationData(
        SubjectConfirmationDataBean subjectConfirmationDataBean,
        KeyInfoBean keyInfoBean
    ) throws org.opensaml.xml.security.SecurityException, WSSecurityException {
        SubjectConfirmationData subjectConfirmationData = null;
        KeyInfo keyInfo = null;
        if (keyInfoBean == null) {
            if (subjectConfirmationDataBuilder == null) {
                subjectConfirmationDataBuilder = (SAMLObjectBuilder<SubjectConfirmationData>)
                    builderFactory.getBuilder(SubjectConfirmationData.DEFAULT_ELEMENT_NAME);
            }
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.