Package codec.asn1

Examples of codec.asn1.ASN1Exception


  Attribute attrUserKeyId = null;

  // Add friendlyName (if present)
  if ((user_fn != null) && !user_fn.equals("")) {
      ASN1ObjectIdentifier fnOID = new ASN1ObjectIdentifier(FN_OID_);
      attrUserFn = new Attribute(fnOID, new ASN1BMPString(user_fn));
  }

  // add localKeyId (if present)
  if ((lk_id != null) && (lk_id.length > 0)) {
      ASN1ObjectIdentifier lkOID = new ASN1ObjectIdentifier(LK_OID_);
View Full Code Here


    list.add(o);
      }
      values_.clear();
      values_.addAll(list);
  } catch (ClassCastException e) {
      throw new ASN1Exception("Unexpected type in SET OF!");
  } catch (NullPointerException e) {
      throw new ASN1Exception("NULL in SET OF!");
  }
    }
View Full Code Here

      ByteArrayInputStream bais = new ByteArrayInputStream(enc);

      decode(new DERDecoder(bais));
      bais.close();
  } catch (IOException e) {
      throw new ASN1Exception(e.getMessage());
  }
    }
View Full Code Here

      encode(new DEREncoder(baos));
      res = baos.toByteArray();
      baos.close();
  } catch (IOException e) {
      throw new ASN1Exception(e.getMessage());
  }
  return res;

    }
View Full Code Here

  setValue(idp);
    }

    public void setSomeReasons(boolean flags[]) throws Exception {
  if (flags.length > 7) {
      throw new ASN1Exception("Wrong number of flags!");
  }
  someReasons_.setBits(flags);
  someReasonsTag_.setOptional(false);
  setValue(idp);
    }
View Full Code Here

  super.decode(dec);

  ASN1Type inner = (ASN1Type) super.getValue();

  if (!(inner instanceof ASN1OctetString)) {
      throw new ASN1Exception("Inner value of wrong type: "
        + inner.getClass().getName());
  }
  keyIdentifier = (ASN1OctetString) inner;
    }
View Full Code Here

    factory_ = CertificateFactory.getInstance("X.509");
      } catch (CertificateException e1) {
    try {
        factory_ = CertificateFactory.getInstance("X509");
    } catch (CertificateException e2) {
        throw new ASN1Exception(e2.getMessage());
    }
      }
  }
  cache_ = null;

  try {
      for (i = size() - 1; i >= 0; i--) {
    o = (ASN1Opaque) get(i);
    cert = (X509Certificate) factory_
      .generateCertificate(new ByteArrayInputStream(o
        .getEncoded()));

    set(i, cert);
      }
  } catch (CertificateException e) {
      throw new ASN1Exception(e.getMessage());
  }
    }
View Full Code Here

      for (i = listIterator(cache_.size()); i.hasNext();) {
    try {
        cert = (X509Certificate) i.next();
        cache_.add(new ASN1Opaque(cert.getEncoded()));
    } catch (CertificateEncodingException e) {
        throw new ASN1Exception(e.getMessage());
    }
      }
  }
  cache_.encode(enc);
    }
View Full Code Here

  super.decode(dec);

  ASN1Type inner = (ASN1Type) super.getValue();

  if (!(inner instanceof ASN1Enumerated)) {
      throw new ASN1Exception("unexpected extension value "
        + inner.toString());
  }
  theReason = (ASN1Enumerated) inner;
    }
View Full Code Here

  super.decode(dec);

  ASN1Type inner = (ASN1Type) super.getValue();

  if (!(inner instanceof ASN1SequenceOf)) {
      throw new ASN1Exception("unexpected type of inner value "
        + inner.getClass().getName());
  }

  if (!(((ASN1SequenceOf) inner).getElementType()
    .equals(ASN1Sequence.class))) {
      throw new ASN1Exception("unexpected content of inner type "
        + ((ASN1SequenceOf) inner).getElementType().toString());
  }

  certificatePoliciesSyntax = (ASN1SequenceOf) inner;
View Full Code Here

TOP

Related Classes of codec.asn1.ASN1Exception

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.