8292033: Move jdk.X509Certificate event logic to JCA layer

Reviewed-by: mullan
This commit is contained in:
Sean Coffey 2022-11-09 21:46:56 +00:00
parent 1b94ae13d3
commit 102b2b32fe
12 changed files with 186 additions and 88 deletions

View file

@ -41,6 +41,7 @@ import java.util.concurrent.ConcurrentHashMap;
import javax.security.auth.x500.X500Principal;
import sun.security.jca.JCAUtil;
import sun.security.util.*;
import sun.security.provider.X509Factory;
@ -266,6 +267,13 @@ public class X509CertImpl extends X509Certificate implements DerEncoder {
}
}
// helper method to record certificate, if necessary, after construction
public static X509CertImpl newX509CertImpl(byte[] certData) throws CertificateException {
var cert = new X509CertImpl(certData);
JCAUtil.tryCommitCertEvent(cert);
return cert;
}
/**
* Appends the certificate to an output stream.
*