Package org.apache.geronimo.util.asn1

Examples of org.apache.geronimo.util.asn1.DERIA5String


            {
                value = value.substring(1);
            }
            if (oid.equals(X509Name.EmailAddress) || oid.equals(X509Name.DC))
            {
                return new DERIA5String(value);
            }
            else if (oid.equals(X509Name.DATE_OF_BIRTH))  // accept time string as well as # (for compatibility)
            {
                return new DERGeneralizedTime(value);
            }
View Full Code Here


    */
   public PolicyQualifierInfo(
       String cps)
   {
      policyQualifierId = PolicyQualifierId.id_qt_cps;
      qualifier = new DERIA5String (cps);
   }
View Full Code Here

    
      contentType = type;
      switch (type)
      {
         case CONTENT_TYPE_IA5STRING:
            contents = (DERString)new DERIA5String (text);
            break;
         case CONTENT_TYPE_UTF8STRING:
            contents = (DERString)new DERUTF8String(text);
            break;
         case CONTENT_TYPE_VISIBLESTRING:
View Full Code Here

    {
        this.tag = tag;

        if (tag == rfc822Name || tag == dNSName || tag == uniformResourceIdentifier)
        {
            this.obj = new DERIA5String(name);
        }
        else if (tag == registeredID)
        {
            this.obj = new DERObjectIdentifier(name);
        }
View Full Code Here

          GeneralName[] names = generalNames.getNames();
          for (GeneralName name : names) {
              if (name.getTagNo() != GeneralName.uniformResourceIdentifier) {
                  continue;
              }
              DERIA5String derStr = DERIA5String.getInstance((ASN1TaggedObject)name.toASN1Primitive(), false);
              return derStr.getString();
          }
      }
      return null;
  }
View Full Code Here

        return fnr;
    }

    public DERObject toASN1Object()
    {
        return new DERIA5String(fnr);
    }
View Full Code Here

                throw new RuntimeException("can't recode value for oid " + oid.getId());
            }
        }
        else if (oid.equals(X509Name.EmailAddress) || oid.equals(X509Name.DC))
        {
            return new DERIA5String(value);
        }
        else if (canBePrintable(value)) 
        {
            return new DERPrintableString(value);
        }
View Full Code Here

        ArrayList<String> emails = CertTools.getEmailFromDN(altName);
        if (!emails.isEmpty()) {
            Iterator<String> iter = emails.iterator();
            while (iter.hasNext()) {
              GeneralName gn = new GeneralName(1, new DERIA5String((String)iter.next()));
              vec.add(gn);
            }
        }
       
        ArrayList<String> dns = CertTools.getPartsFromDN(altName, CertTools.DNS);
        if (!dns.isEmpty()) {           
            Iterator<String> iter = dns.iterator();
            while (iter.hasNext()) {
                GeneralName gn = new GeneralName(2, new DERIA5String((String)iter.next()));
                vec.add(gn);
            }
        }
       
        String directoryName = getDirectoryStringFromAltName(altName);
        if (directoryName != null) {
          X509Name x509DirectoryName = new X509Name(directoryName);
          GeneralName gn = new GeneralName(4, x509DirectoryName);
          vec.add(gn);
        }
                               
        ArrayList<String> uri = CertTools.getPartsFromDN(altName, CertTools.URI);
        if (!uri.isEmpty()) {           
            Iterator<String> iter = uri.iterator();
            while (iter.hasNext()) {
                GeneralName gn = new GeneralName(6, new DERIA5String((String)iter.next()));
                vec.add(gn);
            }
        }
        uri = CertTools.getPartsFromDN(altName, CertTools.URI1);
        if (!uri.isEmpty()) {           
            Iterator<String> iter = uri.iterator();
            while (iter.hasNext()) {
                GeneralName gn = new GeneralName(6, new DERIA5String((String)iter.next()));
                vec.add(gn);
            }
        }
        uri = CertTools.getPartsFromDN(altName, CertTools.URI2);
        if (!uri.isEmpty()) {           
            Iterator<String> iter = uri.iterator();
            while (iter.hasNext()) {
                GeneralName gn = new GeneralName(6, new DERIA5String((String)iter.next()));
                vec.add(gn);
            }
        }
       
               
View Full Code Here

          if ( (ad != null) && (ad.length > 0) ) {
            for (int i = 0; i < ad.length; i++) {
              if (ad[i].getAccessMethod().equals(X509ObjectIdentifiers.ocspAccessMethod)) {
                GeneralName gn = ad[i].getAccessLocation();
                if (gn.getTagNo() == 6) {
                  DERIA5String str = DERIA5String.getInstance(gn.getDERObject());
                  ret = str.getString();
                  break; // no need to go on any further, we got a value
                }
              }                 
            }
          }
View Full Code Here

        // OcspNoCheck
        extgen.addExtension(OCSPObjectIdentifiers.id_pkix_ocsp_nocheck, false, new DERNull());
        // Netscape cert type
        extgen.addExtension(new DERObjectIdentifier("2.16.840.1.113730.1.1"), false, new NetscapeCertType(NetscapeCertType.objectSigningCA));
        // My completely own
        extgen.addExtension(new DERObjectIdentifier("1.1.1.1.1"), false, new DERIA5String("PrimeKey"));

        // Make the complete extension package
        X509Extensions exts = extgen.generate();

        // First test without extension override
View Full Code Here

TOP

Related Classes of org.apache.geronimo.util.asn1.DERIA5String

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.