0N/A/*
0N/A * reserved comment block
0N/A * DO NOT REMOVE OR ALTER!
0N/A */
0N/A/* Copyright (c) 2002 Graz University of Technology. All rights reserved.
0N/A *
0N/A * Redistribution and use in source and binary forms, with or without
0N/A * modification, are permitted provided that the following conditions are met:
0N/A *
0N/A * 1. Redistributions of source code must retain the above copyright notice,
0N/A * this list of conditions and the following disclaimer.
0N/A *
0N/A * 2. Redistributions in binary form must reproduce the above copyright notice,
0N/A * this list of conditions and the following disclaimer in the documentation
0N/A * and/or other materials provided with the distribution.
0N/A *
0N/A * 3. The end-user documentation included with the redistribution, if any, must
0N/A * include the following acknowledgment:
0N/A *
0N/A * "This product includes software developed by IAIK of Graz University of
0N/A * Technology."
0N/A *
0N/A * Alternately, this acknowledgment may appear in the software itself, if
0N/A * and wherever such third-party acknowledgments normally appear.
0N/A *
0N/A * 4. The names "Graz University of Technology" and "IAIK of Graz University of
0N/A * Technology" must not be used to endorse or promote products derived from
0N/A * this software without prior written permission.
0N/A *
0N/A * 5. Products derived from this software may not be called
0N/A * "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior
0N/A * written permission of Graz University of Technology.
0N/A *
0N/A * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
0N/A * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
0N/A * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
0N/A * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE
0N/A * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
0N/A * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0N/A * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
0N/A * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
0N/A * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
0N/A * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
0N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
0N/A * POSSIBILITY OF SUCH DAMAGE.
0N/A */
0N/A
0N/Apackage sun.security.pkcs11.wrapper;
0N/A
0N/A
0N/A
0N/A/**
0N/A * class .<p>
0N/A * <B>PKCS#11 structure:</B>
0N/A * <PRE>
0N/A * typedef struct CK_DATE {&nbsp;&nbsp;
0N/A * CK_CHAR year[4];&nbsp;&nbsp;
0N/A * CK_CHAR month[2];&nbsp;&nbsp;
0N/A * CK_CHAR day[2];&nbsp;&nbsp;
0N/A * } CK_DATE;
0N/A * </PRE>
0N/A *
0N/A * @author Karl Scheibelhofer <Karl.Scheibelhofer@iaik.at>
0N/A * @author Martin Schlaeffer <schlaeff@sbox.tugraz.at>
0N/A */
0N/Apublic class CK_DATE implements Cloneable {
0N/A
0N/A /**
0N/A * <B>PKCS#11:</B>
0N/A * <PRE>
0N/A * CK_CHAR year[4]; - the year ("1900" - "9999")
0N/A * </PRE>
0N/A */
0N/A public char[] year; /* the year ("1900" - "9999") */
0N/A
0N/A /**
0N/A * <B>PKCS#11:</B>
0N/A * <PRE>
0N/A * CK_CHAR month[2]; - the month ("01" - "12")
0N/A * </PRE>
0N/A */
0N/A public char[] month; /* the month ("01" - "12") */
0N/A
0N/A /**
0N/A * <B>PKCS#11:</B>
0N/A * <PRE>
0N/A * CK_CHAR day[2]; - the day ("01" - "31")
0N/A * </PRE>
0N/A */
0N/A public char[] day; /* the day ("01" - "31") */
0N/A
0N/A public CK_DATE(char[] year, char[] month, char[] day) {
0N/A this.year = year;
0N/A this.month = month;
0N/A this.day = day;
0N/A }
0N/A
0N/A /**
0N/A * Create a (deep) clone of this object.
0N/A *
0N/A * @return A clone of this object.
0N/A */
0N/A public Object clone() {
0N/A CK_DATE copy = null;
0N/A try {
0N/A copy = (CK_DATE) super.clone();
0N/A } catch (CloneNotSupportedException cnse) {
0N/A // re-throw as RuntimeException
0N/A throw (RuntimeException)
0N/A (new RuntimeException("Clone error").initCause(cnse));
0N/A }
0N/A copy.year = this.year.clone();
0N/A copy.month = this.month.clone();
0N/A copy.day = this.day.clone();
0N/A
0N/A return copy;
0N/A }
0N/A
0N/A /**
0N/A * Returns the string representation of CK_DATE.
0N/A *
0N/A * @return the string representation of CK_DATE
0N/A */
0N/A public String toString() {
0N/A StringBuffer buffer = new StringBuffer();
0N/A
0N/A buffer.append(new String(day));
0N/A buffer.append('.');
0N/A buffer.append(new String(month));
0N/A buffer.append('.');
0N/A buffer.append(new String(year));
0N/A buffer.append(" (DD.MM.YYYY)");
0N/A
0N/A return buffer.toString();
0N/A }
0N/A
0N/A}