Package org.ejbca.core.protocol.ws.client.gen

Examples of org.ejbca.core.protocol.ws.client.gen.RevokeStatus


        String issuerdn = cert.getIssuerDN().toString();
        String serno = cert.getSerialNumber().toString(16);

        ejbcaraws.revokeCert(issuerdn, serno, RevokedCertInfo.REVOCATION_REASON_CERTIFICATEHOLD);

        RevokeStatus revokestatus = ejbcaraws.checkRevokationStatus(issuerdn, serno);
        assertNotNull(revokestatus);
        assertTrue(revokestatus.getReason() == RevokedCertInfo.REVOCATION_REASON_CERTIFICATEHOLD);

        assertTrue(revokestatus.getCertificateSN().equals(serno));
        assertTrue(revokestatus.getIssuerDN().equals(issuerdn));
        assertNotNull(revokestatus.getRevocationDate());

        ejbcaraws.revokeCert(issuerdn, serno, RevokedCertInfo.NOT_REVOKED);

        revokestatus = ejbcaraws.checkRevokationStatus(issuerdn, serno);
        assertNotNull(revokestatus);
        assertTrue(revokestatus.getReason() == RevokedCertInfo.NOT_REVOKED);

        ejbcaraws.revokeCert(issuerdn, serno, RevokedCertInfo.REVOCATION_REASON_KEYCOMPROMISE);

        revokestatus = ejbcaraws.checkRevokationStatus(issuerdn, serno);
        assertNotNull(revokestatus);
        assertTrue(revokestatus.getReason() == RevokedCertInfo.REVOCATION_REASON_KEYCOMPROMISE);

        try {
            ejbcaraws.revokeCert(issuerdn, serno, RevokedCertInfo.NOT_REVOKED);
            assertTrue(false);
        }catch(AlreadyRevokedException_Exception e){}
View Full Code Here


        ejbcaraws.revokeToken("12345678", RevokeStatus.REVOKATION_REASON_KEYCOMPROMISE);

        String issuerdn1 = cert1.getIssuerDN().toString();
        String serno1 = cert1.getSerialNumber().toString(16);

        RevokeStatus revokestatus = ejbcaraws.checkRevokationStatus(issuerdn1, serno1);
        assertNotNull(revokestatus);
        assertTrue(revokestatus.getReason() == RevokeStatus.REVOKATION_REASON_KEYCOMPROMISE);

        String issuerdn2 = cert2.getIssuerDN().toString();
        String serno2 = cert2.getSerialNumber().toString(16);

        revokestatus = ejbcaraws.checkRevokationStatus(issuerdn2, serno2);
        assertNotNull(revokestatus);
        assertTrue(revokestatus.getReason() == RevokeStatus.REVOKATION_REASON_KEYCOMPROMISE);

    }
View Full Code Here

        X509Certificate cert = (X509Certificate) ks.getCertificate(alias);

        String issuerdn = cert.getIssuerDN().toString();
        String serno = cert.getSerialNumber().toString(16);

        RevokeStatus revokestatus = ejbcaraws.checkRevokationStatus(issuerdn, serno);
        assertNotNull(revokestatus);
        assertTrue(revokestatus.getReason() == RevokedCertInfo.NOT_REVOKED);

        ejbcaraws.revokeCert(issuerdn, serno, RevokedCertInfo.REVOCATION_REASON_KEYCOMPROMISE);

        revokestatus = ejbcaraws.checkRevokationStatus(issuerdn, serno);
        assertNotNull(revokestatus);
        assertTrue(revokestatus.getReason() == RevokedCertInfo.REVOCATION_REASON_KEYCOMPROMISE);
        assertTrue(revokestatus.getCertificateSN().equals(serno));
        assertTrue(revokestatus.getIssuerDN().equals(issuerdn));
        assertNotNull(revokestatus.getRevocationDate());
    }
View Full Code Here

            String issuerdn = CertTools.stringToBCDNString(args[ARG_ISSUERDN]);           
            String certsn = getCertSN(args[ARG_CERTSN]);
            int reason = getRevokeReason(args[ARG_REASON]);
           
            try{
              RevokeStatus status =  getEjbcaRAWS().checkRevokationStatus(issuerdn,certsn);
              if (status != null) {
                  getEjbcaRAWS().revokeCert(issuerdn,certsn,reason);                      
                    getPrintStream().println("Certificate revoked (or unrevoked) successfully.");               
              } else {
                getPrintStream().println("Certificate does not exist.");
View Full Code Here

            String issuerdn = CertTools.stringToBCDNString(args[ARG_ISSUERDN]);           
            String certsn = getCertSN(args[ARG_CERTSN]);                                  
                  
            try{
             
              RevokeStatus status = getEjbcaRAWS().checkRevokationStatus(issuerdn,certsn);
              if(status == null){
                getPrintStream().println("Error, No certificate found in database.");
              }else{
                getPrintStream().println("Revocation status :");
                getPrintStream().println("  IssuerDN      : " + status.getIssuerDN());
                getPrintStream().println("  CertificateSN : " + status.getCertificateSN());
                if(status.getReason() == RevokedCertInfo.NOT_REVOKED){
                  getPrintStream().println("  Status        : NOT REVOKED");
                }else{
                  getPrintStream().println("  Status        : REVOKED");
                  getPrintStream().println("  Reason        : " + getRevokeReason(status.getReason()));
                  getPrintStream().println("  Date          : " + status.getRevocationDate().toString());
                }
              }
            }catch(AuthorizationDeniedException_Exception e){
              getPrintStream().println("Error : " + e.getMessage());           
            }
View Full Code Here

                try {
                    ejbcaraws.revokeCert(issuerdn, serno, RevokedCertInfo.REVOCATION_REASON_CERTIFICATEHOLD);
                    assertTrue(ERRORNOTSENTFORAPPROVAL, false);
                } catch (ApprovalException_Exception e1) {
                }
                RevokeStatus revokestatus = ejbcaraws.checkRevokationStatus(issuerdn, serno);
                assertNotNull(revokestatus);
                assertTrue(revokestatus.getReason() == RevokedCertInfo.NOT_REVOKED);
                // Approve revocation and verify success
                approveRevocation(intAdmin, approvingAdmin, username, RevokedCertInfo.REVOCATION_REASON_CERTIFICATEHOLD,
                        ApprovalDataVO.APPROVALTYPE_REVOKECERTIFICATE, certificateStoreSession, approvalSession, approvalExecutionSession, caID);
                // Try to unrevoke certificate
                try {
View Full Code Here

TOP

Related Classes of org.ejbca.core.protocol.ws.client.gen.RevokeStatus

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.