KickJava   Java API By Example, From Geeks To Geeks.

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


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 import java.util.Iterator JavaDoc;
21 import org.w3c.dom.Element JavaDoc;
22
23
24 /**
25  * <code>EncryptionMethod</code> describes the encryption algorithm applied to
26  * the cipher data. If the element is absent, the encryption algorithm must be
27  * known by the recipient or the decryption will fail.
28  * <p>
29  * It is defined as follows:
30  * <xmp>
31  * <complexType name='EncryptionMethodType' mixed='true'>
32  * <sequence>
33  * <element name='KeySize' minOccurs='0' type='xenc:KeySizeType'/>
34  * <element name='OAEPparams' minOccurs='0' type='base64Binary'/>
35  * <any namespace='##other' minOccurs='0' maxOccurs='unbounded'/>
36  * </sequence>
37  * <attribute name='Algorithm' type='anyURI' use='required'/>
38  * </complexType>
39  * </xmp>
40  *
41  * @author Axl Mattheus
42  */

43 public interface EncryptionMethod {
44     /**
45      * Returns the algorithm applied to the cipher data.
46      *
47      * @return the encryption algorithm.
48      */

49     String JavaDoc getAlgorithm();
50
51     /**
52      * Returns the key size of the key of the algorithm applied to the cipher
53      * data.
54      *
55      * @return the key size.
56      */

57     int getKeySize();
58
59     /**
60      * Sets the size of the key of the algorithm applied to the cipher data.
61      *
62      * @param size the key size.
63      */

64     void setKeySize(int size);
65
66     /**
67      * Returns the OAEP parameters of the algorithm applied applied to the
68      * cipher data.
69      *
70      * @return the OAEP parameters.
71      */

72     byte[] getOAEPparams();
73
74     /**
75      * Sets the OAEP parameters.
76      *
77      * @param parameters the OAEP parameters.
78      */

79     void setOAEPparams(byte[] parameters);
80
81     /**
82      * Returns an iterator over all the additional elements contained in the
83      * <code>EncryptionMethod</code>.
84      *
85      * @return an <code>Iterator</code> over all the additional infomation
86      * about the <code>EncryptionMethod</code>.
87      */

88     Iterator JavaDoc getEncryptionMethodInformation();
89
90     /**
91      * Adds encryption method information.
92      *
93      * @param information additional encryption method information.
94      */

95     void addEncryptionMethodInformation(Element JavaDoc information);
96
97     /**
98      * Removes encryption method information.
99      *
100      * @param information the information to remove from the
101      * <code>EncryptionMethod</code>.
102      */

103     void removeEncryptionMethodInformation(Element JavaDoc information);
104 }
105
106
Popular Tags