Examples of KeyInfoReference


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

     * @param storage
     * @return the KeyInfo which is referred to by this KeyInfoReference, or null if can not be resolved
     * @throws XMLSecurityException
     */
    private KeyInfo resolveReferentKeyInfo(Element element, String baseURI, StorageResolver storage) throws XMLSecurityException {
        KeyInfoReference reference = new KeyInfoReference(element, baseURI);
        Attr uriAttr = reference.getURIAttr();

        XMLSignatureInput resource = resolveInput(uriAttr, baseURI, secureValidation);

        Element referentElement = null;
        try {
View Full Code Here

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

     *
     * @param URI
     * @throws XMLSecurityException
     */
    public void addKeyInfoReference(String URI) throws XMLSecurityException {
        this.add(new KeyInfoReference(getDocument(), URI));
    }
View Full Code Here

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

        Element e =
            XMLUtils.selectDs11Node(
                getFirstChild(), Constants._TAG_KEYINFOREFERENCE, i);

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

Examples of org.opensaml.xml.signature.KeyInfoReference

*/
public class KeyInfoReferenceUnmarshaller extends AbstractXMLSignatureUnmarshaller {

    /** {@inheritDoc} */
    protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException {
        KeyInfoReference ref = (KeyInfoReference) xmlObject;

        if (attribute.getLocalName().equals(KeyInfoReference.ID_ATTRIB_NAME)) {
            ref.setID(attribute.getValue());
            attribute.getOwnerElement().setIdAttributeNode(attribute, true);
        } else if (attribute.getLocalName().equals(KeyInfoReference.URI_ATTRIB_NAME)) {
            ref.setURI(attribute.getValue());
        } else {
            super.processAttribute(xmlObject, attribute);
        }
    }
View Full Code Here

Examples of org.opensaml.xml.signature.KeyInfoReference

*/
public class KeyInfoReferenceMarshaller extends AbstractXMLSignatureMarshaller {

    /** {@inheritDoc} */
    protected void marshallAttributes(XMLObject xmlObject, Element domElement) throws MarshallingException {
        KeyInfoReference ref = (KeyInfoReference) xmlObject;

        if (ref.getID() != null) {
            domElement.setAttributeNS(null, KeyInfoReference.ID_ATTRIB_NAME, ref.getID());
            domElement.setIdAttributeNS(null, KeyInfoReference.ID_ATTRIB_NAME, true);
        }

        if (ref.getURI() != null) {
            domElement.setAttributeNS(null, KeyInfoReference.URI_ATTRIB_NAME, ref.getURI());
        }
    }
View Full Code Here

Examples of org.opensaml.xml.signature.KeyInfoReference

    /** {@inheritDoc} */
    public Collection<Credential> process(KeyInfoCredentialResolver resolver, XMLObject keyInfoChild,
            CriteriaSet criteriaSet, KeyInfoResolutionContext kiContext) throws SecurityException {

        KeyInfoReference ref = getKeyInfoReference(keyInfoChild);
        if (ref == null) {
            return null;
        }

        log.debug("Attempting to follow same-document KeyInfoReference");

        XMLObject target = ref.resolveIDFromRoot(ref.getURI().substring(1));
        if (target == null) {
            log.warn("KeyInfoReference URI could not be dereferenced");
            return null;
        } else if (!(target instanceof KeyInfo)) {
            log.warn("The product of dereferencing the KeyInfoReference was not a KeyInfo");
View Full Code Here

Examples of org.opensaml.xml.signature.KeyInfoReference

     * @param xmlObject an XML object, presumably a {@link KeyInfoReference}
     * @return the KeyInfoReference which was found, or null if none or invalid
     */
    protected KeyInfoReference getKeyInfoReference(XMLObject xmlObject) {
        if (xmlObject instanceof KeyInfoReference) {
            KeyInfoReference ref = (KeyInfoReference) xmlObject;
            String uri = ref.getURI();
            if (uri != null && uri.startsWith("#")) {
                return ref;
            } else {
                log.debug("KeyInfoReference did not contain a same-document URI reference, cannot handle");
            }
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.