Examples of ASN1Boolean


Examples of codec.asn1.ASN1Boolean

  idp.add(distributionPointTag_);

  /*
   * Next element with tag [1].
   */
  containsUserCerts_ = new ASN1Boolean(false);
  containsUserCertsTag_ = new ASN1TaggedType(TAG_CONTAINS_USER_CERTS,
    containsUserCerts_, false, true);
  idp.add(containsUserCertsTag_);

  /*
   * next element with tag [2].
   */
  containsCaCerts_ = new ASN1Boolean(false);
  containsCaCertsTag_ = new ASN1TaggedType(TAG_CONTAINS_CA_CERTS,
    containsCaCerts_, false, true);
  idp.add(containsCaCertsTag_);

  /*
   * next element with tag [3].
   */
  someReasons_ = new ASN1BitString();
  someReasonsTag_ = new ASN1TaggedType(TAG_SOME_REASONS, someReasons_,
    false, true);
  idp.add(someReasonsTag_);

  /*
   * Final element with tag [4].
   */
  indirectCrl_ = new ASN1Boolean(false);
  indirectCrlTag_ = new ASN1TaggedType(TAG_INDIRECT_CRL, indirectCrl_,
    false, true);
  idp.add(indirectCrlTag_);
  setValue(idp);
    }
View Full Code Here

Examples of codec.asn1.ASN1Boolean

   * --volker roth
   */
  extnID = new ASN1ObjectIdentifier();
  add(extnID);

  critical = new ASN1Boolean(false);
  critical.setOptional(true);

  add(critical);

  extnValue = new ASN1OctetString();
View Full Code Here

Examples of codec.asn1.ASN1Boolean

     */
    public ErrorParameterType1(boolean critical, String info)
    {
        super(2);

        critical_     = new ASN1Boolean(critical);
        info_         = new ASN1IA5String(info);

        add(critical_);
        add(info_);
    }
View Full Code Here

Examples of codec.asn1.ASN1Boolean

     */
    public ErrorParameterType1()
    {
        super(2);

        critical_     = new ASN1Boolean();
        info_         = new ASN1IA5String();

        add(critical_);
        add(info_);
    }
View Full Code Here

Examples of codec.asn1.ASN1Boolean

     */
    public ErrorParameterType1(boolean critical, String info)
    {
        super(2);

        critical_     = new ASN1Boolean(critical);
        info_         = new ASN1IA5String(info);

        add(critical_);
        add(info_);
    }
View Full Code Here

Examples of codec.asn1.ASN1Boolean

     */
    public ErrorParameterType1()
    {
        super(2);

        critical_     = new ASN1Boolean();
        info_         = new ASN1IA5String();

        add(critical_);
        add(info_);
    }
View Full Code Here

Examples of codec.asn1.ASN1Boolean

  byte[] ext_value;
  DERDecoder dec;
  ByteArrayInputStream bais;
  ASN1Sequence seq;
  ASN1Integer pathLen;
  ASN1Boolean ca;

  String bc_oid = "2.5.29.19";

  // get the extension "basic constraints"
  ext_value = getExtensionValue(bc_oid);

  // is it present?
  if (ext_value != null) {

      // read the extension value through a byte array input stream
      bais = new ByteArrayInputStream(ext_value);

      try {

    // build outer sequence
    seq = new ASN1Sequence();

    ca = new ASN1Boolean();
    ca.setOptional(true);
    seq.add(ca);

    pathLen = new ASN1Integer();
    pathLen.setOptional(true);
    seq.add(pathLen);

    /*
     * Switched decoding to the correct way of doing it, which is to
     * take the ASN.1 object and to call its decode() method, rather
     * than calling readX() methods of the decoder. --volker roth
     */
    dec = new DERDecoder(bais);
    seq.decode(dec);
    bais.close();

    if (ca.isTrue()) {
        /*
         * Replaced long->string->int parsing with a simpler method
         * with the same type of loss of precision. --volker roth
         */
        res = pathLen.getBigInteger().intValue();
View Full Code Here

Examples of codec.asn1.ASN1Boolean

  // set parameters
  setOID(new ASN1ObjectIdentifier(ID_CE_BASIC_CONSTRAINTS));
  setCritical(true); // this is alway the case

  // set payload
  cA = new ASN1Boolean(_cA);
  cA.setOptional(false); // I'm in doubt if that's neccessary

  if (_cA && _pathLenConstraints >= 0) {
      pathLenConstraints = new ASN1Integer(_pathLenConstraints);
      pathLenConstraints.setOptional(false); // mark that it's there
View Full Code Here

Examples of com.turkcelltech.jac.ASN1Boolean

      goose2.addElement(stNum);
      BerNode sqNum=new ASN1Integer(3309572);
      sqNum.setTagClass(Tag.CONTEXT);
      sqNum.setTagNumber(6);
      goose2.addElement(sqNum);
      BerNode test=new ASN1Boolean(false);
      test.setTagClass(Tag.CONTEXT);
      test.setTagNumber(7);
      goose2.addElement(test);
      BerNode confRev=new ASN1Integer(0);
      confRev.setTagClass(Tag.CONTEXT);
      confRev.setTagNumber(8);
      goose2.addElement(confRev);
      BerNode ndsCom=new ASN1Boolean(false);
      ndsCom.setTagClass(Tag.CONTEXT);
      ndsCom.setTagNumber(9);
      goose2.addElement(ndsCom);
      BerNode numDatSetEntries=new ASN1Integer(32);
      numDatSetEntries.setTagClass(Tag.CONTEXT);
      numDatSetEntries.setTagNumber(10);
      goose2.addElement(numDatSetEntries);
      Sequence datasetChoice2 = new Sequence();//new Choice();
      datasetChoice2.setTagClass(Tag.CONTEXT);
      datasetChoice2.setTagNumber(11);
      for (int i = 0; i < 16; i++) {
          BerNode tmp=new ASN1Boolean(false);
          tmp.setTagClass(Tag.CONTEXT);
          tmp.setTagNumber(3);
          datasetChoice2.addElement(tmp);
          tmp=new BitString(new BitSet(0));
          tmp.setTagClass(Tag.CONTEXT);
          tmp.setTagNumber(4);
          datasetChoice2.addElement(tmp);
      }
//      SequenceOf dataset2=new SequenceOf(datasetChoice2);
//      dataset2.setTagClass(Tag.CONTEXT);
//      dataset2.setTagNumber(11);
View Full Code Here

Examples of org.apache.harmony.security.asn1.ASN1Boolean

    private static byte[] eTrue = new byte[] { 0x01, 0x01, (byte) 0xFF };

    public void test_Decode_Encode() throws IOException {

        // oid decoder/encoder for testing
        ASN1Boolean asn1 = ASN1Boolean.getInstance();

        // decoding false
        DerInputStream in = new DerInputStream(eFalse);
        assertEquals("Decoding false value", Boolean.FALSE, asn1.decode(in));

        // decoding true
        in = new DerInputStream(eTrue);
        assertEquals("Decoding true value", Boolean.TRUE, asn1.decode(in));

        // encoding false
        DerOutputStream out = new DerOutputStream(asn1, Boolean.FALSE);
        assertTrue("Encoding false value", Arrays.equals(eFalse, out.encoded));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.