Package org.apache.geronimo.crypto.asn1

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


    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

        pubkey = pub_key;

        ASN1EncodableVector content_der = new ASN1EncodableVector();
        content_der.add(getKeySpec());
        //content_der.add(new SubjectPublicKeyInfo(sigAlg, new RSAPublicKeyStructure(pubkey.getModulus(), pubkey.getPublicExponent()).getDERObject()));
        content_der.add(new DERIA5String(challenge));

        content = new DERBitString(new DERSequence(content_der));
    }
View Full Code Here

        DEROutputStream deros = new DEROutputStream(baos);

        ASN1EncodableVector pkac = new ASN1EncodableVector();

        pkac.add(getKeySpec());
        pkac.add(new DERIA5String(challenge));

        try
        {
            deros.writeObject(new DERSequence(pkac));
            deros.close();
View Full Code Here

        catch (Exception e)
        {
            //ignore
        }

        pkac.add(new DERIA5String(challenge));

        spkac.add(new DERSequence(pkac));
        spkac.add(sigAlg);
        spkac.add(new DERBitString(sigBits));
View Full Code Here

TOP

Related Classes of org.apache.geronimo.crypto.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.