private CACertificate ca;
public Certificate(User owner, HashMap<String, String> dn, String md, String csr, CSRType csrType, CertificateProfile profile, SubjectAlternateName... sans) throws GigiApiException {
- if ( !owner.canIssue(profile)) {
+ if ( !profile.canBeIssuedBy(owner)) {
throw new GigiApiException("You are not allowed to issue these certificates.");
}
this.owner = owner;
crtName = rs.getString(1);
serial = rs.getString(4);
- ca = CACertificate.getById(rs.getInt("caid"));
if (rs.getTimestamp(2) == null) {
return CertificateStatus.DRAFT;
}
+ ca = CACertificate.getById(rs.getInt("caid"));
if (rs.getTimestamp(2) != null && rs.getTimestamp(3) == null) {
return CertificateStatus.ISSUED;
}