Package org.ejbca.cvc

Examples of org.ejbca.cvc.AuthorizationRoleEnum


            }
    } else if (StringUtils.equals(cert.getType(), "CVC")) {
      CardVerifiableCertificate cvccert = (CardVerifiableCertificate)cert;
      try {
        CVCAuthorizationTemplate templ = cvccert.getCVCertificate().getCertificateBody().getAuthorizationTemplate();
        AuthorizationRoleEnum role = templ.getAuthorizationField().getRole();
        if (role.equals(AuthorizationRoleEnum.CVCA) || role.equals(AuthorizationRoleEnum.DV_D) || role.equals(AuthorizationRoleEnum.DV_F)) {
          ret = true;
        }
      } catch (NoSuchFieldException e) {
        log.error("NoSuchFieldException: ", e);
      }
View Full Code Here


            seq = RandomStringUtils.randomNumeric(5);
            getLogger().info("No sequence given, using random 5 number sequence: "+seq);
          }
              HolderReferenceField holderRef = new HolderReferenceField(country, mnemonic, seq);
              CAReferenceField caRef = new CAReferenceField(holderRef.getCountry(), holderRef.getMnemonic(), holderRef.getSequence());
              AuthorizationRoleEnum authRole = AuthorizationRoleEnum.CVCA;
              Date notBefore = new Date();
              Calendar notAfter = Calendar.getInstance();
              notAfter.add(Calendar.DAY_OF_MONTH, valdays);
              CVCertificate cvc = CertificateGenerator.createCertificate(pubKey, privKey,
                  sigAlg, caRef, holderRef, authRole, AccessRightEnum.READ_ACCESS_DG3_AND_DG4, notBefore, notAfter.getTime(), "BC");
View Full Code Here

      }
      // Check if the input was a CVCA certificate, which is the same CVCA as this. If all is true we should create a CVCA link certificate
      // instead of an authenticated request
      CardVerifiableCertificate cvccert = new CardVerifiableCertificate(cvcert);
      HolderReferenceField cvccertholder = cvccert.getCVCertificate().getCertificateBody().getHolderReference();
      AuthorizationRoleEnum authRole = null;
      AccessRightEnum rights = null;
      try {
        authRole = cvccert.getCVCertificate().getCertificateBody().getAuthorizationTemplate().getAuthorizationField().getRole();         
         rights = cvccert.getCVCertificate().getCertificateBody().getAuthorizationTemplate().getAuthorizationField().getAccessRight();
      } catch (NoSuchFieldException e) {
View Full Code Here

        // Get certificate validity time notBefore and notAfter
        CertificateValidity val = new CertificateValidity(subject, certProfile, notBefore, notAfter, cacert, isRootCA);

        // We must take the issuer DN directly from the CA-certificate, if we are not creating a new Root CA
        CAReferenceField caRef = null;
        AuthorizationRoleEnum authRole = AuthorizationRoleEnum.IS;
        if (isRootCA) {
          // This will be an initial root CA, since no CA-certificate exists
          if (log.isDebugEnabled()) {
            log.debug("Using Holder Ref also as CA Ref, because it is a root CA");
          }
View Full Code Here

TOP

Related Classes of org.ejbca.cvc.AuthorizationRoleEnum

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.