| | |
| | | public UserCertificateModel(UserModel user) {
|
| | | this.user = user;
|
| | | }
|
| | | |
| | |
|
| | | public void update(Config config) {
|
| | | if (expires == null) {
|
| | | config.unset("user", user.username, "expires");
|
| | |
| | | public int compareTo(UserCertificateModel o) {
|
| | | return user.compareTo(o.user);
|
| | | }
|
| | | |
| | |
|
| | | public void revoke(BigInteger serial, RevocationReason reason) {
|
| | | if (revoked == null) {
|
| | | revoked = new ArrayList<String>();
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | public boolean isRevoked(BigInteger serial) {
|
| | | return isRevoked(serial.toString());
|
| | | }
|
| | |
| | | }
|
| | | return false;
|
| | | }
|
| | | |
| | |
|
| | | public RevocationReason getRevocationReason(BigInteger serial) {
|
| | | try {
|
| | | String sn = serial + ":";
|
| | |
| | | }
|
| | | return RevocationReason.unspecified;
|
| | | }
|
| | | |
| | |
|
| | | public CertificateStatus getStatus() {
|
| | | if (expires == null) {
|
| | | return CertificateStatus.unknown;
|
| | |
| | | }
|
| | | return CertificateStatus.ok;
|
| | | }
|
| | | |
| | |
|
| | | private boolean isExpiring(Date date) {
|
| | | return (date.getTime() - System.currentTimeMillis()) <= TimeUtils.ONEDAY * 30;
|
| | | }
|
| | | |
| | |
|
| | | private boolean isExpired(Date date) {
|
| | | return date.getTime() < System.currentTimeMillis();
|
| | | }
|