📄 bertlv.html
字号:
<CODE>BERTLV</CODE> is set based on the size of the input TLV data structure. <p> Note:<ul> <li><em>If </em><code>bOff+bLen</code><em> is greater than </em><code>bArray.length</code><em>, the length of the </em><code>bArray</code><em> array, an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</CODE> - input byte array<DD><CODE>bOff</CODE> - offset within byte array containing the TLV data<DD><CODE>bLen</CODE> - byte length of input data<DT><B>Returns:</B><DD>the resulting size of <code>this</code> TLV if represented in bytes<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if accessing the input array would cause access of data outside array bounds, or if the array offset or array length parameter is negative<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>bArray</code> is <code>null</code><DD><CODE><A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></CODE> - with the following reason codes:<ul> <li><code>TLVException.INSUFFICIENT_STORAGE</code> if the required capacity is not available and the implementation does not support automatic expansion. <li><code>TLVException.MALFORMED_TLV</code> if the input data is not a well-formed BER TLV or the input data represents a primitive BER TLV structure and <code>this</code> is a <code>ConstructedBERTLV</code> object or the input data represents a constructed BER TLV structure and <code>this</code> is a <code>PrimiitveBERTLV</code> object. </ul></DL></DD></DL><HR><A NAME="getInstance(byte[], short, short)"><!-- --></A><H3>getInstance</H3><PRE>public static <A HREF="../../../javacardx/framework/tlv/BERTLV.html" title="class in javacardx.framework.tlv">BERTLV</A> <B>getInstance</B>(byte[] bArray, short bOff, short bLen) throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Creates the <CODE>BERTLV</CODE> using the input binary data. The resulting BER TLV object may be a primitive or a constructed TLV object. The object must be cast to the correct sub-class: <code>ConstructedBERTLV</code> or <code>PrimitiveBERTLV</code> to access the specialized API. The <code>init( byte[] bArray, short bOff, short bLen )</code> methods of the appropriate <CODE>BERTLV</CODE> classes will be used to initialize the created TLV object. <p> Note:<ul> <li><em>If </em><code>bOff+bLen</code><em> is greater than </em><code>bArray.length</code><em>, the length of the </em><code>bArray</code><em> array, an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</CODE> - input byte array<DD><CODE>bOff</CODE> - offset within byte array containing the tlv data<DD><CODE>bLen</CODE> - byte length of input data<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if accessing the input array would cause access of data outside array bounds, or if the array offset or array length parameter is negative<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>bArray</code> is <code>null</code><DD><CODE><A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></CODE> - with the following reason codes:<ul> <li><code>TLVException.ILLEGAL_SIZE</code> if the TLV structure requested is larger than the supported maximum size <li><code>TLVException.MALFORMED_TLV</code> if the input data is not a well-formed BER TLV. </ul></DL></DD></DL><HR><A NAME="toBytes(byte[], short)"><!-- --></A><H3>toBytes</H3><PRE>public short <B>toBytes</B>(byte[] outBuf, short bOff)</PRE><DL><DD>Writes <code>this</code> TLV structure to the specified byte array.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>outBuf</CODE> - output byte array<DD><CODE>bOff</CODE> - offset within byte array output data begins<DT><B>Returns:</B><DD>the byte length written to the output array<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if accessing the output array would cause access of data outside array bounds, or if the array offset parameter is negative<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>outBuf</code> is <code>null</code><DD><CODE><A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></CODE> - with the following reason codes:<ul> <li><code>TLVException.TLV_SIZE_GREATER_THAN_32767</code> if the size of the BER TLV is > 32767. <li><code>TLVException.EMPTY_TLV</code> if the <CODE>BERTLV</CODE> object is empty. </ul></DL></DD></DL><HR><A NAME="getTag()"><!-- --></A><H3>getTag</H3><PRE>public <A HREF="../../../javacardx/framework/tlv/BERTag.html" title="class in javacardx.framework.tlv">BERTag</A> <B>getTag</B>() throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Returns <code>this</code> value of the TLV object's Tag component<P><DD><DL><DT><B>Returns:</B><DD>the Tag for <code>this</code> <CODE>BERTLV</CODE> object<DT><B>Throws:</B><DD><CODE><A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></CODE> - with the following reason codes:<ul> <li><code>TLVException.EMPTY_TLV</code> if the <CODE>BERTLV</CODE> object is empty. </ul></DL></DD></DL><HR><A NAME="getLength()"><!-- --></A><H3>getLength</H3><PRE>public short <B>getLength</B>() throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Returns the value of <code>this</code> TLV object's Length component<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></CODE> - with the following reason codes:<ul> <li><code>TLVException.TLV_LENGTH_GREATER_THAN_32767</code> if the value of the Length component is > 32767. <li><code>TLVException.EMPTY_TLV</code> if the <CODE>BERTLV</CODE> object is empty. </ul></DL></DD></DL><HR><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public short <B>size</B>()</PRE><DL><DD>Returns the number of bytes required to represent <code>this</code> TLV structure<P><DD><DL><DT><B>Returns:</B><DD>the byte length of the TLV<DT><B>Throws:</B><DD><CODE><A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></CODE> - with the following reason codes:<ul> <li><code>TLVException.TLV_SIZE_GREATER_THAN_32767</code> if the size of TLV structure is > 32767. <li><code>TLVException.EMPTY_TLV</code> if the <CODE>BERTLV</CODE> object is empty. </ul></DL></DD></DL><HR><A NAME="verifyFormat(byte[], short, short)"><!-- --></A><H3>verifyFormat</H3><PRE>public static boolean <B>verifyFormat</B>(byte[] berTlvArray, short bOff, short bLen)</PRE><DL><DD>Checks if the input data is a well-formed BER TLV representation. <p> Note:<ul> <li><em>If </em><code>bOff+bLen</code><em> is greater than </em><code>berTlvArray.length</code><em>, the length of the </em><code>berTlvArray</code><em> array, an </em><code>ArrayIndexOutOfBoundsException</code><em> exception is thrown.</em> </ul><P><DD><DL><DT><B>Parameters:</B><DD><CODE>berTlvArray</CODE> - input byte array<DD><CODE>bOff</CODE> - offset within byte array containing first byte<DD><CODE>bLen</CODE> - byte length of input BER TLV data<DT><B>Returns:</B><DD><CODE>true</CODE> if input data is a well formed BER TLV structure, <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 accessing the input array would cause access of data outside array bounds, or if the array offset or array length parameter is negative<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>berTlvArray</code> is <code>null</code></DL></DD></DL><HR><A NAME="getTag(byte[], short, byte[], short)"><!-- --></A><H3>getTag</H3><PRE>public static short <B>getTag</B>(byte[] berTLVArray, short bTLVOff, byte[] berTagArray, short bTagOff) throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Copies the tag component in the TLV representation in the specified input byte array to the specified output byte array<P><DD><DL><DT><B>Parameters:</B><DD><CODE>berTLVArray</CODE> - input byte array<DD><CODE>bTLVOff</CODE> - offset within byte array containing the tlv data<DD><CODE>berTagArray</CODE> - output Tag byte array<DD><CODE>bTagOff</CODE> - offset within byte array where output begins<DT><B>Returns:</B><DD>the size of the output BER Tag<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if accessing the input or output array would cause access of data outside array bounds, or if either array offset parameter is negative<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if either <code>berTLVArray</code> or <code>berTagArray</code> is <code>null</code><DD><CODE><A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></CODE> - with the following reason codes:<ul> <li><code>TLVException.ILLEGAL_SIZE</code> if the size of the Tag component is > 32767. <li><code>TLVException.MALFORMED_TLV</code> if the input data is not a well-formed BER TLV. </ul></DL></DD></DL><HR><A NAME="getLength(byte[], short)"><!-- --></A><H3>getLength</H3><PRE>public static short <B>getLength</B>(byte[] berTLVArray, short bOff) throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Returns the value of the TLV Structure's Length component in the specified input byte array<P><DD><DL><DT><B>Parameters:</B><DD><CODE>berTLVArray</CODE> - input byte array<DD><CODE>bOff</CODE> - offset within byte array containing the tlv data<DT><B>Returns:</B><DD>the length value in the TLV representation in the specified byte array<DT><B>Throws:</B><DD><CODE><A HREF="../../../java/lang/ArrayIndexOutOfBoundsException.html" title="class in java.lang">ArrayIndexOutOfBoundsException</A></CODE> - if accessing the input array would cause access of data outside array bounds, or if the array offset parameter is negative<DD><CODE><A HREF="../../../java/lang/NullPointerException.html" title="class in java.lang">NullPointerException</A></CODE> - if <code>berTLVArray</code><DD><CODE><A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></CODE> - with the following reason codes:<ul> <li><code>TLVException.TLV_LENGTH_GREATER_THAN_32767</code> if the length element(L) > 32767. <li><code>TLVException.MALFORMED_TLV</code> if the input data is not a well-formed BER TLV. </ul></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/BERTLV.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="../../../javacardx/framework/tlv/BERTag.html" title="class in javacardx.framework.tlv"><B>PREV CLASS</B></A> <A HREF="../../../javacardx/framework/tlv/ConstructedBERTag.html" title="class in javacardx.framework.tlv"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?javacardx/framework/tlv/BERTLV.html" target="_top"><B>FRAMES</B></A> <A HREF="BERTLV.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 + -