📄 ownerpin.html
字号:
<DD>Constructor. Allocates a new <code>PIN</code> instance with validated flag set to <code>false</code>.<P><DL><DT><B>Parameters:</B><DD><CODE>tryLimit</CODE> - the maximum number of times an incorrect PIN can be presented. <code>tryLimit</code> must be >=1<DD><CODE>maxPINSize</CODE> - the maximum allowed PIN size. <code>maxPINSize</code> must be >=1<DT><B>Throws:</B><DD><CODE><A HREF="../../javacard/framework/PINException.html" title="class in javacard.framework">PINException</A></CODE> - with the following reason codes:<ul> <li><code>PINException.ILLEGAL_VALUE</code> if <code>tryLimit</code> parameter is less than 1. <li><code>PINException.ILLEGAL_VALUE</code> if <code>maxPINSize</code> parameter is less than 1.</ul></DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getValidatedFlag()"><!-- --></A><H3>getValidatedFlag</H3><PRE>protected boolean <B>getValidatedFlag</B>()</PRE><DL><DD>This protected method returns the validated flag. This method is intended for subclass of this <code>OwnerPIN</code> to access or override the internal PIN state of the <code>OwnerPIN</code>.<P><DD><DL></DL></DD><DD><DL><DT><B>Returns:</B><DD>the boolean state of the PIN validated flag</DL></DD></DL><HR><A NAME="setValidatedFlag(boolean)"><!-- --></A><H3>setValidatedFlag</H3><PRE>protected void <B>setValidatedFlag</B>(boolean value)</PRE><DL><DD>This protected method sets the value of the validated flag. This method is intended for subclass of this <code>OwnerPIN</code> to control or override the internal PIN state of the <code>OwnerPIN</code>.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>value</CODE> - the new value for the validated flag</DL></DD></DL><HR><A NAME="getTriesRemaining()"><!-- --></A><H3>getTriesRemaining</H3><PRE>public byte <B>getTriesRemaining</B>()</PRE><DL><DD>Returns the number of times remaining that an incorrect PIN can be presented before the <code>PIN</code> is blocked.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javacard/framework/PIN.html#getTriesRemaining()">getTriesRemaining</A></CODE> in interface <CODE><A HREF="../../javacard/framework/PIN.html" title="interface in javacard.framework">PIN</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>the number of times remaining</DL></DD></DL><HR><A NAME="check(byte[], short, byte)"><!-- --></A><H3>check</H3><PRE>public boolean <B>check</B>(byte[] pin, short offset, byte length) throws <A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A>, <A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></PRE><DL><DD>Compares <code>pin</code> against the PIN value. If they match and the <code>PIN</code> is not blocked, it sets the validated flag and resets the try counter to its maximum. If it does not match, it decrements the try counter and, if the counter has reached zero, blocks the <code>PIN</code>. Even if a transaction is in progress, update of internal state - the try counter, the validated flag, and the blocking state, shall not participate in the transaction. <p> Note:<ul> <li><em>If </em><code>NullPointerException</code><em> or </em><code>ArrayIndexOutOfBoundsException</code><em> is thrown, the validated flag must be set to false, the try counter must be decremented and, the <code>PIN</code> blocked if the counter reaches zero.</em> <li><em>If </em><code>offset</code><em> or </em><code>length</code><em> parameter is negative an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>offset+length</code><em> is greater than </em><code>pin.length</code><em>, the length of the </em><code>pin</code><em> array, an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> <li><em>If </em><code>pin</code><em> parameter is </em><code>null</code><em> a </em><code>NullPointerException</code><em> exception is thrown.</em></ul><P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javacard/framework/PIN.html#check(byte[], short, byte)">check</A></CODE> in interface <CODE><A HREF="../../javacard/framework/PIN.html" title="interface in javacard.framework">PIN</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pin</CODE> - the byte array containing the PIN value being checked<DD><CODE>offset</CODE> - the starting offset in the <code>pin</code> array<DD><CODE>length</CODE> - the length of <code>pin</code><DT><B>Returns:</B><DD><code>true</code> if the PIN value matches; <code>false</code> otherwise<DT><B>Throws:</B><DD><CODE><A HREF="../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if the check operation would cause access of data outside array bounds.<DD><CODE><A HREF="../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>pin</code> is <code>null</code></DL></DD></DL><HR><A NAME="isValidated()"><!-- --></A><H3>isValidated</H3><PRE>public boolean <B>isValidated</B>()</PRE><DL><DD>Returns <code>true</code> if a valid PIN has been presented since the last card reset or last call to <code>reset()</code>.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javacard/framework/PIN.html#isValidated()">isValidated</A></CODE> in interface <CODE><A HREF="../../javacard/framework/PIN.html" title="interface in javacard.framework">PIN</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD><code>true</code> if validated; <code>false</code> otherwise</DL></DD></DL><HR><A NAME="reset()"><!-- --></A><H3>reset</H3><PRE>public void <B>reset</B>()</PRE><DL><DD>If the validated flag is set, this method resets the validated flag and resets the <code>PIN</code> try counter to the value of the <code>PIN</code> try limit. Even if a transaction is in progress, update of internal state - the try counter, the validated flag, and the blocking state, shall not participate in the transaction. If the validated flag is not set, this method does nothing.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../javacard/framework/PIN.html#reset()">reset</A></CODE> in interface <CODE><A HREF="../../javacard/framework/PIN.html" title="interface in javacard.framework">PIN</A></CODE></DL></DD><DD><DL></DL></DD></DL><HR><A NAME="update(byte[], short, byte)"><!-- --></A><H3>update</H3><PRE>public void <B>update</B>(byte[] pin, short offset, byte length) throws <A HREF="../../javacard/framework/PINException.html" title="class in javacard.framework">PINException</A></PRE><DL><DD>This method sets a new value for the PIN and resets the <code>PIN</code> try counter to the value of the <code>PIN</code> try limit. It also resets the validated flag.<p> This method copies the input pin parameter into an internal representation. If a transaction is in progress, the new pin and try counter update must be conditional i.e the copy operation must use the transaction facility.<P><DD><DL></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>pin</CODE> - the byte array containing the new PIN value<DD><CODE>offset</CODE> - the starting offset in the pin array<DD><CODE>length</CODE> - the length of the new PIN<DT><B>Throws:</B><DD><CODE><A HREF="../../javacard/framework/PINException.html" title="class in javacard.framework">PINException</A></CODE> - with the following reason codes:<ul> <li><code>PINException.ILLEGAL_VALUE</code> if length is greater than configured maximum PIN size.</ul><DT><B>See Also:</B><DD><A HREF="../../javacard/framework/JCSystem.html#beginTransaction()"><CODE>JCSystem.beginTransaction()</CODE></A></DL></DD></DL><HR><A NAME="resetAndUnblock()"><!-- --></A><H3>resetAndUnblock</H3><PRE>public void <B>resetAndUnblock</B>()</PRE><DL><DD>This method resets the validated flag and resets the <code>PIN</code> try counter to the value of the <code>PIN</code> try limit. Even if a transaction is in progress, update of internal state - the try counter, the validated flag, and the blocking state, shall not participate in the transaction. This method is used by the owner to re-enable the blocked <code>PIN</code>.<P><DD><DL></DL></DD><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/OwnerPIN.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java Card </b><br><font size="-1">v2.2.2</font></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../javacard/framework/MultiSelectable.html" title="interface in javacard.framework"><B>PREV CLASS</B></A> <A HREF="../../javacard/framework/PIN.html" title="interface in javacard.framework"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../index.html?javacard/framework/OwnerPIN.html" target="_top"><B>FRAMES</B></A> <A HREF="OwnerPIN.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 1993-2005 Sun Microsystems, Inc. 4150 Network Circle,<br>Santa Clara, CA, 95054, U.S.A. All Rights Reserved.</i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -