bertag.html

来自「JAVA CARD 开发包规格说明,版本为2.2.2」· HTML 代码 · 共 852 行 · 第 1/3 页

HTML
852
字号
</TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;short</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacardx/framework/tlv/BERTag.html#tagNumber()">tagNumber</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the tag number part of <code>this</code> BER Tag structure</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;short</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacardx/framework/tlv/BERTag.html#tagNumber(byte[], short)">tagNumber</A></B>(byte[]&nbsp;berTagArray,          short&nbsp;bOff)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the tag number part of the BER Tag from its representation in the specified byte array</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;short</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacardx/framework/tlv/BERTag.html#toBytes(byte[], short)">toBytes</A></B>(byte[]&nbsp;outBuf,        short&nbsp;bOffset)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the representation of <code>this</code> BER tag structure to the byte array</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;short</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacardx/framework/tlv/BERTag.html#toBytes(short, boolean, short, byte[], short)">toBytes</A></B>(short&nbsp;tagClass,        boolean&nbsp;isConstructed,        short&nbsp;tagNumber,        byte[]&nbsp;outArray,        short&nbsp;bOff)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the BER Tag bytes representing the specified tag class, constructed flag and the tag number as a BER Tag representation in the specified byte array</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javacardx/framework/tlv/BERTag.html#verifyFormat(byte[], short)">verifyFormat</A></B>(byte[]&nbsp;berTagArray,             short&nbsp;bOff)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Checks if the input data is a well-formed BER Tag representation</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="../../../java/lang/Object.html" title="class in java.lang">Object</A></B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../java/lang/Object.html#equals(java.lang.Object)">equals</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ============ FIELD DETAIL =========== --><A NAME="field_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>Field Detail</B></FONT></TH></TR></TABLE><A NAME="BER_TAG_CLASS_MASK_UNIVERSAL"><!-- --></A><H3>BER_TAG_CLASS_MASK_UNIVERSAL</H3><PRE>public static final byte <B>BER_TAG_CLASS_MASK_UNIVERSAL</B></PRE><DL><DD>Constant for BER Tag Class Universal<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javacardx.framework.tlv.BERTag.BER_TAG_CLASS_MASK_UNIVERSAL">Constant Field Values</A></DL></DL><HR><A NAME="BER_TAG_CLASS_MASK_APPLICATION"><!-- --></A><H3>BER_TAG_CLASS_MASK_APPLICATION</H3><PRE>public static final byte <B>BER_TAG_CLASS_MASK_APPLICATION</B></PRE><DL><DD>Constant for BER Tag Class Application<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javacardx.framework.tlv.BERTag.BER_TAG_CLASS_MASK_APPLICATION">Constant Field Values</A></DL></DL><HR><A NAME="BER_TAG_CLASS_MASK_CONTEXT_SPECIFIC"><!-- --></A><H3>BER_TAG_CLASS_MASK_CONTEXT_SPECIFIC</H3><PRE>public static final byte <B>BER_TAG_CLASS_MASK_CONTEXT_SPECIFIC</B></PRE><DL><DD>Constant for BER Tag Class Context-Specific<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javacardx.framework.tlv.BERTag.BER_TAG_CLASS_MASK_CONTEXT_SPECIFIC">Constant Field Values</A></DL></DL><HR><A NAME="BER_TAG_CLASS_MASK_PRIVATE"><!-- --></A><H3>BER_TAG_CLASS_MASK_PRIVATE</H3><PRE>public static final byte <B>BER_TAG_CLASS_MASK_PRIVATE</B></PRE><DL><DD>Constant for BER Tag Class Private<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javacardx.framework.tlv.BERTag.BER_TAG_CLASS_MASK_PRIVATE">Constant Field Values</A></DL></DL><HR><A NAME="BER_TAG_TYPE_CONSTRUCTED"><!-- --></A><H3>BER_TAG_TYPE_CONSTRUCTED</H3><PRE>public static final boolean <B>BER_TAG_TYPE_CONSTRUCTED</B></PRE><DL><DD>Constant for constructed BER Tag type<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javacardx.framework.tlv.BERTag.BER_TAG_TYPE_CONSTRUCTED">Constant Field Values</A></DL></DL><HR><A NAME="BER_TAG_TYPE_PRIMITIVE"><!-- --></A><H3>BER_TAG_TYPE_PRIMITIVE</H3><PRE>public static final boolean <B>BER_TAG_TYPE_PRIMITIVE</B></PRE><DL><DD>Constant for primitive BER Tag type<P><DL><DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#javacardx.framework.tlv.BERTag.BER_TAG_TYPE_PRIMITIVE">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_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>Constructor Detail</B></FONT></TH></TR></TABLE><A NAME="BERTag()"><!-- --></A><H3>BERTag</H3><PRE>protected <B>BERTag</B>()</PRE><DL><DD>Constructor creates an empty <CODE>BERTLV</CODE> Tag object capable of encapsulating a BER TLV Tag. All implementations must support at least 3 byte Tags which can encode tag numbers up to 0x3FFF.<P></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="init(byte[], short)"><!-- --></A><H3>init</H3><PRE>public abstract void <B>init</B>(byte[]&nbsp;bArray,                          short&nbsp;bOff)                   throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Abstract init method. (Re-)Initialize <code>this</code> <CODE>BERTag</CODE> object from the binary representation in the byte array. All implementations must support tag numbers up to 0x3FFF.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</CODE> - the byte array containing the binary representation<DD><CODE>bOff</CODE> - the offset within bArray where the tag binary begins<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>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 tag number requested is larger than the supported maximum size <li><code>TLVException.MALFORMED_TAG</code> if tag representation in the byte array is malformed </ul></DL></DD></DL><HR><A NAME="getInstance(byte[], short)"><!-- --></A><H3>getInstance</H3><PRE>public static <A HREF="../../../javacardx/framework/tlv/BERTag.html" title="class in javacardx.framework.tlv">BERTag</A> <B>getInstance</B>(byte[]&nbsp;bArray,                                 short&nbsp;bOff)                          throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Create a <CODE>BERTLV</CODE> Tag object from the binary representation in the byte array. All implementations must support tag numbers up to 0x3FFF. Note that the returned <CODE>BERTag</CODE> must be cast to the correct subclass: <code>PrimitiveBERTag</code> or <code>ConstructedBERTag</code> to access their specialized API.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>bArray</CODE> - the byte array containing the binary representation<DD><CODE>bOff</CODE> - the offset within bArray where the tag binary begins<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>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 tag number requested is larger than the supported maximum size <li><code>TLVException.MALFORMED_TAG</code> if tag representation in the byte array is malformed. </ul></DL></DD></DL><HR><A NAME="size()"><!-- --></A><H3>size</H3><PRE>public byte <B>size</B>()          throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Returns the byte size required to represent <code>this</code> tag structure<P><DD><DL><DT><B>Returns:</B><DD>size of BER Tag in bytes<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.TAG_SIZE_GREATER_THAN_127</code> if the size of the BER Tag is > 127. <li><code>TLVException.EMPTY_TAG</code> if the BER Tag is empty. </ul></DL></DD></DL><HR><A NAME="toBytes(byte[], short)"><!-- --></A><H3>toBytes</H3><PRE>public short <B>toBytes</B>(byte[]&nbsp;outBuf,                     short&nbsp;bOffset)              throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Writes the representation of <code>this</code> BER tag structure to the byte array<P><DD><DL><DT><B>Parameters:</B><DD><CODE>outBuf</CODE> - the byteArray where the BER tag is written<DD><CODE>bOffset</CODE> - offset within outBuf where BER tag value starts<DT><B>Returns:</B><DD>size of BER Tag 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 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.EMPTY_TAG</code> if the BER Tag is empty. </ul></DL></DD></DL><HR><A NAME="tagNumber()"><!-- --></A><H3>tagNumber</H3><PRE>public short <B>tagNumber</B>()                throws <A HREF="../../../javacardx/framework/tlv/TLVException.html" title="class in javacardx.framework.tlv">TLVException</A></PRE><DL><DD>Returns the tag number part of <code>this</code> BER Tag structure<P><DD><DL>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?