Package org.apache.geronimo.crypto.asn1

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


    }
  }

  protected void addV3CRLDistPoint(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
    if (Conditions.isNotEmpty(request.getCrlDistPoint())) {
      GeneralName gn = new GeneralName(6, new DERIA5String(request.getCrlDistPoint()));

      ASN1EncodableVector vec = new ASN1EncodableVector();
      vec.add(gn);

      GeneralNames generalNames = GeneralNames.getInstance(new DERSequence(vec));
      DistributionPointName distributionPointName = new DistributionPointName(0, generalNames);
      CRLDistPoint crlDistPoint = new CRLDistPoint(new DistributionPoint[] { new DistributionPoint(distributionPointName, null, null) });

      builder.addExtension(X509Extension.cRLDistributionPoints, false, crlDistPoint);
      builder.addExtension(MiscObjectIdentifiers.netscapeCApolicyURL, false, new DERIA5String(request.getCrlDistPoint()));
    }
  }
View Full Code Here


    }
  }

  protected void addV3OcspUrl(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
    if (Conditions.isNotEmpty(request.getOcspURL())) {
      GeneralName ocspLocation = new GeneralName(6, new DERIA5String(request.getOcspURL()));
      builder.addExtension(X509Extension.authorityInfoAccess, false, new AuthorityInformationAccess(X509ObjectIdentifiers.ocspAccessMethod, ocspLocation));
    }
  }
View Full Code Here

    }
  }

  protected void addV3PolicyUrl(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
    if (Conditions.isNotEmpty(request.getPolicyURL())) {
      builder.addExtension(MiscObjectIdentifiers.netscapeCApolicyURL, false, new DERIA5String(request.getPolicyURL()));
    }
  }
View Full Code Here

    }
  }

  protected void addV3Comment(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
    if (Conditions.isNotEmpty(request.getComment())) {
      builder.addExtension(MiscObjectIdentifiers.netscapeCertComment, false, new DERIA5String(request.getComment()));
    }
  }
View Full Code Here

    // Colocar aqui 1.3.6.1.5.5.7.48.1
    for (AccessDescription description : accessDescriptions) {
      if (description.getAccessMethod().getId().equals(OCSPObjectIdentifiers.pkix_ocsp)) {
        GeneralName generalName = description.getAccessLocation();
        DERTaggedObject taggedObject = (DERTaggedObject) generalName.toASN1Primitive();
        DERIA5String ia5String = DERIA5String.getInstance(taggedObject.getObject());
        String urlStr = ia5String.getString();
        URL url = new URL(urlStr);
        urls.add(url);
      }
    }
View Full Code Here

            {
                value = value.substring(1);
            }
            if (oid.equals(dc))
            {
                return new DERIA5String(value);
            }
            else if (oid.equals(c) || oid.equals(serialNumber) || oid.equals(dnQualifier)
                || oid.equals(telephoneNumber))
            {
                return new DERPrintableString(value);
View Full Code Here

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

                    unused += x;
                }
                value = new DERBitString(new byte[] { v }, unused);
            } else if(r_oid.equals(new DERObjectIdentifier("2.5.29.17"))) { //subjectAltName
                if(valuex.startsWith("DNS:")) {
                    value = new String(ByteList.plain(new GeneralNames(new GeneralName(GeneralName.dNSName,new DERIA5String(valuex.substring(4)))).getDEREncoded()));
                } else if(valuex.startsWith("IP:")) {
                    String[] numbers = valuex.substring(3).split("\\.");
                    byte[] bs = new byte[4];
                    bs[0] = (byte) (Integer.parseInt(numbers[0]) & 0xff);
                    bs[1] = (byte) (Integer.parseInt(numbers[1]) & 0xff);
View Full Code Here

    private byte[] internalToDer() throws IOException {
        DERSequence b = (DERSequence)cert.toASN1Object();
        DERObjectIdentifier encType = null;
        DERBitString publicKey = new DERBitString(((PKey)public_key).to_der().convertToString().getBytes());
        DERIA5String encodedChallenge = new DERIA5String(this.challenge.toString());
        DERObjectIdentifier sigAlg = null;
        DERBitString sig = null;
        encType = (DERObjectIdentifier)((DERSequence)((DERSequence)((DERSequence)b.getObjectAt(0)).getObjectAt(0)).getObjectAt(0)).getObjectAt(0);
        sigAlg = ((AlgorithmIdentifier)b.getObjectAt(1)).getObjectId();
        sig = (DERBitString)b.getObjectAt(2);
View Full Code Here

            certificateGenerator.addExtension(Extension.basicConstraints, false, bc);
        }

        if (null != crlUri) {
            int uri = GeneralName.uniformResourceIdentifier;
            DERIA5String crlUriDer = new DERIA5String(crlUri);
            GeneralName gn = new GeneralName(uri, crlUriDer);

            DERSequence gnDer = new DERSequence(gn);
            GeneralNames gns = GeneralNames.getInstance(gnDer);
           
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.