1 /* 2 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 3 */ 4 /* 5 * $Id: SignatureProperty.java,v 1.4 2005/05/10 16:03:46 mullan Exp $ 6 */ 7 package javax.xml.crypto.dsig; 8 9 import javax.xml.crypto.XMLStructure; 10 import java.util.List; 11 12 /** 13 * A representation of the XML <code>SignatureProperty</code> element as 14 * defined in the <a HREF="http://www.w3.org/TR/xmldsig-core/"> 15 * W3C Recommendation for XML-Signature Syntax and Processing</a>. 16 * The XML Schema Definition is defined as: 17 * <pre><code> 18 *<element name="SignatureProperty" type="ds:SignaturePropertyType"/> 19 * <complexType name="SignaturePropertyType" mixed="true"> 20 * <choice maxOccurs="unbounded"> 21 * <any namespace="##other" processContents="lax"/> 22 * <!-- (1,1) elements from (1, unbounded) namespaces --> 23 * </choice> 24 * <attribute name="Target" type="anyURI" use="required"/> 25 * <attribute name="Id" type="ID" use="optional"/> 26 * </complexType> 27 * </code></pre> 28 * 29 * A <code>SignatureProperty</code> instance may be created by invoking the 30 * {@link XMLSignatureFactory#newSignatureProperty newSignatureProperty} 31 * method of the {@link XMLSignatureFactory} class; for example: 32 * 33 * <pre> 34 * XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM"); 35 * SignatureProperty property = factory.newSignatureProperty 36 * (Collections.singletonList(content), "#Signature-1", "TimeStamp"); 37 * </pre> 38 * 39 * @author Sean Mullan 40 * @author JSR 105 Expert Group 41 * @since 1.6 42 * @see XMLSignatureFactory#newSignatureProperty(List, String, String) 43 * @see SignatureProperties 44 */ 45 public interface SignatureProperty extends XMLStructure { 46 47 /** 48 * Returns the target URI of this <code>SignatureProperty</code>. 49 * 50 * @return the target URI of this <code>SignatureProperty</code> (never 51 * <code>null</code>) 52 */ 53 String getTarget(); 54 55 /** 56 * Returns the Id of this <code>SignatureProperty</code>. 57 * 58 * @return the Id of this <code>SignatureProperty</code> (or 59 * <code>null</code> if not specified) 60 */ 61 String getId(); 62 63 /** 64 * Returns an {@link java.util.Collections#unmodifiableList unmodifiable 65 * list} of one or more {@link XMLStructure}s that are contained in 66 * this <code>SignatureProperty</code>. These represent additional 67 * information items concerning the generation of the {@link XMLSignature} 68 * (i.e. date/time stamp or serial numbers of cryptographic hardware used 69 * in signature generation). 70 * 71 * @return an unmodifiable list of one or more <code>XMLStructure</code>s 72 */ 73 List getContent(); 74 } 75