void encode(ASN1OutputStream out) throws IOException {
    if (!empty) {
      ASN1Primitive primitive = obj.toASN1Primitive().toDERObject();

      if (explicit) {
        out.writeTag(BERTags.CONSTRUCTED | BERTags.TAGGED, tagNo);
        out.writeLength(primitive.encodedLength());
        out.writeObject(primitive);
      } else {
        //
        // need to mark constructed types...
        //
        int flags;
        if (primitive.isConstructed()) {
          flags = BERTags.CONSTRUCTED | BERTags.TAGGED;
        } else {
          flags = BERTags.TAGGED;
        }

        out.writeTag(flags, tagNo);
        out.writeImplicitObject(primitive);
      }
    } else {
      out.writeEncoded(BERTags.CONSTRUCTED | BERTags.TAGGED, tagNo, ZERO_BYTES);
    }
  }
 void encode(ASN1OutputStream out) throws IOException {
   if (encoded != null) {
     out.writeEncoded(BERTags.SEQUENCE | BERTags.CONSTRUCTED, encoded);
   } else {
     super.toDLObject().encode(out);
   }
 }
 void encode(ASN1OutputStream out) throws IOException {
   out.writeEncoded(BERTags.GENERAL_STRING, string);
 }
 void encode(ASN1OutputStream out) throws IOException {
   out.writeEncoded(BERTags.UNIVERSAL_STRING, this.getOctets());
 }
Example #5
0
 void encode(ASN1OutputStream out) throws IOException {
   out.writeEncoded(BERTags.BOOLEAN, value);
 }