bc-java
bc-java copied to clipboard
Request new method: X509v2CRLBuilder.setThisUpdate()
The class X509v2CRLBuilder has methods setNextUpdate() but no method setThisUpdate(). "This update" is set only through the constructor. Subclassing outside the BC package doesn't help, as fields are package-private. The class V2TBSCertListGenerator is not a substitute, as it lacks a constructor from an existing CRL, which X509v2CRLBuilder has.
The use case is to compare two existing CRL's by first resetting both dates and then comparing encodings.
This has been added to the latest in https://www.bouncycastle.org/betas
Thanks! Not to press my luck, but I found that analogously I needed to also add setters for constructor arguments to X509v3CertificateBuilder. The use case is the same -- equivalence comparison in QA by resetting "variable" fields. The workaround is to copy the whole class to another package.
public void setIssuer(X500Name issuer) {
tbsGen.setIssuer(issuer);
}
public void setSerialNumber(BigInteger serialNumber) {
tbsGen.setSerialNumber(new ASN1Integer(serialNumber));
}
public void setNotBefore(Time notBefore) {
tbsGen.setStartDate(notBefore);
}
public void setNotAfter(Time notAfter) {
tbsGen.setEndDate(notAfter);
}
public void setSubject(X500Name subject) {
tbsGen.setSubject(subject);
}
public void setSubjectPublicKeyInfo(SubjectPublicKeyInfo subjectPublicKeyInfo) {
tbsGen.setSubjectPublicKeyInfo(subjectPublicKeyInfo);
}