Package org.apache.xml.security.keys.content

Examples of org.apache.xml.security.keys.content.KeyValue


        Document doc = db.parse(new FileInputStream(f));
        NodeList nl = doc.getElementsByTagNameNS(Constants.SignatureSpecNS, "Signature");
        XMLSignature sig = new XMLSignature
            ((Element) nl.item(0), f.toURI().toURL().toString());
        KeyInfo ki = sig.getKeyInfo();
        KeyValue kv = ki.itemKeyValue(0);
        PublicKey pk = kv.getPublicKey();
        assertNotNull(pk);
    }
View Full Code Here


            if (keyInfoHb.containsSecurityTokenReference()){
                kek = processSecurityTokenReference(keyInfoHb, callbackHandler);
            } else if (keyInfoHb.containsKeyValue()) {
              
                SecurityEnvironment secEnv = new DefaultSecurityEnvironmentImpl(callbackHandler);
                KeyValue keyValue = keyInfoHb.getKeyValue(0);
                keyValue.getElement().normalize();
                kek = secEnv.getPrivateKey(null, keyValue.getPublicKey(), false);
               
            } else if (keyInfoHb.containsX509Data()) {
                kek = processX509Data(keyInfoHb, callbackHandler);               
            }
            else{
View Full Code Here

     * Method addKeyValue
     *
     * @param pk
     */
    public void addKeyValue(PublicKey pk) {
        this.add(new KeyValue(this.doc, pk));
    }
View Full Code Here

     * Method addKeyValue
     *
     * @param unknownKeyValueElement
     */
    public void addKeyValue(Element unknownKeyValueElement) {
        this.add(new KeyValue(this.doc, unknownKeyValueElement));
    }
View Full Code Here

     * Method add
     *
     * @param dsakeyvalue
     */
    public void add(DSAKeyValue dsakeyvalue) {
        this.add(new KeyValue(this.doc, dsakeyvalue));
    }
View Full Code Here

     * Method add
     *
     * @param rsakeyvalue
     */
    public void add(RSAKeyValue rsakeyvalue) {
        this.add(new KeyValue(this.doc, rsakeyvalue));
    }
View Full Code Here

     * Method add
     *
     * @param pk
     */
    public void add(PublicKey pk) {
        this.add(new KeyValue(this.doc, pk));
    }
View Full Code Here

        Element e =
            XMLUtils.selectDsNode(
                this.constructionElement.getFirstChild(), Constants._TAG_KEYVALUE, i);

        if (e != null) {
            return new KeyValue(e, this.baseURI);
        }
        return null;     
    }
View Full Code Here

            os.println("KeyName(" + i + ")=\"" + x.getKeyName() + "\"");
        }

        for (int i = 0; i < ki.lengthKeyValue(); i++) {
            KeyValue x = ki.itemKeyValue(i);
            PublicKey pk = x.getPublicKey();

            os.println("KeyValue Nr. " + i);
            os.println(pk);
        }

        for (int i = 0; i < ki.lengthMgmtData(); i++) {
            MgmtData x = ki.itemMgmtData(i);

            os.println("MgmtData(" + i + ")=\"" + x.getMgmtData() + "\"");
        }

        for (int i = 0; i < ki.lengthX509Data(); i++) {
            X509Data x = ki.itemX509Data(i);

            os.println("X509Data(" + i + ")=\"" + (x.containsCertificate()
                ? "Certificate " : "") + (x.containsIssuerSerial()
                ? "IssuerSerial " : "") + "\"");
        }
    }
View Full Code Here

        Document doc = db.parse(new FileInputStream(f));
        NodeList nl = doc.getElementsByTagNameNS(Constants.SignatureSpecNS, "Signature");
        XMLSignature sig = new XMLSignature
            ((Element) nl.item(0), f.toURI().toURL().toString());
        KeyInfo ki = sig.getKeyInfo();
        KeyValue kv = ki.itemKeyValue(0);
        PublicKey pk = kv.getPublicKey();
        assertNotNull(pk);
    }
View Full Code Here

TOP

Related Classes of org.apache.xml.security.keys.content.KeyValue

Copyright © 2018 www.massapicom. 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.