KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > crypto > spec > OAEPParameterSpec


1 /*
2  * @(#)OAEPParameterSpec.java 1.4 04/06/03
3  *
4  * Copyright (c) 2004 Sun Microsystems, Inc. All Rights Reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7   
8 /*
9  * NOTE:
10  * Because of various external restrictions (i.e. US export
11  * regulations, etc.), the actual source code can not be provided
12  * at this time. This file represents the skeleton of the source
13  * file, so that javadocs of the API can be created.
14  */

15
16 package javax.crypto.spec;
17
18 import java.math.BigInteger;
19 import java.security.spec.AlgorithmParameterSpec;
20 import java.security.spec.MGF1ParameterSpec;
21
22 /**
23  * This class specifies the set of parameters used with OAEP Padding,
24  * as defined in the
25  * <a HREF="http://www.ietf.org/rfc/rfc3447.txt">PKCS #1</a>
26  * standard.
27  *
28  * Its ASN.1 definition in PKCS#1 standard is described below:
29  * <pre>
30  * RSAES-OAEP-params ::= SEQUENCE {
31  * hashAlgorithm [0] OAEP-PSSDigestAlgorithms DEFAULT sha1,
32  * maskGenAlgorithm [1] PKCS1MGFAlgorithms DEFAULT mgf1SHA1,
33  * pSourceAlgorithm [2] PKCS1PSourceAlgorithms DEFAULT pSpecifiedEmpty
34  * }
35  * </pre>
36  * where
37  * <pre>
38  * OAEP-PSSDigestAlgorithms ALGORITHM-IDENTIFIER ::= {
39  * { OID id-sha1 PARAMETERS NULL }|
40  * { OID id-sha256 PARAMETERS NULL }|
41  * { OID id-sha384 PARAMETERS NULL }|
42  * { OID id-sha512 PARAMETERS NULL },
43  * ... -- Allows for future expansion --
44  * }
45  * PKCS1MGFAlgorithms ALGORITHM-IDENTIFIER ::= {
46  * { OID id-mgf1 PARAMETERS OAEP-PSSDigestAlgorithms },
47  * ... -- Allows for future expansion --
48  * }
49  * PKCS1PSourceAlgorithms ALGORITHM-IDENTIFIER ::= {
50  * { OID id-pSpecified PARAMETERS OCTET STRING },
51  * ... -- Allows for future expansion --
52  * }
53  * </pre>
54  * <p>Note: the OAEPParameterSpec.DEFAULT uses the following:
55  * message digest -- "SHA-1"
56  * mask generation function (mgf) -- "MGF1"
57  * parameters for mgf -- MGF1ParameterSpec.SHA1
58  * source of encoding input -- PSource.PSpecified.DEFAULT
59  *
60  * @see java.security.spec.MGF1ParameterSpec
61  * @see PSource
62  *
63  * @author Valerie Peng
64  *
65  * @version 1.5, 06/03/04
66  * @since 1.5
67  */

68 public class OAEPParameterSpec implements AlgorithmParameterSpec
69 {
70     /**
71      * The OAEP parameter set with all default values.
72      */

73     public static final OAEPParameterSpec DEFAULT = null;
74
75     /**
76      * Constructs a parameter set for OAEP padding as defined in
77      * the PKCS #1 standard using the specified message digest
78      * algorithm <code>mdName</code>, mask generation function
79      * algorithm <code>mgfName</code>, parameters for the mask
80      * generation function <code>mgfSpec</code>, and source of
81      * the encoding input P <code>pSrc</code>.
82      *
83      * @param mdName the algorithm name for the message digest.
84      * @param mgfName the algorithm name for the mask generation
85      * function.
86      * @param mgfSpec the parameters for the mask generation function.
87      * If null is specified, null will be returned by getMGFParameters().
88      * @param pSrc the source of the encoding input P.
89      * @exception NullPointerException if <code>mdName</code>,
90      * <code>mgfName</code>, or <code>pSrc</code> is null.
91      */

92     public OAEPParameterSpec(String mdName, String mgfName,
93         AlgorithmParameterSpec mgfSpec, PSource pSrc)
94     { }
95
96     /**
97      * Returns the message digest algorithm name.
98      *
99      * @return the message digest algorithm name.
100      */

101     public String getDigestAlgorithm() {
102         return null;
103     }
104
105     /**
106      * Returns the mask generation function algorithm name.
107      *
108      * @return the mask generation function algorithm name.
109      */

110     public String getMGFAlgorithm() {
111         return null;
112     }
113
114     /**
115      * Returns the parameters for the mask generation function.
116      *
117      * @return the parameters for the mask generation function.
118      */

119     public AlgorithmParameterSpec getMGFParameters() {
120         return null;
121     }
122
123     /**
124      * Returns the source of encoding input P.
125      *
126      * @return the source of encoding input P.
127      */

128     public PSource getPSource() {
129         return null;
130     }
131 }
132
Popular Tags