Package codec.asn1

Examples of codec.asn1.ASN1Null


     */
    private static String lookupClassname(
        String moduleOID,
        String typereference)
    {
        ASN1ObjectIdentifier aSN1ObjectIdentifier =
            new ASN1ObjectIdentifier(moduleOID.trim());
        Hashtable moduleDefinition                =
            (Hashtable)modules.get(aSN1ObjectIdentifier);

        if (moduleDefinition == null)
        {
View Full Code Here


     * Loads all property files of the form 'oid*.map' from the given path.
     * @param path relative to classpath e.g. 'codec/asn1'
     */
    public static void loadOIDMap(String path)
    {
        ASN1ObjectIdentifier oid;
        InputStream in;
        Properties props;
        Map.Entry entry;
        Iterator i;
        String key;
        int n;

        if (path == null)
        {
            throw new NullPointerException("path");
        }

        n      = 0;
        in     = ClassLoader.getSystemResourceAsStream(path + "/oid0.map");

        // trying different loaders and paths
        if (in == null)
        {
            in = Repository.class.getResourceAsStream(path + "/oid0.map");

            if (in == null)
            {
                in = Repository.class.getResourceAsStream(
                        "/" + path + "/oid0.map");

                if (in == null)
                {
                    log.error("Warning: could not get resource at " + path);
                }
            }
        }

        while (in != null)
        {
            try
            {
                props = new Properties();
                props.load(in);

                for (i = props.entrySet().iterator(); i.hasNext();)
                {
                    entry     = (Map.Entry)i.next();
                    key       = (String)entry.getKey();

                    String classname = (String)entry.getValue();
                    String typereference = null;

                    int indexOfSemicolon = key.indexOf(';');
                    if (indexOfSemicolon != -1)
                    {
                        typereference     = key.substring(
                                indexOfSemicolon + 1);
                        key               = key.substring(
                                0,
                                indexOfSemicolon);
                    }
                    oid = new ASN1ObjectIdentifier(key.trim());

                    // oid to class mapping
                    map.put(oid, classname);
                    log.debug("map '" + key + "' -> '" + classname + "'");
                    if (typereference != null)
                    {
                        // module + typereference to class mapping
                        key     = key.substring(0, key.lastIndexOf('.'));
                        oid     = new ASN1ObjectIdentifier(key.trim());

                        Hashtable module = null;

                        if (modules.containsKey(oid))
                        {
View Full Code Here

    /**
     *
     */
    public SecretBag() {
  super(2);
  ASN1ObjectIdentifier secretTypeId = new ASN1ObjectIdentifier();
  ASN1OpenType ot = new ASN1OpenType(reg_, secretTypeId);
  secretValue_ = new ASN1TaggedType(0, ot, true);
    }
View Full Code Here

     * Returns the OID for this structure.
     *
     * @return the OID
     */
    public ASN1ObjectIdentifier getOID() {
  return new ASN1ObjectIdentifier(OID_);
    }
View Full Code Here

    /**
     * The default constructor.
     */
    public CertBag() {
  super(2);
  certId_ = new ASN1ObjectIdentifier();
  add(certId_);
  ASN1OpenType ot = new ASN1OpenType(reg_, certId_);
  certValue_ = new ASN1TaggedType(0, ot, true);
  add(certValue_);
    }
View Full Code Here

     *                the certicifate
     */
    public CertBag(java.security.cert.X509Certificate cert)
      throws java.security.cert.CertificateEncodingException {
  super(2);
  certId_ = new ASN1ObjectIdentifier("1.2.840.113549.1.9.22.1");
  add(certId_);
  x509Cert_ = new ASN1OctetString(cert.getEncoded());
  certValue_ = new ASN1TaggedType(0, x509Cert_, true);
  add(certValue_);
    }
View Full Code Here

    /**
     * @return the OID for this bag type.
     */
    public ASN1ObjectIdentifier getOID() {
  return new ASN1ObjectIdentifier(OID_);
    }
View Full Code Here

     * Default constructor.
     */
    public SafeBag() {
  super(3);

  bagId_ = new ASN1ObjectIdentifier();
  add(bagId_);

  ASN1OpenType ot = new ASN1OpenType(reg_, bagId_);
  bagValue_ = new ASN1TaggedType(0, ot, true);
  add(bagValue_);
View Full Code Here

    public DateOfCreationExtension(Date cDate, boolean crit) throws Exception {
  if (cDate == null) {
      throw (new Exception("Date was null, set Date to a proper value!"));
  }

  this.setOID(new ASN1ObjectIdentifier(EXTENSION_OID));
  creationDate = new ASN1GeneralizedTime(cDate);
  this.criticality = crit;
  this.setCritical(this.criticality);
  this.setValue(creationDate);
    }
View Full Code Here

    public EncryptedPrivateKeyInfo() {
  super(2);

  algorithm_ = new AlgorithmIdentifier();
  add(algorithm_);
  encryptedData_ = new ASN1OctetString();
  add(encryptedData_);
    }
View Full Code Here

TOP

Related Classes of codec.asn1.ASN1Null

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.