KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xml > internal > security > encryption > EncryptedKey


1 /*
2  * Copyright 2003-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17 package com.sun.org.apache.xml.internal.security.encryption;
18
19
20
21 /**
22  * The <code>EncryptedKey</code> element is used to transport encryption keys
23  * from the originator to a known recipient(s). It may be used as a stand-alone
24  * XML document, be placed within an application document, or appear inside an
25  * <code>EncryptedData</code> element as a child of a <code>ds:KeyInfo</code>
26  * element. The key value is always encrypted to the recipient(s). When
27  * <code>EncryptedKey</code> is decrypted the resulting octets are made
28  * available to the <code>EncryptionMethod</code> algorithm without any
29  * additional processing.
30  * <p>
31  * Its schema definition is as follows:
32  * <xmp>
33  * <element name='EncryptedKey' type='xenc:EncryptedKeyType'/>
34  * <complexType name='EncryptedKeyType'>
35  * <complexContent>
36  * <extension base='xenc:EncryptedType'>
37  * <sequence>
38  * <element ref='xenc:ReferenceList' minOccurs='0'/>
39  * <element name='CarriedKeyName' type='string' minOccurs='0'/>
40  * </sequence>
41  * <attribute name='Recipient' type='string' use='optional'/>
42  * </extension>
43  * </complexContent>
44  * </complexType>
45  * </xmp>
46  *
47  * @author Axl Mattheus
48  */

49 public interface EncryptedKey extends EncryptedType {
50     /**
51      * Returns a hint as to which recipient this encrypted key value is intended
52      * for.
53      *
54      * @return the recipient of the <code>EncryptedKey</code>.
55      */

56     String JavaDoc getRecipient();
57
58     /**
59      * Sets the recipient for this <code>EncryptedKey</code>.
60      *
61      * @param recipient the recipient for this <code>EncryptedKey</code>.
62      */

63     void setRecipient(String JavaDoc recipient);
64
65     /**
66      * Returns pointers to data and keys encrypted using this key. The reference
67      * list may contain multiple references to <code>EncryptedKey</code> and
68      * <code>EncryptedData</code> elements. This is done using
69      * <code>KeyReference</code> and <code>DataReference</code> elements
70      * respectively.
71      *
72      * @return an <code>Iterator</code> over all the <code>ReferenceList</code>s
73      * contained in this <code>EncryptedKey</code>.
74      */

75     ReferenceList getReferenceList();
76
77     /**
78      * Sets the <code>ReferenceList</code> to the <code>EncryptedKey</code>.
79      *
80      * @param list a list of pointers to data elements encrypted using this key.
81      */

82     void setReferenceList(ReferenceList list);
83
84     /**
85      * Returns a user readable name with the key value. This may then be used to
86      * reference the key using the <code>ds:KeyName</code> element within
87      * <code>ds:KeyInfo</code>. The same <code>CarriedKeyName</code> label,
88      * unlike an ID type, may occur multiple times within a single document. The
89      * value of the key is to be the same in all <code>EncryptedKey</code>
90      * elements identified with the same <code>CarriedKeyName</code> label
91      * within a single XML document.
92      * <br>
93      * <b>Note</b> that because whitespace is significant in the value of
94      * the <code>ds:KeyName</code> element, whitespace is also significant in
95      * the value of the <code>CarriedKeyName</code> element.
96      *
97      * @return over all the carried names contained in
98      * this <code>EncryptedKey</code>.
99      */

100     String JavaDoc getCarriedName();
101
102     /**
103      * Sets the carried name.
104      *
105      * @param name the carried name.
106      */

107     void setCarriedName(String JavaDoc name);
108 }
109
110
Popular Tags