Path: blob/master/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/wrapper/CK_PKCS5_PBKD2_PARAMS.java
41921 views
/*1* reserved comment block2* DO NOT REMOVE OR ALTER!3*/4/* Copyright (c) 2002 Graz University of Technology. All rights reserved.5*6* Redistribution and use in source and binary forms, with or without7* modification, are permitted provided that the following conditions are met:8*9* 1. Redistributions of source code must retain the above copyright notice,10* this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright notice,13* this list of conditions and the following disclaimer in the documentation14* and/or other materials provided with the distribution.15*16* 3. The end-user documentation included with the redistribution, if any, must17* include the following acknowledgment:18*19* "This product includes software developed by IAIK of Graz University of20* Technology."21*22* Alternately, this acknowledgment may appear in the software itself, if23* and wherever such third-party acknowledgments normally appear.24*25* 4. The names "Graz University of Technology" and "IAIK of Graz University of26* Technology" must not be used to endorse or promote products derived from27* this software without prior written permission.28*29* 5. Products derived from this software may not be called30* "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior31* written permission of Graz University of Technology.32*33* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED34* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED35* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR36* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE37* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,38* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,39* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,40* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON41* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,42* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY43* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE44* POSSIBILITY OF SUCH DAMAGE.45*/4647package sun.security.pkcs11.wrapper;48495051/**52* class CK_PKCS5_PBKD2_PARAMS provides the parameters to the CKM_PKCS5_PBKD253* mechanism.<p>54* <B>PKCS#11 structure:</B>55* <PRE>56* typedef struct CK_PKCS5_PBKD2_PARAMS {57* CK_PKCS5_PBKD2_SALT_SOURCE_TYPE saltSource;58* CK_VOID_PTR pSaltSourceData;59* CK_ULONG ulSaltSourceDataLen;60* CK_ULONG iterations;61* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf;62* CK_VOID_PTR pPrfData;63* CK_ULONG ulPrfDataLen;64* } CK_PKCS5_PBKD2_PARAMS;65* </PRE>66*67* @author Karl Scheibelhofer <[email protected]>68* @author Martin Schlaeffer <[email protected]>69*/70public class CK_PKCS5_PBKD2_PARAMS {7172/**73* <B>PKCS#11:</B>74* <PRE>75* CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE saltSource;76* </PRE>77*/78public long saltSource;7980/**81* <B>PKCS#11:</B>82* <PRE>83* CK_VOID_PTR pSaltSourceData;84* CK_ULONG ulSaltSourceDataLen;85* </PRE>86*/87public byte[] pSaltSourceData;8889/**90* <B>PKCS#11:</B>91* <PRE>92* CK_ULONG iterations;93* </PRE>94*/95public long iterations;9697/**98* <B>PKCS#11:</B>99* <PRE>100* CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE prf;101* </PRE>102*/103public long prf;104105/**106* <B>PKCS#11:</B>107* <PRE>108* CK_VOID_PTR pPrfData;109* CK_ULONG ulPrfDataLen;110* </PRE>111*/112public byte[] pPrfData;113114/**115* Returns the string representation of CK_PKCS5_PBKD2_PARAMS.116*117* @return the string representation of CK_PKCS5_PBKD2_PARAMS118*/119public String toString() {120StringBuilder sb = new StringBuilder();121122sb.append(Constants.INDENT);123sb.append("saltSource: ");124sb.append(saltSource);125sb.append(Constants.NEWLINE);126127sb.append(Constants.INDENT);128sb.append("pSaltSourceData: ");129sb.append(Functions.toHexString(pSaltSourceData));130sb.append(Constants.NEWLINE);131132sb.append(Constants.INDENT);133sb.append("ulSaltSourceDataLen: ");134sb.append(pSaltSourceData.length);135sb.append(Constants.NEWLINE);136137sb.append(Constants.INDENT);138sb.append("iterations: ");139sb.append(iterations);140sb.append(Constants.NEWLINE);141142sb.append(Constants.INDENT);143sb.append("prf: ");144sb.append(prf);145sb.append(Constants.NEWLINE);146147sb.append(Constants.INDENT);148sb.append("pPrfData: ");149sb.append(Functions.toHexString(pPrfData));150sb.append(Constants.NEWLINE);151152sb.append(Constants.INDENT);153sb.append("ulPrfDataLen: ");154sb.append(pPrfData.length);155//buffer.append(Constants.NEWLINE);156157return sb.toString();158}159160}161162163