Package codec.asn1

Examples of codec.asn1.ASN1ObjectIdentifier


     * This method initializes the hashmaps, which are needed to create the
     * ASN1Structure Tree.
     */
    protected void initMaps() {
  int i;
  ASN1ObjectIdentifier oid;

  if (a2oid_ == null) {
      a2oid_ = new HashMap();
      oid2a_ = new HashMap();

      for (i = 0; i < keys_.length; i++) {
    oid = new ASN1ObjectIdentifier(oids_[i]);

    a2oid_.put(keys_[i], oid);
    oid2a_.put(oid, keys_[i]);
      }
  }
View Full Code Here


     */
    public AccessDescription() {
  accessLocation = new GeneralName();
  accessLocation.setUniformResourceIdentifier(new ASN1IA5String(
    "http://ocsptest:8080/ocsp"));
  accessMethod = new ASN1ObjectIdentifier("1.3.6.1.5.5.7.48.1");

  add(accessMethod);
  add(accessLocation);
    }
View Full Code Here

     * This method returns the <code>Name</code> as a list of <code>AVA</code>
     * instances. The order is the same as the order in which the
     * <code>AVA</code> instances appear in the code.
     */
    public List getAVAList() {
  ASN1ObjectIdentifier oid;
  ASN1Sequence ava;
  ArrayList list;
  ASN1Type obj;
  Iterator i;
  boolean sibling;
  ASN1Set rdn;
  String val;
  String key;
  AVA entry;
  int j;
  int n;

  list = new ArrayList(size());

  for (i = iterator(); i.hasNext();) {
      rdn = (ASN1Set) i.next();
      n = rdn.size();

      for (j = 0; j < n; j++) {
    /*
     * We have to mark siblings. An AVA has a sibling if it is not
     * the last AVA in the set.
     */
    sibling = (j < n - 1);

    /*
     * Convert key and value into strings. These values are then put
     * into an AVA instance.
     */
    ava = (ASN1Sequence) rdn.get(j);
    oid = (ASN1ObjectIdentifier) ava.get(0);
    obj = (ASN1Type) ava.get(1);
    key = (String) oid2a_.get(oid);

    if (key == null) {
        key = oid.toString();
    }
    if (obj instanceof ASN1String) {
        val = ((ASN1String) obj).getString();
        entry = new AVA(key, val, sibling);
    } else {
View Full Code Here

     * This method returns the <code>Name</code> as a list of <code>AVA</code>
     * instances. The order is the opposite as the order in which the
     * <code>AVA</code> instances appear in the code.
     */
    public List getReverseAVAList() {
  ASN1ObjectIdentifier oid;
  ASN1Sequence ava;
  ArrayList list;
  ASN1Type obj;
  boolean sibling;
  ASN1Set rdn;
  String val;
  String key;
  AVA entry;
  int i;
  int j;
  int n;

  list = new ArrayList(size());

  for (i = size() - 1; i >= 0; i--) {
      rdn = (ASN1Set) get(i);
      n = rdn.size();

      for (j = 0; j < n; j++) {
    /*
     * We have to mark siblings. An AVA has a sibling if it is not
     * the last AVA in the set.
     */
    sibling = (j < n - 1);

    /*
     * Convert key and value into strings. These values are then put
     * into an AVA instance.
     */
    ava = (ASN1Sequence) rdn.get(j);
    oid = (ASN1ObjectIdentifier) ava.get(0);
    obj = (ASN1Type) ava.get(1);
    key = (String) oid2a_.get(oid);

    if (key == null) {
        key = oid.toString();
    }
    if (obj instanceof ASN1String) {
        val = ((ASN1String) obj).getString();
        entry = new AVA(key, val, sibling);
    } else {
View Full Code Here

  }
  ASN1Sequence seq;

  seq = new ASN1Sequence(2);

  seq.add(new ASN1ObjectIdentifier());
  seq.add(new ASN1OpenType());
  tmp_.add(seq);

  return seq;
    }
View Full Code Here

  admissionSyntax = new ASN1Sequence();
  admissionAuthority = adAuth;
  setCritical(false);
  try {
      setOID(new ASN1ObjectIdentifier(EXTENSION_OID));
      admissionSyntax.add(admissionAuthority);
      setValue(admissionSyntax);
  } catch (ConstraintException ce) {
      ce.printStackTrace();
  } catch (CertificateEncodingException cee) {
View Full Code Here

  admissions = ad;
  admissionSyntax.add(admissions);

  try {
      setOID(new ASN1ObjectIdentifier(EXTENSION_OID));
      setValue(admissionSyntax);
  } catch (ConstraintException ce) {
      ce.printStackTrace();
  } catch (CertificateEncodingException cee) {
      cee.printStackTrace();
View Full Code Here

     * structure.
     */
    public AlgorithmIdentifier() {
  super(2);

  algorithm_ = new ASN1ObjectIdentifier();
  parameters_ = new ASN1Opaque();
  parameters_.setOptional(true);
  add(algorithm_);
  add(parameters_);
    }
View Full Code Here

  if (oid == null)
      throw new NoSuchAlgorithmException("No OID alias for algorithm "
        + algorithm);

  try {
      algorithm_ = new ASN1ObjectIdentifier(oid);
  } catch (IllegalArgumentException e) {
      throw new NoSuchAlgorithmException("Bad OID alias for algorithm "
        + algorithm);
  }
  parameters_ = new ASN1Opaque(ASN1.TAG_NULL, ASN1.CLASS_UNIVERSAL,
View Full Code Here

  if (s == null) {
      s = "1.3.14.3.2.7"; // DES_CBC
  }

  try {
      algorithm_ = new ASN1ObjectIdentifier(s);
  } catch (IllegalArgumentException e) {
      throw new InvalidAlgorithmParameterException(
        "Bad OID alias for algorithm " + params.getAlgorithm());
  }
View Full Code Here

TOP

Related Classes of codec.asn1.ASN1ObjectIdentifier

Copyright © 2018 www.massapicom. 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.