Package org.apache.geronimo.crypto.asn1.x509

Examples of org.apache.geronimo.crypto.asn1.x509.KeyPurposeId


     * @return newly issued certificate
     */
    public Certificate issueCertificate(X500Principal subject, PublicKey publicKey, BigInteger sNo, Date validFromDate, Date validToDate, String algorithm) throws CertificationAuthorityException{
        if(isLocked()) throw new CertificationAuthorityException("CA is locked.");
        try {
            X509Name subName = CaUtils.getX509Name(subject);
            Certificate cert = issueCertificate(subName, caName, sNo, publicKey, caPrivateKey, validFromDate, validToDate, algorithm);
            cert.verify(caPublicKey);
            certStore.storeCertificate(cert);
            return cert;
        } catch(Exception e) {
View Full Code Here


                String ou = csrProps.getProperty("OU");
                String o = csrProps.getProperty("O");
                String l = csrProps.getProperty("L");
                String st = csrProps.getProperty("ST");
                String c = csrProps.getProperty("C");
                X509Name subject = CaUtils.getX509Name(cn, ou, o, l, st, c);
                Map certReqMap = CaUtils.processSPKAC(spkac);
                // Set the subject and publickey values to be shown in subsequent screens
                response.setRenderParameter("subject", subject.toString());
                response.setRenderParameter("publickey", certReqMap.get(CaUtils.CERT_REQ_PUBLICKEY_OBJ).toString());
            }
            return CONFIRM_CERT_REQ_MODE+BEFORE_ACTION;
        } catch(Exception e) {
            portlet.addErrorMessage(request, portlet.getLocalizedString(request, "consolebase.errorMsg18", requestId), e.getMessage());
View Full Code Here

  protected void addV3ExtendedKeyUsage(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
    if (!request.getExtendedKeyUsage().isEmpty()) {
      List<KeyPurposeId> list = new ArrayList<KeyPurposeId>();
      for (ExtendedKeyUsageType keyUsageType : request.getExtendedKeyUsage()) {
        KeyPurposeId keyPurposeId = BouncyCastleCertificateHelper.toExtendedKeyUsage(keyUsageType);
        if (keyPurposeId != null) {
          list.add(keyPurposeId);
        }
      }
      if (list.size() > 0) {
View Full Code Here

        }

        if (this.extendedKeyUsage.size() > 0) {
          Vector<DERObject> vector = new Vector<DERObject>();
          for (ExtendedKeyUsageType keyUsageType : this.extendedKeyUsage) {
            KeyPurposeId keyPurposeId = this.toExtendedKeyUsage(keyUsageType);
            if (keyPurposeId != null) {
              vector.add(keyPurposeId);
            }
          }
          if (vector.size() > 0) {
View Full Code Here

  protected void addV3ExtendedKeyUsage(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
    if (!request.getExtendedKeyUsage().isEmpty()) {
      Vector<ASN1Primitive> vector = new Vector<ASN1Primitive>();
      for (ExtendedKeyUsageType keyUsageType : request.getExtendedKeyUsage()) {
        KeyPurposeId keyPurposeId = BouncyCastleCertificateHelper.toExtendedKeyUsage(keyUsageType);
        if (keyPurposeId != null) {
          vector.add(keyPurposeId);
        }
      }
      if (vector.size() > 0) {
View Full Code Here

        }

        if (this.extendedKeyUsage.size() > 0) {
          Vector<DERObject> vector = new Vector<DERObject>();
          for (ExtendedKeyUsageType keyUsageType : this.extendedKeyUsage) {
            KeyPurposeId keyPurposeId = this.toExtendedKeyUsage(keyUsageType);
            if (keyPurposeId != null) {
              vector.add(keyPurposeId);
            }
          }
          if (vector.size() > 0) {
View Full Code Here

  protected void addV3ExtendedKeyUsage(final JcaX509v3CertificateBuilder builder, BouncyCastleCertificateBuilderRequest request) {
    if (!request.getExtendedKeyUsage().isEmpty()) {
      Vector<DERObject> vector = new Vector<DERObject>();
      for (ExtendedKeyUsageType keyUsageType : request.getExtendedKeyUsage()) {
        KeyPurposeId keyPurposeId = BouncyCastleCertificateHelper.toExtendedKeyUsage(keyUsageType);
        if (keyPurposeId != null) {
          vector.add(keyPurposeId);
        }
      }
      if (vector.size() > 0) {
View Full Code Here

        }

        if (this.extendedKeyUsage.size() > 0) {
          Vector<DERObject> vector = new Vector<DERObject>();
          for (ExtendedKeyUsageType keyUsageType : this.extendedKeyUsage) {
            KeyPurposeId keyPurposeId = this.toExtendedKeyUsage(keyUsageType);
            if (keyPurposeId != null) {
              vector.add(keyPurposeId);
            }
          }
          if (vector.size() > 0) {
View Full Code Here

  protected void addV3ExtendedKeyUsage(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) throws CertIOException {
    if (!request.getExtendedKeyUsage().isEmpty()) {
      Vector<ASN1Primitive> vector = new Vector<ASN1Primitive>();
      for (ExtendedKeyUsageType keyUsageType : request.getExtendedKeyUsage()) {
        KeyPurposeId keyPurposeId = BouncyCastleCertificateHelper.toExtendedKeyUsage(keyUsageType);
        if (keyPurposeId != null) {
          vector.add(keyPurposeId);
        }
      }
      if (vector.size() > 0) {
View Full Code Here

  protected void addV3ExtendedKeyUsage(final JcaX509v3CertificateBuilder builder, final BouncyCastleCertificateRequest request) {
    if (!request.getExtendedKeyUsage().isEmpty()) {
      Vector<DERObject> vector = new Vector<DERObject>();
      for (ExtendedKeyUsageType keyUsageType : request.getExtendedKeyUsage()) {
        KeyPurposeId keyPurposeId = BouncyCastleCertificateHelper.toExtendedKeyUsage(keyUsageType);
        if (keyPurposeId != null) {
          vector.add(keyPurposeId);
        }
      }
      if (vector.size() > 0) {
View Full Code Here

TOP

Related Classes of org.apache.geronimo.crypto.asn1.x509.KeyPurposeId

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.