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_ECDH2_DERIVE_PARAMS provides the parameters to the
052: * CKM_ECMQV_DERIVE mechanism.<p>
053: * <B>PKCS#11 structure:</B>
054: * <PRE>
055: * typedef struct CK_ECDH2_DERIVE_PARAMS {
056: * CK_EC_KDF_TYPE kdf;
057: * CK_ULONG ulSharedDataLen;
058: * CK_BYTE_PTR pSharedData;
059: * CK_ULONG ulPublicDataLen;
060: * CK_BYTE_PTR pPublicData;
061: * CK_ULONG ulPrivateDataLen;
062: * CK_OBJECT_HANDLE hPrivateData;
063: * CK_ULONG ulPublicDataLen2;
064: * CK_BYTE_PTR pPublicData2;
065: * } CK_ECDH2_DERIVE_PARAMS;
066: * </PRE>
067: *
068: * @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
069: */
070: public class CK_ECDH2_DERIVE_PARAMS {
071:
072: /**
073: * <B>PKCS#11:</B>
074: * <PRE>
075: * CK_EC_KDF_TYPE kdf;
076: * </PRE>
077: */
078: public long kdf;
079:
080: /**
081: * <B>PKCS#11:</B>
082: * <PRE>
083: * CK_ULONG ulSharedDataLen;
084: * CK_BYTE_PTR pSharedData;
085: * </PRE>
086: */
087: public byte[] pSharedData;
088:
089: /**
090: * <B>PKCS#11:</B>
091: * <PRE>
092: * CK_ULONG ulPublicDataLen;
093: * CK_BYTE_PTR pPublicData;
094: * </PRE>
095: */
096: public byte[] pPublicData;
097:
098: /**
099: * <B>PKCS#11:</B>
100: * <PRE>
101: * CK_ULONG ulPrivateDataLen;
102: * </PRE>
103: */
104: public long ulPrivateDataLen;
105:
106: /**
107: * <B>PKCS#11:</B>
108: * <PRE>
109: * CK_OBJECT_HANDLE hPrivateData;
110: * </PRE>
111: */
112: public long hPrivateData;
113:
114: /**
115: * <B>PKCS#11:</B>
116: * <PRE>
117: * CK_ULONG ulPublicDataLen2;
118: * CK_BYTE_PTR pPublicData2;
119: * </PRE>
120: */
121: public byte[] pPublicData2;
122:
123: /**
124: * Returns the string representation of CK_PKCS5_PBKD2_PARAMS.
125: *
126: * @return the string representation of CK_PKCS5_PBKD2_PARAMS
127: */
128: public String toString() {
129: StringBuffer buffer = new StringBuffer();
130:
131: buffer.append(Constants.INDENT);
132: buffer.append("kdf: 0x");
133: buffer.append(Functions.toFullHexString(kdf));
134: buffer.append(Constants.NEWLINE);
135:
136: buffer.append(Constants.INDENT);
137: buffer.append("pSharedDataLen: ");
138: buffer.append(pSharedData.length);
139: buffer.append(Constants.NEWLINE);
140:
141: buffer.append(Constants.INDENT);
142: buffer.append("pSharedData: ");
143: buffer.append(Functions.toHexString(pSharedData));
144: buffer.append(Constants.NEWLINE);
145:
146: buffer.append(Constants.INDENT);
147: buffer.append("pPublicDataLen: ");
148: buffer.append(pPublicData.length);
149: buffer.append(Constants.NEWLINE);
150:
151: buffer.append(Constants.INDENT);
152: buffer.append("pPublicData: ");
153: buffer.append(Functions.toHexString(pPublicData));
154: buffer.append(Constants.NEWLINE);
155:
156: buffer.append(Constants.INDENT);
157: buffer.append("ulPrivateDataLen: ");
158: buffer.append(ulPrivateDataLen);
159: buffer.append(Constants.NEWLINE);
160:
161: buffer.append(Constants.INDENT);
162: buffer.append("hPrivateData: ");
163: buffer.append(hPrivateData);
164: buffer.append(Constants.NEWLINE);
165:
166: buffer.append(Constants.INDENT);
167: buffer.append("pPublicDataLen2: ");
168: buffer.append(pPublicData2.length);
169: buffer.append(Constants.NEWLINE);
170:
171: buffer.append(Constants.INDENT);
172: buffer.append("pPublicData2: ");
173: buffer.append(Functions.toHexString(pPublicData2));
174: //buffer.append(Constants.NEWLINE);
175:
176: return buffer.toString();
177: }
178:
179: }
|