Skip to content

Commit

Permalink
Add CertificateAuthority.certRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Jan 31, 2024
1 parent ec8eb4a commit 62df9a6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 11 additions & 2 deletions base/ca/src/main/java/com/netscape/ca/CertificateAuthority.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ public class CertificateAuthority extends Subsystem implements IAuthority, IOCSP
protected int fastSigning;
protected boolean ocspResponderByName;

protected CertificateRepository certRepository;

protected CASigningUnit mSigningUnit;
protected CASigningUnit mOCSPSigningUnit;
protected CASigningUnit mCRLSigningUnit;
Expand Down Expand Up @@ -390,6 +392,14 @@ public void setOCSPResponderByName(boolean ocspResponderByName) {
this.ocspResponderByName = ocspResponderByName;
}

public CertificateRepository getCertRepository() {
return certRepository;
}

public void setCertRepository(CertificateRepository certRepository) {
this.certRepository = certRepository;
}

/**
* Retrieves the default signature algorithm of this certificate authority.
*
Expand Down Expand Up @@ -1007,7 +1017,6 @@ public SingleResponse processRequest(Request req) throws EBaseException {

String name = "CertificateAuthority: processRequest: ";
CAEngine engine = CAEngine.getInstance();
CertificateRepository certificateRepository = engine.getCertificateRepository();

X509CertImpl caCert = mSigningUnit.getCertImpl();
X509Key key = (X509Key) caCert.getPublicKey();
Expand Down Expand Up @@ -1070,7 +1079,7 @@ public SingleResponse processRequest(Request req) throws EBaseException {
}

try {
CertRecord rec = certificateRepository.readCertificateRecord(serialNo);
CertRecord rec = certRepository.readCertificateRecord(serialNo);
String status = rec.getStatus();

if (status == null) {
Expand Down
2 changes: 2 additions & 0 deletions base/ca/src/main/java/org/dogtagpki/server/ca/CAEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -1951,6 +1951,8 @@ public void initCA(CertificateAuthority ca) throws Exception {
ca.setFastSigning(fastSigning);
ca.setOCSPResponderByName(ocspResponderByName);

ca.setCertRepository(certificateRepository);

try {
initCertSigningUnit(ca);
initCRLSigningUnit(ca);
Expand Down

0 comments on commit 62df9a6

Please sign in to comment.