1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24//i20156 - new file for xmlsecurity module
25
26/** -- idl definition -- **/
27
28#ifndef __com_sun_star_xml_crypto_xxmlencryptiontemplate_idl_
29#define __com_sun_star_xml_crypto_xxmlencryptiontemplate_idl_
30
31#include <com/sun/star/uno/XInterface.idl>
32#include <com/sun/star/lang/IllegalArgumentException.idl>
33
34#include <com/sun/star/xml/wrapper/XXMLElementWrapper.idl>
35#include <com/sun/star/xml/crypto/XXMLSecurityTemplate.idl>
36
37module com { module sun { module star { module xml { module crypto {
38
39/**
40 * Interface of XML encryption template
41 *
42 * <p>This interface represents a encryption template, which is the same as the
43 * desired xml encryption element[ EncryptedType ] but some of the nodes may be
44 * empty. The empty entities include CipherValue, which is a subset of
45 * EncryptedData or EncryptedKey. Empty entities are not allowed in a encryption
46 * template when performing decryption.</p>
47 *
48 * <p>In some cases, the encrypter or decrypter can dertermine and locate the
49 * EncrytedKey from the encryption template by dereference the RetrievalMethod
50 * inside EncryptedData.</p>
51 *
52 * <p>In some cases, the EncryptedKey need to be clearly pointed out by the
53 * encryption template.</p>
54 *
55 * <p>With the help of encryption context, the encrypter or decrypter specifies
56 * the key from the KeyInfo in the encryption template.</p>
57 *
58 *
59 * <p>It isn't a good method to set the EncryptedKey here. In general, there is
60 * a RetrievalMethod in EncryptedData by which we can get the EncryptedKey.
61 *
62 * And some times, in the low level, it is hard to determine what the key is
63 * except that the high level application tell the mechanism and parameters.
64 *
65 * So I think it will be more simple that the application set the encrypted key
66 * information. In this case, the application only need to know the xml schema
67 * or DTD and the encryption device. If so, the high level application takes the
68 * action of build the EncryptedKey template and references it in the element of
69 * EncryptedData. And in this case, the calling to set up EncryptedKey template
70 * and target is not necessary, because the encrypter or decrypter can determine
71 * and locate the EncrypedKet from the encryption template of EncryptedData by
72 * dereference the RetrievalMethod.
73 *
74 * In some situation, the high level applications do not want to know anything
75 * about crypto devices( May be he must, because the lower level do not know
76 * what the key is ). If it gives the key value, it can get EncryptedKey by
77 * setting the key template and key value target.</p>
78 */
79interface XXMLEncryptionTemplate : XXMLSecurityTemplate
80{
81	/**
82	 * Get the target xml element, i.e. the element to be encrypted
83	 */
84	com::sun::star::xml::wrapper::XXMLElementWrapper getTarget(
85	) ;
86} ;
87
88
89} ; } ; } ; } ; } ;
90
91
92#endif
93
94