1 /*
2  * reserved comment block
3  * DO NOT REMOVE OR ALTER!
4  */
5 /* Copyright  (c) 2002 Graz University of Technology. All rights reserved.
6  *
7  * Redistribution and use in  source and binary forms, with or without
8  * modification, are permitted  provided that the following conditions are met:
9  *
10  * 1. Redistributions of  source code must retain the above copyright notice,
11  *    this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in  binary form must reproduce the above copyright notice,
14  *    this list of conditions and the following disclaimer in the documentation
15  *    and/or other materials provided with the distribution.
16  *
17  * 3. The end-user documentation included with the redistribution, if any, must
18  *    include the following acknowledgment:
19  *
20  *    "This product includes software developed by IAIK of Graz University of
21  *     Technology."
22  *
23  *    Alternately, this acknowledgment may appear in the software itself, if
24  *    and wherever such third-party acknowledgments normally appear.
25  *
26  * 4. The names "Graz University of Technology" and "IAIK of Graz University of
27  *    Technology" must not be used to endorse or promote products derived from
28  *    this software without prior written permission.
29  *
30  * 5. Products derived from this software may not be called
31  *    "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior
32  *    written permission of Graz University of Technology.
33  *
34  *  THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
35  *  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
36  *  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
37  *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE
38  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
39  *  OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
40  *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
41  *  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
42  *  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
43  *  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
44  *  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
45  *  POSSIBILITY  OF SUCH DAMAGE.
46  */
47 
48 package sun.security.pkcs11.wrapper;
49 
50 
51 
52 /**
53  * class CK_SSL3_KEY_MAT_OUT contains the resulting key handles and
54  * initialization vectors after performing a C_DeriveKey function with the
55  * CKM_SSL3_KEY_AND_MAC_DERIVE mechanism.<p>
56  * <B>PKCS#11 structure:</B>
57  * <PRE>
58  * typedef struct CK_SSL3_KEY_MAT_OUT {
59  *   CK_OBJECT_HANDLE hClientMacSecret;
60  *   CK_OBJECT_HANDLE hServerMacSecret;
61  *   CK_OBJECT_HANDLE hClientKey;
62  *   CK_OBJECT_HANDLE hServerKey;
63  *   CK_BYTE_PTR pIVClient;
64  *   CK_BYTE_PTR pIVServer;
65  * } CK_SSL3_KEY_MAT_OUT;
66  * </PRE>
67  *
68  * @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
69  * @author Martin Schlaeffer <schlaeff@sbox.tugraz.at>
70  */
71 public class CK_SSL3_KEY_MAT_OUT{
72 
73     /**
74      * <B>PKCS#11:</B>
75      * <PRE>
76      *   CK_OBJECT_HANDLE hClientMacSecret;
77      * </PRE>
78      */
79     public long hClientMacSecret;
80 
81     /**
82      * <B>PKCS#11:</B>
83      * <PRE>
84      *   CK_OBJECT_HANDLE hServerMacSecret;
85      * </PRE>
86      */
87     public long hServerMacSecret;
88 
89     /**
90      * <B>PKCS#11:</B>
91      * <PRE>
92      *   CK_OBJECT_HANDLE hClientKey;
93      * </PRE>
94      */
95     public long hClientKey;
96 
97     /**
98      * <B>PKCS#11:</B>
99      * <PRE>
100      *   CK_OBJECT_HANDLE hServerKey;
101      * </PRE>
102      */
103     public long hServerKey;
104 
105     /**
106      * <B>PKCS#11:</B>
107      * <PRE>
108      *   CK_BYTE_PTR pIVClient;
109      * </PRE>
110      */
111     public byte[] pIVClient;
112 
113     /**
114      * <B>PKCS#11:</B>
115      * <PRE>
116      *   CK_BYTE_PTR pIVServer;
117      * </PRE>
118      */
119     public byte[] pIVServer;
120 
121     /**
122      * Returns the string representation of CK_SSL3_KEY_MAT_OUT.
123      *
124      * @return the string representation of CK_SSL3_KEY_MAT_OUT
125      */
toString()126     public String toString() {
127         StringBuilder buffer = new StringBuilder();
128 
129         buffer.append(Constants.INDENT);
130         buffer.append("hClientMacSecret: ");
131         buffer.append(hClientMacSecret);
132         buffer.append(Constants.NEWLINE);
133 
134         buffer.append(Constants.INDENT);
135         buffer.append("hServerMacSecret: ");
136         buffer.append(hServerMacSecret);
137         buffer.append(Constants.NEWLINE);
138 
139         buffer.append(Constants.INDENT);
140         buffer.append("hClientKey: ");
141         buffer.append(hClientKey);
142         buffer.append(Constants.NEWLINE);
143 
144         buffer.append(Constants.INDENT);
145         buffer.append("hServerKey: ");
146         buffer.append(hServerKey);
147         buffer.append(Constants.NEWLINE);
148 
149         buffer.append(Constants.INDENT);
150         buffer.append("pIVClient: ");
151         buffer.append(Functions.toHexString(pIVClient));
152         buffer.append(Constants.NEWLINE);
153 
154         buffer.append(Constants.INDENT);
155         buffer.append("pIVServer: ");
156         buffer.append(Functions.toHexString(pIVServer));
157         //buffer.append(Constants.NEWLINE);
158 
159         return buffer.toString();
160     }
161 
162 }
163