1/*2 * reserved comment block3 * DO NOT REMOVE OR ALTER!4 */5/**6 * Licensed to the Apache Software Foundation (ASF) under one7 * or more contributor license agreements. See the NOTICE file8 * distributed with this work for additional information9 * regarding copyright ownership. The ASF licenses this file10 * to you under the Apache License, Version 2.0 (the11 * "License"); you may not use this file except in compliance12 * with the License. You may obtain a copy of the License at13 *14 * http://www.apache.org/licenses/LICENSE-2.015 *16 * Unless required by applicable law or agreed to in writing,17 * software distributed under the License is distributed on an18 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY19 * KIND, either express or implied. See the License for the20 * specific language governing permissions and limitations21 * under the License.22 */23package com.sun.org.apache.xml.internal.security.encryption;
2425/**26 * The <code>EncryptedKey</code> element is used to transport encryption keys27 * from the originator to a known recipient(s). It may be used as a stand-alone28 * XML document, be placed within an application document, or appear inside an29 * <code>EncryptedData</code> element as a child of a <code>ds:KeyInfo</code>30 * element. The key value is always encrypted to the recipient(s). When31 * <code>EncryptedKey</code> is decrypted the resulting octets are made32 * available to the <code>EncryptionMethod</code> algorithm without any33 * additional processing.34 * <p>35 * Its schema definition is as follows:36 * <xmp>37 * <element name='EncryptedKey' type='xenc:EncryptedKeyType'/>38 * <complexType name='EncryptedKeyType'>39 * <complexContent>40 * <extension base='xenc:EncryptedType'>41 * <sequence>42 * <element ref='xenc:ReferenceList' minOccurs='0'/>43 * <element name='CarriedKeyName' type='string' minOccurs='0'/>44 * </sequence>45 * <attribute name='Recipient' type='string' use='optional'/>46 * </extension>47 * </complexContent>48 * </complexType>49 * </xmp>50 *51 * @author Axl Mattheus52 */53publicinterfaceEncryptedKeyextendsEncryptedType {
5455/**56 * Returns a hint as to which recipient this encrypted key value is intended for.57 *58 * @return the recipient of the <code>EncryptedKey</code>.59 */60String getRecipient();
6162/**63 * Sets the recipient for this <code>EncryptedKey</code>.64 *65 * @param recipient the recipient for this <code>EncryptedKey</code>.66 */67void setRecipient(String recipient);
6869/**70 * Returns pointers to data and keys encrypted using this key. The reference71 * list may contain multiple references to <code>EncryptedKey</code> and72 * <code>EncryptedData</code> elements. This is done using73 * <code>KeyReference</code> and <code>DataReference</code> elements74 * respectively.75 *76 * @return an <code>Iterator</code> over all the <code>ReferenceList</code>s77 * contained in this <code>EncryptedKey</code>.78 */79ReferenceList getReferenceList();
8081/**82 * Sets the <code>ReferenceList</code> to the <code>EncryptedKey</code>.83 *84 * @param list a list of pointers to data elements encrypted using this key.85 */86void setReferenceList(ReferenceList list);
8788/**89 * Returns a user readable name with the key value. This may then be used to90 * reference the key using the <code>ds:KeyName</code> element within91 * <code>ds:KeyInfo</code>. The same <code>CarriedKeyName</code> label,92 * unlike an ID type, may occur multiple times within a single document. The93 * value of the key is to be the same in all <code>EncryptedKey</code>94 * elements identified with the same <code>CarriedKeyName</code> label95 * within a single XML document.96 * <br>97 * <b>Note</b> that because whitespace is significant in the value of98 * the <code>ds:KeyName</code> element, whitespace is also significant in99 * the value of the <code>CarriedKeyName</code> element.100 *101 * @return over all the carried names contained in102 * this <code>EncryptedKey</code>.103 */104String getCarriedName();
105106/**107 * Sets the carried name.108 *109 * @param name the carried name.110 */111void setCarriedName(String name);
112 }
113