1 13 14 19 package org.ejbca.ui.web.admin.rainterface; 20 21 import java.io.Serializable ; 22 import java.math.BigInteger ; 23 import java.util.ArrayList ; 24 import java.util.Date ; 25 26 import org.ejbca.core.model.ca.crl.RevokedCertInfo; 27 28 29 30 31 36 public class RevokedInfoView implements Serializable { 37 39 44 public RevokedInfoView(RevokedCertInfo revokedcertinfo) { 45 this.revokedcertinfo = revokedcertinfo; 46 } 47 48 public String getCertificateSerialNumberAsString() { 50 return this.revokedcertinfo.getUserCertificate().toString(16); 51 } 52 53 58 public BigInteger getCertificateSerialNumber() { 59 return this.revokedcertinfo.getUserCertificate(); 60 } 61 62 67 public Date getRevocationDate() { 68 return this.revokedcertinfo.getRevocationDate(); 69 } 70 71 76 public String [] getRevokationReasons() { 77 String [] dummy = { "" }; 78 ArrayList reasons = new ArrayList (); 79 int reason = this.revokedcertinfo.getReason(); 80 81 if ((reason >= 0) && (reason < HIGN_REASON_BOUNDRARY)) { 82 reasons.add(reasontexts[reason]); 84 } 85 86 return (String []) reasons.toArray(dummy); 87 } 88 89 public boolean isRevoked(){ 90 return this.revokedcertinfo.getReason() != RevokedCertInfo.NOT_REVOKED; 91 } 92 93 public static final String [] reasontexts = { 95 "UNSPECIFIED", "KEYCOMPROMISE", "CACOMPROMISE", "AFFILIATIONCHANGED", "SUPERSEDED", 96 "CESSATIONOFOPERATION", "CERTIFICATEHOLD", "UNUSED", "REMOVEFROMCRL", "PRIVILEGESWITHDRAWN", 97 "AACOMPROMISE" 98 }; 99 public static final int HIGN_REASON_BOUNDRARY = 11; 100 101 private RevokedCertInfo revokedcertinfo; 103 } 104 | Popular Tags |