Lines Matching defs:tag

57     /** The tag class types */
63 /** The DER tag of the value; one of the tag_ constants. */
64 public byte tag;
77 * The original encoded form of the whole value (tag, length, and value)
173 * Returns true if the tag class is UNIVERSAL.
175 public boolean isUniversal() { return ((tag & 0x0c0) == 0x000); }
178 * Returns true if the tag class is APPLICATION.
180 public boolean isApplication() { return ((tag & 0x0c0) == 0x040); }
183 * Returns true iff the CONTEXT SPECIFIC bit is set in the type tag.
186 public boolean isContextSpecific() { return ((tag & 0x0c0) == 0x080); }
189 * Returns true iff the CONTEXT SPECIFIC TAG matches the passed tag.
195 return ((tag & 0x01f) == cntxtTag);
198 boolean isPrivate() { return ((tag & 0x0c0) == 0x0c0); }
200 /** Returns true iff the CONSTRUCTED bit is set in the type tag. */
201 public boolean isConstructed() { return ((tag & 0x020) == 0x020); }
204 * Returns true iff the CONSTRUCTED TAG matches the passed tag.
210 return ((tag & 0x01f) == constructedTag);
230 * @param stringTag the tag for the DER value to create
238 * Creates a DerValue from a tag and some DER-encoded data.
240 * @param tag the DER type tag
243 public DerValue(byte tag, byte[] data) {
244 this.tag = tag;
261 tag = (byte)in.read();
267 int offset = 2; // for tag and length bytes
269 indefData[0] = tag;
276 if (tag != inbuf.read())
306 * its tag and length.
317 * its tag and length.
343 tag = stringTag;
380 tag = (byte)in.read();
385 int offset = 2; // for tag and length bytes
387 indefData[0] = tag;
394 if (tag != in.read())
414 out.write(tag);
435 return tag;
444 if (tag != tag_Boolean) {
445 throw new IOException("DerValue.getBoolean, not a BOOLEAN " + tag);
463 if (tag != tag_ObjectId)
464 throw new IOException("DerValue.getOID, not an OID " + tag);
487 if (tag != tag_OctetString && !isConstructed(tag_OctetString)) {
489 "DerValue.getOctetString, not an Octet String: " + tag);
515 if (tag != tag_Integer) {
516 throw new IOException("DerValue.getInteger, not an int " + tag);
527 if (tag != tag_Integer)
528 throw new IOException("DerValue.getBigInteger, not an int " + tag);
540 if (tag != tag_Integer)
541 throw new IOException("DerValue.getBigInteger, not an int " + tag);
551 if (tag != tag_Enumerated) {
552 throw new IOException("DerValue.getEnumerated, incorrect tag: "
553 + tag);
564 if (tag != tag_BitString)
566 "DerValue.getBitString, not a bit string " + tag);
577 if (tag != tag_BitString)
579 "DerValue.getBitString, not a bit string " + tag);
590 if (tag == tag_UTF8String)
592 else if (tag == tag_PrintableString)
594 else if (tag == tag_T61String)
596 else if (tag == tag_IA5String)
599 else if (tag == tag_UniversalString)
602 else if (tag == tag_BMPString)
604 else if (tag == tag_GeneralString)
611 * Returns an ASN.1 BIT STRING value, with the tag assumed implicit
614 * @params tagImplicit if true, the tag is assumed implicit.
619 if (tag != tag_BitString)
621 + tag);
627 * Returns an ASN.1 BIT STRING value, with the tag assumed implicit
630 * @params tagImplicit if true, the tag is assumed implicit.
636 if (tag != tag_BitString)
638 + tag);
663 if (tag != tag_PrintableString)
665 "DerValue.getPrintableString, not a string " + tag);
676 if (tag != tag_T61String)
678 "DerValue.getT61String, not T61 " + tag);
689 if (tag != tag_IA5String)
691 "DerValue.getIA5String, not IA5 " + tag);
703 if (tag != tag_BMPString)
705 "DerValue.getBMPString, not BMP " + tag);
719 if (tag != tag_UTF8String)
721 "DerValue.getUTF8String, not UTF-8 " + tag);
733 if (tag != tag_GeneralString)
735 "DerValue.getGeneralString, not GeneralString " + tag);
746 if (tag != tag_UtcTime) {
747 throw new IOException("DerValue.getUTCTime, not a UtcTime: " + tag);
758 if (tag != tag_GeneralizedTime) {
760 "DerValue.getGeneralizedTime, not a GeneralizedTime: " + tag);
789 if (tag != other.tag) {
827 if (tag == tag_Null)
829 if (tag == tag_ObjectId)
834 return "[DerValue, tag = " + tag
856 * @return DER-encoded value, including tag and length.
873 if (tag == tag_Sequence || tag == tag_Set)
875 throw new IOException("toDerInputStream rejects tag type " + tag);
928 * Create the tag of the attribute.
930 * @params class the tag class type, one of UNIVERSAL, CONTEXT,
934 * @params val the tag value
937 byte tag = (byte)(tagClass | val);
939 tag |= (byte)0x20;
941 return (tag);
945 * Set the tag of the attribute. Commonly used to reset the
946 * tag value used for IMPLICIT encodings.
948 * @params tag the tag value
950 public void resetTag(byte tag) {
951 this.tag = tag;