Package org.apache.geronimo.util.asn1.x509

Examples of org.apache.geronimo.util.asn1.x509.GeneralName


        // 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 (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);
        final GeneralNames gns = new GeneralNames(new DERSequence(vec));
        final DistributionPointName dpn = new DistributionPointName(0, gns);
        dpns.add(dpn);
      }             
    }
    // CRL issuer works much like Dist point URI. If separated by ; it is put in the same global distPoint as the URI,
    // if there is more of one of them, the one with more is put in an own global distPoint.
    final ArrayList<GeneralNames> issuers = new ArrayList<GeneralNames>();
    if (StringUtils.isNotEmpty(crlissuer)) {
      final StringTokenizer tokenizer = new StringTokenizer(crlissuer, ";", false);
      while (tokenizer.hasMoreTokens()) {
        final String issuer = tokenizer.nextToken();
        final GeneralName gn = new GeneralName(new X509Name(issuer));
        if (log.isDebugEnabled()) {
          log.debug("Added CRL issuer: "+issuer);
        }
        final 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

  }

  @Override
  public DEREncodable getValue(final UserDataVO subject, final CA ca, final CertificateProfile certProfile, final PublicKey userPublicKey, final PublicKey caPublicKey ) throws CertificateExtentionConfigurationException, CertificateExtensionException {
    final ASN1EncodableVector accessList = new ASN1EncodableVector();
        GeneralName accessLocation;
        String url;

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

    {
        try
        {
            if (certificate.getVersion() != 3)
            {
                GeneralName          genName = new GeneralName(PrincipalUtil.getSubjectX509Principal(certificate));
                SubjectPublicKeyInfo info = new SubjectPublicKeyInfo(
                        (ASN1Sequence)new ASN1InputStream(certificate.getPublicKey().getEncoded()).readObject());
               
                return (ASN1Sequence)new AuthorityKeyIdentifier(
                               info, new GeneralNames(genName), certificate.getSerialNumber()).toASN1Object();
            }
            else
            {
                GeneralName             genName = new GeneralName(PrincipalUtil.getSubjectX509Principal(certificate));
               
                byte[]                  ext = certificate.getExtensionValue(X509Extensions.SubjectKeyIdentifier.getId());
               
                if (ext != null)
                {
View Full Code Here

    public void setRequestorName(
        X500Principal        requestorName)
    {
        try
        {
            this.requestorName = new GeneralName(GeneralName.directoryName, new X509Principal(requestorName.getEncoded()));
        }
        catch (IOException e)
        {
            throw new IllegalArgumentException("cannot encode principal: " + e);
        }
View Full Code Here

    }
   
    public AttributeCertificateIssuer(
        X509Principal principal)
    {       
        form = new V2Form(new GeneralNames(new DERSequence(new GeneralName(principal))));
    }
View Full Code Here

    {
        GeneralName[]   names = targets.getNames();

        for (int i = 0; i != names.length; i++)
        {
            GeneralName gn = names[i];

            if (gn.getTagNo() == 4)
            {
                try
                {
                    if (new X500Principal(((ASN1Encodable)gn.getName()).getEncoded()).equals(subject))
                    {
                        return true;
                    }
                }
                catch (IOException e)
View Full Code Here

        // signature Algorithmus
        acGen.setSignatureAlgorithm("SHA1WithRSAEncryption");

        // the actual attributes
        GeneralName roleName = new GeneralName(GeneralName.rfc822Name, "DAU123456789");
        ASN1EncodableVector roleSyntax = new ASN1EncodableVector();
        roleSyntax.add(roleName);

        // roleSyntax OID: 2.5.24.72
        X509Attribute attributes = new X509Attribute("2.5.24.72",
View Full Code Here

        }
    }
   
    private GeneralNames generateGeneralNames(X509Principal principal)
    {
        return new GeneralNames(new DERSequence(new GeneralName(principal)));
    }
View Full Code Here

TOP

Related Classes of org.apache.geronimo.util.asn1.x509.GeneralName

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.