src/share/classes/com/sun/org/apache/xml/internal/security/encryption/EncryptionProperty.java

Print this page


   1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Copyright  2003-2004 The Apache Software Foundation.
   7  *
   8  *  Licensed under the Apache License, Version 2.0 (the "License");
   9  *  you may not use this file except in compliance with the License.
  10  *  You may obtain a copy of the License at


  11  *
  12  *      http://www.apache.org/licenses/LICENSE-2.0
  13  *
  14  *  Unless required by applicable law or agreed to in writing, software
  15  *  distributed under the License is distributed on an "AS IS" BASIS,
  16  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17  *  See the License for the specific language governing permissions and
  18  *  limitations under the License.
  19  *
  20  */
  21 package com.sun.org.apache.xml.internal.security.encryption;
  22 
  23 
  24 import java.util.Iterator;
  25 import org.w3c.dom.Element;
  26 
  27 /**
  28  * Additional information items concerning the generation of the
  29  * <code>EncryptedData</code> or <code>EncryptedKey</code> can be placed in an
  30  * <code>EncryptionProperty</code> element (e.g., date/time stamp or the serial
  31  * number of cryptographic hardware used during encryption). The Target
  32  * attribute identifies the <code>EncryptedType</code> structure being
  33  * described. anyAttribute permits the inclusion of attributes from the XML
  34  * namespace to be included (i.e., <code>xml:space</code>,
  35  * <code>xml:lang</code>, and <code>xml:base</code>).
  36  * <p>
  37  * It is defined as follows:
  38  * <xmp>
  39  * <element name='EncryptionProperty' type='xenc:EncryptionPropertyType'/>
  40  * <complexType name='EncryptionPropertyType' mixed='true'>
  41  *     <choice maxOccurs='unbounded'>
  42  *         <any namespace='##other' processContents='lax'/>
  43  *     </choice>
  44  *     <attribute name='Target' type='anyURI' use='optional'/>
  45  *     <attribute name='Id' type='ID' use='optional'/>
  46  *     <anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/>
  47  * </complexType>
  48  * </xmp>
  49  *
  50  * @author Axl Mattheus
  51  */
  52 public interface EncryptionProperty {

  53     /**
  54      * Returns the <code>EncryptedType</code> being described.
  55      *
  56      * @return the <code>EncryptedType</code> being described by this
  57      *   <code>EncryptionProperty</code>.
  58      */
  59     String getTarget();
  60 
  61     /**
  62      * Sets the target.
  63      *
  64      * @param target.
  65      */
  66     void setTarget(String target);
  67 
  68     /**
  69      * Returns the id of the <CODE>EncryptionProperty</CODE>.
  70      *
  71      * @return the id.
  72      */
  73     String getId();
  74 
  75     /**
  76      * Sets the id.
  77      *
  78      * @param id.
  79      */
  80     void setId(String id);
  81 
  82     /**
  83      * Returns the attribute's value in the <code>xml</code> namespace.
  84      *
  85      * @param attribute
  86      * @return the attribute's value.
  87      */
  88     String getAttribute(String attribute);
  89 
  90     /**
  91      * Set the attribute value.
  92      *
  93      * @param attribute the attribute's name.
  94      * @param value the attribute's value.
  95      */
  96     void setAttribute(String attribute, String value);
  97 
  98     /**
  99      * Returns the properties of the <CODE>EncryptionProperty</CODE>.
 100      *
 101      * @return an <code>Iterator</code> over all the addiitonal encryption
 102      *   information contained in this class.
 103      */
 104     Iterator<Element> getEncryptionInformation();
 105 
 106     /**
 107      * Adds encryption information.
 108      *
 109      * @param information the additional encryption information.
 110      */
 111     void addEncryptionInformation(Element information);
 112 
 113     /**
 114      * Removes encryption information.
 115      *
 116      * @param information the information to remove.
 117      */
 118     void removeEncryptionInformation(Element information);
 119 }
   1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /**
   6  * Licensed to the Apache Software Foundation (ASF) under one
   7  * or more contributor license agreements. See the NOTICE file
   8  * distributed with this work for additional information
   9  * regarding copyright ownership. The ASF licenses this file
  10  * to you under the Apache License, Version 2.0 (the
  11  * "License"); you may not use this file except in compliance
  12  * with the License. You may obtain a copy of the License at
  13  *
  14  * http://www.apache.org/licenses/LICENSE-2.0
  15  *
  16  * Unless required by applicable law or agreed to in writing,
  17  * software distributed under the License is distributed on an
  18  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  19  * KIND, either express or implied. See the License for the
  20  * specific language governing permissions and limitations
  21  * under the License.
  22  */
  23 package com.sun.org.apache.xml.internal.security.encryption;
  24 

  25 import java.util.Iterator;
  26 import org.w3c.dom.Element;
  27 
  28 /**
  29  * Additional information items concerning the generation of the
  30  * <code>EncryptedData</code> or <code>EncryptedKey</code> can be placed in an
  31  * <code>EncryptionProperty</code> element (e.g., date/time stamp or the serial
  32  * number of cryptographic hardware used during encryption). The Target
  33  * attribute identifies the <code>EncryptedType</code> structure being
  34  * described. anyAttribute permits the inclusion of attributes from the XML
  35  * namespace to be included (i.e., <code>xml:space</code>,
  36  * <code>xml:lang</code>, and <code>xml:base</code>).
  37  * <p>
  38  * It is defined as follows:
  39  * <xmp>
  40  * <element name='EncryptionProperty' type='xenc:EncryptionPropertyType'/>
  41  * <complexType name='EncryptionPropertyType' mixed='true'>
  42  *     <choice maxOccurs='unbounded'>
  43  *         <any namespace='##other' processContents='lax'/>
  44  *     </choice>
  45  *     <attribute name='Target' type='anyURI' use='optional'/>
  46  *     <attribute name='Id' type='ID' use='optional'/>
  47  *     <anyAttribute namespace="http://www.w3.org/XML/1998/namespace"/>
  48  * </complexType>
  49  * </xmp>
  50  *
  51  * @author Axl Mattheus
  52  */
  53 public interface EncryptionProperty {
  54     
  55     /**
  56      * Returns the <code>EncryptedType</code> being described.
  57      *
  58      * @return the <code>EncryptedType</code> being described by this
  59      *   <code>EncryptionProperty</code>.
  60      */
  61     String getTarget();
  62 
  63     /**
  64      * Sets the target.
  65      *
  66      * @param target
  67      */
  68     void setTarget(String target);
  69 
  70     /**
  71      * Returns the id of the <CODE>EncryptionProperty</CODE>.
  72      *
  73      * @return the id.
  74      */
  75     String getId();
  76 
  77     /**
  78      * Sets the id.
  79      *
  80      * @param id
  81      */
  82     void setId(String id);
  83 
  84     /**
  85      * Returns the attribute's value in the <code>xml</code> namespace.
  86      *
  87      * @param attribute
  88      * @return the attribute's value.
  89      */
  90     String getAttribute(String attribute);
  91 
  92     /**
  93      * Set the attribute value.
  94      *
  95      * @param attribute the attribute's name.
  96      * @param value the attribute's value.
  97      */
  98     void setAttribute(String attribute, String value);
  99 
 100     /**
 101      * Returns the properties of the <CODE>EncryptionProperty</CODE>.
 102      *
 103      * @return an <code>Iterator</code> over all the additional encryption
 104      *   information contained in this class.
 105      */
 106     Iterator<Element> getEncryptionInformation();
 107 
 108     /**
 109      * Adds encryption information.
 110      *
 111      * @param information the additional encryption information.
 112      */
 113     void addEncryptionInformation(Element information);
 114 
 115     /**
 116      * Removes encryption information.
 117      *
 118      * @param information the information to remove.
 119      */
 120     void removeEncryptionInformation(Element information);
 121 }