Package org.bouncycastle.asn1

Examples of org.bouncycastle.asn1.DERIA5String


        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

    for (int i = 0; i < gns.length; i++) {
      int tag = gns[i].getTagNo();
      if (tag == 2) {
        dnscount++;
        DEREncodable enc = gns[i].getName();
        DERIA5String dir = (DERIA5String) enc;
        String str = dir.getString();
        log.info("DnsName: " + str);
      }
      if (tag == 1) {
        rfc822count++;
        DEREncodable enc = gns[i].getName();
        DERIA5String dir = (DERIA5String) enc;
        String str = dir.getString();
        log.info("Rfc822Name: " + str);
      }

    }
    assertEquals(2, dnscount);
View Full Code Here

    return new DERUTF8String(value);
  }
 
  private DEREncodable parseDERIA5String(String valuethrows CertificateExtentionConfigurationException {   
    try{
      return new DERIA5String(value, true);
    }catch(java.lang.IllegalArgumentException e){
      throw new CertificateExtentionConfigurationException(intres.getLocalizedMessage("certext.basic.illegalvalue",value,Integer.valueOf(getId())));
    }
  }
View Full Code Here

    if (StringUtils.isNotEmpty(crldistpoint)) {
      final Iterator<String> it = StringTools.splitURIs(crldistpoint).iterator();
      while (it.hasNext()) {
        // 6 is URI
        final String uri = (String) it.next();
        final GeneralName gn = new GeneralName(GeneralName.uniformResourceIdentifier, new DERIA5String(uri));
        if (log.isDebugEnabled()) {
          log.debug("Added CRL distpoint: "+uri);
        }
        final ASN1EncodableVector vec = new ASN1EncodableVector();
        vec.add(gn);
View Full Code Here

        // Multiple CDPs are separated with the ';' sign
      Iterator<String> it = StringTools.splitURIs(distPoints).iterator();
      ArrayList<DistributionPoint> result = new ArrayList<DistributionPoint>();
        while (it.hasNext()) {
            String uri = (String) it.next();
            GeneralName gn = new GeneralName(GeneralName.uniformResourceIdentifier, new DERIA5String(uri));
            if(log.isDebugEnabled()) {
                log.debug("Added CRL distpoint: " + uri);
            }
            ASN1EncodableVector vec = new ASN1EncodableVector();
            vec.add(gn);
View Full Code Here

        if (freshestcrldistpoint != null) {
          final StringTokenizer tokenizer = new StringTokenizer(freshestcrldistpoint, ";", false);
          final ArrayList<DistributionPoint> distpoints = new ArrayList<DistributionPoint>();
            while (tokenizer.hasMoreTokens()) {
              final String uri = tokenizer.nextToken();
                final GeneralName gn = new GeneralName(GeneralName.uniformResourceIdentifier, new DERIA5String(uri));
                if (log.isDebugEnabled()) {
                  log.debug("Added freshest CRL distpoint: "+uri);
                }
                final ASN1EncodableVector vec = new ASN1EncodableVector();
                vec.add(gn);
View Full Code Here

        final List<String> caIssuers = certProfile.getCaIssuers();
        if (caIssuers != null) {
          for(final Iterator<String> it = caIssuers.iterator(); it.hasNext(); ) {
            url = it.next();
            if(StringUtils.isNotEmpty(url)) {
              accessLocation = new GeneralName(GeneralName.uniformResourceIdentifier, new DERIA5String(url));
              accessList.add(new AccessDescription(AccessDescription.id_ad_caIssuers,
                  accessLocation));
            }
          }             
        }

        // ocsp url
        final X509CA x509ca = (X509CA)ca;
        url = certProfile.getOCSPServiceLocatorURI();
        if(certProfile.getUseDefaultOCSPServiceLocator()){
          url = x509ca.getDefaultOCSPServiceLocator();
        }
        if (StringUtils.isNotEmpty(url)) {
          accessLocation = new GeneralName(GeneralName.uniformResourceIdentifier, new DERIA5String(url));
          accessList.add(new AccessDescription(AccessDescription.id_ad_ocsp,
              accessLocation));
        }
        org.bouncycastle.asn1.x509.AuthorityInformationAccess ret = null;
        if (accessList.size() > 0) {         
View Full Code Here

  }
 
  @Override
  public DEREncodable getValue(final UserDataVO subject, final CA ca, final CertificateProfile certProfile, final PublicKey userPublicKey, final PublicKey caPublicKey ) throws CertificateExtentionConfigurationException, CertificateExtensionException {
    final String mstemplate = certProfile.getMicrosoftTemplate();            
        return new DERIA5String(mstemplate);            
 
View Full Code Here

TOP

Related Classes of org.bouncycastle.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.