Examples of ASN1SequenceOf


Examples of codec.asn1.ASN1SequenceOf

  nextUpdate.addType(new ASN1UTCTime());
  nextUpdate.addType(new ASN1GeneralizedTime());

  TBSCertList.add(nextUpdate);

  revokedCertificates = new ASN1SequenceOf(CRLEntry.class);
  revokedCertificates.setOptional(true);
  TBSCertList.add(revokedCertificates);

  crlExtensions = new ASN1SequenceOf(X509Extension.class);
  // ASN1TaggedType crl_ext = new ASN1TaggedType(0, crlExtensions, true,
  // true);
  // TBSCertList.add(crl_ext);
  crlExtensionsTag = new ASN1TaggedType(0, crlExtensions, true, true);
  TBSCertList.add(crlExtensionsTag);
View Full Code Here

Examples of codec.asn1.ASN1SequenceOf

   * nextUpdate.addType(new ASN1UTCTime()); nextUpdate.addType(new
   * ASN1GeneralizedTime());
   *
   * TBSCertList.add(nextUpdate);
   */
  revokedCertificates = new ASN1SequenceOf(CRLEntry.class);
  revokedCertificates.setOptional(true);
  TBSCertList.add(revokedCertificates);

  crlExtensions = new ASN1SequenceOf(X509Extension.class);
  // ASN1TaggedType crl_ext = new ASN1TaggedType(0, crlExtensions, true,
  // true);
  // TBSCertList.add(crl_ext);
  crlExtensionsTag = new ASN1TaggedType(0, crlExtensions, true, true);
  TBSCertList.add(crlExtensionsTag);
View Full Code Here

Examples of codec.asn1.ASN1SequenceOf

   * we do not bother about any contents. The opaque object just reads
   * whatever is there (if there is something) without actually decoding
   * the PolicyQualifierInfo. Furthermore, it is OPTIONAL. Hence, we
   * generally omit it.
   */
  policyQualifiers_ = new ASN1SequenceOf(ASN1Opaque.class);
  policyQualifiers_.setOptional(true);

  add(policyIdentifier_);
  add(policyQualifiers_);
    }
View Full Code Here

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

        }
    }

    public void testVerify() throws IOException {

        ASN1SequenceOf seqVerify = new ASN1SequenceOf(ASN1Boolean.getInstance()) {

            public Object getDecodedObject(BerInputStream in)
                    throws IOException {
                throw new IOException(
                        "Method getDecodedObject MUST not be invoked");
            }
        };

        for (int i = 0; i < testcases.length; i++) {
            DerInputStream in = new DerInputStream((byte[]) testcases[i][1]);
            in.setVerify();
            seqVerify.decode(in);
        }
    }
View Full Code Here

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

            public Object getObjectToEncode(Object object) {
                return object;
            }
        };

        ASN1SequenceOf sequenceOf = new ASN1SequenceOf(choice);

        ArrayList list = new ArrayList();
        list.add(Boolean.FALSE);
        list.add(new byte[] { 0x09 });

        byte[] encoded = new byte[] {
        // Sequence Of
                0x30, 0x06,
                // Boolean
                0x01, 0x01, 0x00,
                // Integer
                0x02, 0x01, 0x09 };

        assertTrue("Encoded: ", Arrays.equals(encoded, sequenceOf.encode(list)));

        List values = (List) sequenceOf.decode(encoded);

        assertEquals("Size: ", 2, values.size());
        assertEquals("First: ", Boolean.FALSE, values.get(0));
        assertTrue("Second: ", Arrays.equals(new byte[] { 0x09 },
                (byte[]) values.get(1)));
View Full Code Here

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

            public Object getObjectToEncode(Object object) {
                return object;
            }
        };

        ASN1SequenceOf sequenceOf = new ASN1SequenceOf(choice);

        ArrayList list = new ArrayList();
        list.add(Boolean.FALSE);
        list.add(new byte[] { 0x09 });

        byte[] encoded = new byte[] {
        // Sequence Of
                0x30, 0x06,
                // Boolean
                0x01, 0x01, 0x00,
                // Integer
                0x02, 0x01, 0x09 };

        assertTrue("Encoded: ", Arrays.equals(encoded, sequenceOf.encode(list)));

        List values = (List) sequenceOf.decode(encoded);

        assertEquals("Size: ", 2, values.size());
        assertEquals("First: ", Boolean.FALSE, values.get(0));
        assertTrue("Second: ", Arrays.equals(new byte[] { 0x09 },
                (byte[]) values.get(1)));
View Full Code Here

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

        }
    }

    public void testVerify() throws IOException {

        ASN1SequenceOf seqVerify = new ASN1SequenceOf(ASN1Boolean.getInstance()) {

            public Object getDecodedObject(BerInputStream in)
                    throws IOException {
                throw new IOException(
                        "Method getDecodedObject MUST not be invoked");
            }
        };

        for (int i = 0; i < testcases.length; i++) {
            DerInputStream in = new DerInputStream((byte[]) testcases[i][1]);
            in.setVerify();
            seqVerify.decode(in);
        }
    }
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.