**javacardx.framework.tlv** ====Class PrimitiveBERTag ==== *[[javacard:java-card-api:object|java.lang.Object]] \\ *[[javacard:java-card-api:bertag|javacardx.framework.tlv.BERTag]] \\ ---- public final class **PrimitiveBERTag**extends [[javacard:java-card-api:BERTag|BERTag]] The PrimitiveBERTag class encapsulates a primitive BER TLV tag. The rules on the allowed encoding of the Tag field is based on the ASN.1 BER encoding rules of ISO/IEC 8825-1:2002. The BERTag class and the subclasses ConstructedBERTag and PrimitiveBERTag, also provide static methods to parse or edit a BER Tag structure representation in a byte array. **Since:** 2.2.2 ---- ^ Field Summary ^^   ^ Fields inherited from class javacardx.framework.tlv.BERTag ^ | [[javacard:java-card-api:BERTag#BER_TAG_CLASS_MASK_APPLICATION|BER_TAG_CLASS_MASK_APPLICATION]] , [[javacard:java-card-api:BERTag#BER_TAG_CLASS_MASK_CONTEXT_SPECIFIC|BER_TAG_CLASS_MASK_CONTEXT_SPECIFIC]] , [[javacard:java-card-api:BERTag#BER_TAG_CLASS_MASK_PRIVATE|BER_TAG_CLASS_MASK_PRIVATE]] , [[javacard:java-card-api:BERTag#BER_TAG_CLASS_MASK_UNIVERSAL|BER_TAG_CLASS_MASK_UNIVERSAL]] , [[javacard:java-card-api:BERTag#BER_TAG_TYPE_CONSTRUCTED|BER_TAG_TYPE_CONSTRUCTED]] , [[javacard:java-card-api:BERTag#BER_TAG_TYPE_PRIMITIVE|BER_TAG_TYPE_PRIMITIVE]] |   ^ Constructor Summary ^^ | **[[javacard:java-card-api:PrimitiveBERTag#PrimitiveBERTag()|PrimitiveBERTag]] **()          Constructor creates an empty PrimitiveBERTag object capable of encapsulating a primitive BER TLV Tag. |   ^ Method Summary ^^ | ** void** | **[[javacard:java-card-api:PrimitiveBERTag#init(byte[], short)|init]] **(byte[] bArray,short bOff)          (Re-)Initialize this PrimitiveBERTLV Tag object from the binary representation in the byte array. | | ** void** | **[[javacard:java-card-api:PrimitiveBERTag#init(byte, short)|init]] **(byte tagClass,short tagNumber)          (Re-)Initialize this PrimitiveBERTag object with the specified tag class, and tag number. |   ^ Methods inherited from class javacardx.framework.tlv.BERTag ^ | [[javacard:java-card-api:BERTag#equals(javacardx.framework.tlv.BERTag)|equals]] , [[javacard:java-card-api:BERTag#getInstance(byte[], short)|getInstance]] , [[javacard:java-card-api:BERTag#isConstructed()|isConstructed]] , [[javacard:java-card-api:BERTag#isConstructed(byte[], short)|isConstructed]] , [[javacard:java-card-api:BERTag#size()|size]] , [[javacard:java-card-api:BERTag#size(byte[], short)|size]] , [[javacard:java-card-api:BERTag#tagClass()|tagClass]] , [[javacard:java-card-api:BERTag#tagClass(byte[], short)|tagClass]] , [[javacard:java-card-api:BERTag#tagNumber()|tagNumber]] , [[javacard:java-card-api:BERTag#tagNumber(byte[], short)|tagNumber]] , [[javacard:java-card-api:BERTag#toBytes(byte[], short)|toBytes]] , [[javacard:java-card-api:BERTag#toBytes(short, boolean, short, byte[], short)|toBytes]] , [[javacard:java-card-api:BERTag#verifyFormat(byte[], short)|verifyFormat]] |   ^ Methods inherited from class java.lang.Object ^ | [[javacard:java-card-api:Object#equals(java.lang.Object)|equals]] |   ^ Constructor Detail ^ === PrimitiveBERTag === public **PrimitiveBERTag**() Constructor creates an empty PrimitiveBERTag object capable of encapsulating a primitive BER TLV Tag. All implementations must support at least 3 byte Tags which can encode tag numbers up to 0x3FFF. ^ Method Detail ^ === init === public void **init**(byte tagClass, short tagNumber) throws [[javacard:java-card-api:TLVException|TLVException]] (Re-)Initialize this PrimitiveBERTag object with the specified tag class, and tag number. All implementations must support tag numbers up to 0x3FFF. **Parameters:**tagClass - encodes the tag class. Valid codes listed in BERTAG_CLASS_* constants. tagNumber - is the tag number. **Throws:** [[javacard:java-card-api:TLVException|TLVException]] - with the following reason codes: \\ *TLVException.ILLEGAL_SIZE if the tag number requested is larger than the supported maximum size \\ *TLVException.INVALID_PARAM if tag class parameter is invalid or if the tag number parameter is negative. \\ **See Also:**[[javacard:java-card-api:BERTag|BERTag]] ---- === init === public void **init**(byte[] bArray, short bOff) throws [[javacard:java-card-api:TLVException|TLVException]] (Re-)Initialize this PrimitiveBERTLV Tag object from the binary representation in the byte array. All implementations must support tag numbers up to 0x3FFF. **Specified by:**[[javacard:java-card-api:BERTag#init(byte[], short)|init]] in class [[javacard:java-card-api:BERTag|BERTag]] **Parameters:**bArray - the byte array containing the binary representation bOff - the offset within bArray where the tag binary value begins **Throws:** [[javacard:java-card-api:ArrayIndexOutOfBoundsException|ArrayIndexOutOfBoundsException]] - if accessing the input array would cause access of data outside array bounds, or if the array offset parameter is negative [[javacard:java-card-api:NullPointerException|NullPointerException]] - if bArray is null [[javacard:java-card-api:TLVException|TLVException]] - with the following reason codes: \\ *TLVException.ILLEGAL_SIZE if the tag number is larger than the supported maximum size \\ *TLVException.MALFORMED_TAG if tag representation in the byte array is malformed or is a constructed array tag \\