Package codec.asn1

Examples of codec.asn1.ASN1IA5String


     */
    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

    public EncryptedPrivateKeyInfo() {
  super(2);

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

  clear();

  algorithm_ = new AlgorithmIdentifier(algorithm, params);
  add(algorithm_);
  encryptedData_ = new ASN1OctetString(code);
  add(encryptedData_);
    }
View Full Code Here

  }

  // add localKeyId (if present)
  if ((lk_id != null) && (lk_id.length > 0)) {
      ASN1ObjectIdentifier lkOID = new ASN1ObjectIdentifier(LK_OID_);
      attrUserKeyId = new Attribute(lkOID, new ASN1OctetString(lk_id));
  }

  // both present -> add both
  if ((user_fn != null) && (lk_id != null)) {
      Attribute[] attr = new Attribute[2];
View Full Code Here

TOP

Related Classes of codec.asn1.ASN1IA5String

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.