001: /*
002: * reserved comment block
003: * DO NOT REMOVE OR ALTER!
004: */
005: /* Copyright (c) 2002 Graz University of Technology. All rights reserved.
006: *
007: * Redistribution and use in source and binary forms, with or without
008: * modification, are permitted provided that the following conditions are met:
009: *
010: * 1. Redistributions of source code must retain the above copyright notice,
011: * this list of conditions and the following disclaimer.
012: *
013: * 2. Redistributions in binary form must reproduce the above copyright notice,
014: * this list of conditions and the following disclaimer in the documentation
015: * and/or other materials provided with the distribution.
016: *
017: * 3. The end-user documentation included with the redistribution, if any, must
018: * include the following acknowledgment:
019: *
020: * "This product includes software developed by IAIK of Graz University of
021: * Technology."
022: *
023: * Alternately, this acknowledgment may appear in the software itself, if
024: * and wherever such third-party acknowledgments normally appear.
025: *
026: * 4. The names "Graz University of Technology" and "IAIK of Graz University of
027: * Technology" must not be used to endorse or promote products derived from
028: * this software without prior written permission.
029: *
030: * 5. Products derived from this software may not be called
031: * "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior
032: * written permission of Graz University of Technology.
033: *
034: * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
035: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
036: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
037: * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE
038: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
039: * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
040: * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
041: * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
042: * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
043: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
044: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
045: * POSSIBILITY OF SUCH DAMAGE.
046: */
047:
048: package sun.security.pkcs11.wrapper;
049:
050: /**
051: * class CK_RSA_PKCS_OAEP_PARAMS provides the parameters to the
052: * CKM_RSA_PKCS_OAEP mechanism.<p>
053: * <B>PKCS#11 structure:</B>
054: * <PRE>
055: * typedef struct CK_RSA_PKCS_OAEP_PARAMS {
056: * CK_MECHANISM_TYPE hashAlg;
057: * CK_RSA_PKCS_OAEP_MGF_TYPE mgf;
058: * CK_RSA_PKCS_OAEP_SOURCE_TYPE source;
059: * CK_VOID_PTR pSourceData;
060: * CK_ULONG ulSourceDataLen;
061: * } CK_RSA_PKCS_OAEP_PARAMS;
062: * </PRE>
063: *
064: * @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
065: * @author Martin Schlaeffer <schlaeff@sbox.tugraz.at>
066: */
067: public class CK_RSA_PKCS_OAEP_PARAMS {
068:
069: /**
070: * <B>PKCS#11:</B>
071: * <PRE>
072: * CK_MECHANISM_TYPE hashAlg;
073: * </PRE>
074: */
075: public long hashAlg;
076:
077: /**
078: * <B>PKCS#11:</B>
079: * <PRE>
080: * CK_RSA_PKCS_OAEP_MGF_TYPE mgf;
081: * </PRE>
082: */
083: public long mgf;
084:
085: /**
086: * <B>PKCS#11:</B>
087: * <PRE>
088: * CK_RSA_PKCS_OAEP_SOURCE_TYPE source;
089: * </PRE>
090: */
091: public long source;
092:
093: /**
094: * <B>PKCS#11:</B>
095: * <PRE>
096: * CK_VOID_PTR pSourceData;
097: * CK_ULONG ulSourceDataLen;
098: * </PRE>
099: */
100: public byte[] pSourceData;
101:
102: //CK_ULONG ulSourceDataLen;
103: // ulSourceDataLen == pSourceData.length
104:
105: /**
106: * Returns the string representation of CK_RSA_PKCS_OAEP_PARAMS.
107: *
108: * @return the string representation of CK_RSA_PKCS_OAEP_PARAMS
109: */
110: public String toString() {
111: StringBuffer buffer = new StringBuffer();
112:
113: buffer.append(Constants.INDENT);
114: buffer.append("hashAlg: ");
115: buffer.append(hashAlg);
116: buffer.append(Constants.NEWLINE);
117:
118: buffer.append(Constants.INDENT);
119: buffer.append("mgf: ");
120: buffer.append(mgf);
121: buffer.append(Constants.NEWLINE);
122:
123: buffer.append(Constants.INDENT);
124: buffer.append("source: ");
125: buffer.append(source);
126: buffer.append(Constants.NEWLINE);
127:
128: buffer.append(Constants.INDENT);
129: buffer.append("pSourceData: ");
130: buffer.append(pSourceData.toString());
131: buffer.append(Constants.NEWLINE);
132:
133: buffer.append(Constants.INDENT);
134: buffer.append("pSourceDataLen: ");
135: buffer.append(Functions.toHexString(pSourceData));
136: //buffer.append(Constants.NEWLINE);
137:
138: return buffer.toString();
139: }
140:
141: }
|