Examples of KeyInfo


Examples of com.sun.org.apache.xml.internal.security.keys.KeyInfo

    if (_key == null) {

      if (logger.isLoggable(java.util.logging.Level.FINE))                                     logger.log(java.util.logging.Level.FINE, "Trying to find a KEK via key resolvers");

      KeyInfo ki = encryptedKey.getKeyInfo();
      if (ki != null) {
        try {
          _key = ki.getSecretKey();
        }
        catch (Exception e) {
        }
      }
      if (_key == null) {
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.keys.KeyInfo

        EncryptedData encryptedData = _factory.newEncryptedData(element);

    if (_key == null) {

      KeyInfo ki = encryptedData.getKeyInfo();

      if (ki != null) {
        try {
          // Add a EncryptedKey resolver
          ki.registerInternalKeyResolver(
                   new EncryptedKeyResolver(encryptedData.
                          getEncryptionMethod().
                          getAlgorithm(),
                          _kek));
          _key = ki.getSecretKey();
        } catch (KeyResolverException kre) {
          // We will throw in a second...
        }
      }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.keys.KeyInfo

                    EncryptionConstants.EncryptionSpecNS,
                    EncryptionConstants._TAG_ORIGINATORKEYINFO).item(0);
            if (null != originatorKeyInfoElement) {
                try {
                    result.setOriginatorKeyInfo(
                        new KeyInfo(originatorKeyInfoElement, null));
                } catch (XMLSecurityException xse) {
                    throw new XMLEncryptionException("empty", xse);
                }
            }

            // TODO: Work out how to handle relative URI

            Element recipientKeyInfoElement =
                (Element) element.getElementsByTagNameNS(
                    EncryptionConstants.EncryptionSpecNS,
                    EncryptionConstants._TAG_RECIPIENTKEYINFO).item(0);
            if (null != recipientKeyInfoElement) {
                try {
                    result.setRecipientKeyInfo(
                        new KeyInfo(recipientKeyInfoElement, null));
                } catch (XMLSecurityException xse) {
                    throw new XMLEncryptionException("empty", xse);
                }
            }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.keys.KeyInfo

            Element keyInfoElement =
                (Element) element.getElementsByTagNameNS(
                    Constants.SignatureSpecNS, Constants._TAG_KEYINFO).item(0);
            if (null != keyInfoElement) {
        try {
          result.setKeyInfo(new KeyInfo(keyInfoElement, null));
        } catch (XMLSecurityException xse) {
          throw new XMLEncryptionException("Error loading Key Info",
                           xse);
        }
            }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.keys.KeyInfo

            Element keyInfoElement =
                (Element) element.getElementsByTagNameNS(
                    Constants.SignatureSpecNS, Constants._TAG_KEYINFO).item(0);
            if (null != keyInfoElement) {
        try {
          result.setKeyInfo(new KeyInfo(keyInfoElement, null));
        } catch (XMLSecurityException xse) {
          throw new XMLEncryptionException("Error loading Key Info",
                           xse);
        }
            }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.security.keys.KeyInfo

      Element keyInfoElem =XMLUtils.selectDsNode(this._constructionElement.getFirstChild(),
                               Constants._TAG_KEYINFO,0);

      // If it exists use it, but it's not mandatory
      if (keyInfoElem != null) {
         this._keyInfo = new KeyInfo(keyInfoElem, BaseURI);
      }
   }
View Full Code Here

Examples of com.sun.org.apache.xml.internal.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=null;
         Node sibling= this._constructionElement.getFirstChild();
View Full Code Here

Examples of com.sun.xml.ws.security.opt.crypto.dsig.keyinfo.KeyInfo

       
        return xis;
    }
    @SuppressWarnings("unchecked")
    public KeyInfo createKeyInfo(SecurityTokenReference str){
        KeyInfo keyInfo = new KeyInfo();
        JAXBElement je = new com.sun.xml.ws.security.secext10.ObjectFactory().createSecurityTokenReference(str);
        List strList = Collections.singletonList(je);
        keyInfo.setContent(strList);
        return keyInfo;
    }
View Full Code Here

Examples of io.s4.dispatcher.partitioner.KeyInfo

                compoundKeyInfo.setCompoundKey(plainCompoundKeyInfo.get("compoundKey",
                                                                        (String) null));
                compoundKeys.add(compoundKeyInfo);
                for (EventRecord plainKeyInfo : plainCompoundKeyInfo.get("keyInfoList",
                                                                         EMPTY_LIST)) {
                    KeyInfo keyInfo = new KeyInfo();
                    for (EventRecord plainKeyPathElement : plainKeyInfo.get("keyPathElementList",
                                                                            EMPTY_LIST)) {
                        String keyName = plainKeyPathElement.get("keyName",
                                                                 (String) null);
                        Integer index = plainKeyPathElement.get("index",
                                                                (Integer) null);

                        if (keyName != null) {
                            keyInfo.addElementToPath(keyName);
                        } else if (index != null) {
                            keyInfo.addElementToPath(index);
                        }
                    }
                    compoundKeyInfo.addKeyInfo(keyInfo);
                }
            }
        }
        if (debug) {
            for (CompoundKeyInfo compoundKeyInfo : compoundKeys) {
                System.out.println("CompoundKey: "
                        + compoundKeyInfo.getCompoundValue());
                for (KeyInfo keyInfo : compoundKeyInfo.getKeyInfoList()) {
                    String keyPath = "";
                    for (KeyPathElement keyPathElement : keyInfo.getKeyPath()) {
                        if (keyPathElement instanceof KeyPathElementIndex) {
                            keyPath += "["
                                    + ((KeyPathElementIndex) keyPathElement).getIndex()
                                    + "]";
                        } else {
View Full Code Here

Examples of javax.xml.crypto.dsig.keyinfo.KeyInfo

        }

        if (!(o instanceof KeyInfo)) {
            return false;
        }
        KeyInfo oki = (KeyInfo)o;

        boolean idsEqual = id == null ? oki.getId() == null
                                       : id.equals(oki.getId());

        return keyInfoTypes.equals(oki.getContent()) && idsEqual;
    }
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.