Package org.bouncycastle.asn1

Examples of org.bouncycastle.asn1.DERIA5String


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


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

      vector = new ASN1EncodableVector();
      for (Entry<String, String> entry : request.getCertificatePolicies().entrySet()) {
        String oid = entry.getKey();
        String value = entry.getValue();
        ASN1ObjectIdentifier policyIdentifier = new ASN1ObjectIdentifier(oid);
        PolicyQualifierInfo policyQualifierInfo = new PolicyQualifierInfo(policyIdentifier, new DERIA5String(value));
        DERSequence policyQualifiers = new DERSequence(new ASN1Encodable[] { policyQualifierInfo });
        PolicyInformation policyInformation = new PolicyInformation(policyIdentifier, policyQualifiers);
        vector.add(policyInformation);
      }
View Full Code Here

    }
  }

  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

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.