/*
*/
/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
*
* 3. The end-user documentation included with the redistribution, if any, must
* include the following acknowledgment:
*
* "This product includes software developed by IAIK of Graz University of
* Technology."
*
* Alternately, this acknowledgment may appear in the software itself, if
* and wherever such third-party acknowledgments normally appear.
*
* 4. The names "Graz University of Technology" and "IAIK of Graz University of
* Technology" must not be used to endorse or promote products derived from
* this software without prior written permission.
*
* 5. Products derived from this software may not be called
* "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior
* written permission of Graz University of Technology.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/**
* class CK_TOKEN_INFO provides information about a token.<p>
* <B>PKCS#11 structure:</B>
* <PRE>
* typedef struct CK_TOKEN_INFO {
* CK_UTF8CHAR label[32];
* CK_UTF8CHAR manufacturerID[32];
* CK_UTF8CHAR model[16];
* CK_CHAR serialNumber[16];
* CK_FLAGS flags;
* CK_ULONG ulMaxSessionCount;
* CK_ULONG ulSessionCount;
* CK_ULONG ulMaxRwSessionCount;
* CK_ULONG ulRwSessionCount;
* CK_ULONG ulMaxPinLen;
* CK_ULONG ulMinPinLen;
* CK_ULONG ulTotalPublicMemory;
* CK_ULONG ulFreePublicMemory;
* CK_ULONG ulTotalPrivateMemory;
* CK_ULONG ulFreePrivateMemory;
* CK_VERSION hardwareVersion;
* CK_VERSION firmwareVersion;
* CK_CHAR utcTime[16];
* } CK_TOKEN_INFO;
*
* </PRE>
*
* @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
* @author Martin Schlaeffer <schlaeff@sbox.tugraz.at>
*/
public class CK_TOKEN_INFO {
/* label, manufacturerID, and model have been changed from
* CK_CHAR to CK_UTF8CHAR for v2.11. */
/**
* must be blank padded and only the first 32 chars will be used<p>
* <B>PKCS#11:</B>
* <PRE>
* CK_UTF8CHAR label[32];
* </PRE>
*/
/**
* must be blank padded and only the first 32 chars will be used<p>
* <B>PKCS#11:</B>
* <PRE>
* CK_UTF8CHAR manufacturerID[32];
* </PRE>
*/
/**
* must be blank padded and only the first 16 chars will be used<p>
* <B>PKCS#11:</B>
* <PRE>
* CK_UTF8CHAR model[16];
* </PRE>
*/
/**
* must be blank padded and only the first 16 chars will be used<p>
* <B>PKCS#11:</B>
* <PRE>
* CK_CHAR serialNumber[16];
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_FLAGS flags;
* </PRE>
*/
/* ulMaxSessionCount, ulSessionCount, ulMaxRwSessionCount,
* ulRwSessionCount, ulMaxPinLen, and ulMinPinLen have all been
* changed from CK_USHORT to CK_ULONG for v2.0 */
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulMaxSessionCount;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulSessionCount;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulMaxRwSessionCount;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulRwSessionCount;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulMaxPinLen;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulMinPinLen;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulTotalPublicMemory;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulFreePublicMemory;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulTotalPrivateMemory;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_ULONG ulFreePrivateMemory;
* </PRE>
*/
/* hardwareVersion, firmwareVersion, and time are new for
* v2.0 */
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_VERSION hardwareVersion;
* </PRE>
*/
/**
* <B>PKCS#11:</B>
* <PRE>
* CK_VERSION firmwareVersion;
* </PRE>
*/
/**
* only the first 16 chars will be used
* <B>PKCS#11:</B>
* <PRE>
* CK_CHAR utcTime[16];
* </PRE>
*/
long sessionMax, long session,
long rwSessionMax, long rwSession,
long totalPubMem, long freePubMem,
long totalPrivMem, long freePrivMem,
this.manufacturerID = vendor;
this.serialNumber = serialNo;
this.ulMaxSessionCount = sessionMax;
this.ulSessionCount = session;
this.ulMaxRwSessionCount = rwSessionMax;
this.ulRwSessionCount = rwSession;
this.ulMaxPinLen = pinLenMax;
this.ulMinPinLen = pinLenMin;
this.ulTotalPublicMemory = totalPubMem;
this.ulFreePublicMemory = freePubMem;
this.ulTotalPrivateMemory = totalPrivMem;
this.ulFreePrivateMemory = freePrivMem;
this.hardwareVersion = hwVer;
this.firmwareVersion = fwVer;
}
/**
* Returns the string representation of CK_TOKEN_INFO.
*
* @return the string representation of CK_TOKEN_INFO
*/
? "CK_EFFECTIVELY_INFINITE"
? "CK_UNAVAILABLE_INFORMATION"
? "CK_UNAVAILABLE_INFORMATION"
? "CK_EFFECTIVELY_INFINITE"
? "CK_UNAVAILABLE_INFORMATION"
? "CK_UNAVAILABLE_INFORMATION"
? "CK_UNAVAILABLE_INFORMATION"
? "CK_UNAVAILABLE_INFORMATION"
? "CK_UNAVAILABLE_INFORMATION"
? "CK_UNAVAILABLE_INFORMATION"
//buffer.append(Constants.NEWLINE);
}
}