-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add support for TSA Certificates #680
Conversation
int numSignableEntriesInJar = 0; | ||
|
||
// Record current time just before checking the jar begins. | ||
final ZonedDateTime now = ZonedDateTime.now(); | ||
final ZonedDateTime shortlyAfterNow = now.plus(6, MONTHS); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6 month are not "shortly after now" ;)
final X509Certificate tsaCertificate = (X509Certificate) optionalSignatureTimestamp | ||
.map(Timestamp::getSignerCertPath) | ||
.map(CertPath::getCertificates) | ||
.map(certs -> certs.get(0)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this end in an ArrayOutOfBounds? Maybe a filter before that one makes sense.
if (tsaCertificate != null) { | ||
final ZonedDateTime tsaNotBefore = zonedDateTime(tsaCertificate.getNotBefore()); | ||
final ZonedDateTime tsaNotAfter = zonedDateTime(tsaCertificate.getNotAfter()); | ||
final ZonedDateTime signedAt = zonedDateTime(optionalSignatureTimestamp.get().getTimestamp()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use orElseThrow instead of get here. I understand that I can not happen now that the val is null but maybe in future based on refactoring. So maybe throw a specific exception + description here.
No description provided.