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