@@ -1536,8 +1536,8 @@ private void doGenCert(String alias, String sigAlgName, InputStream in, PrintStr
1536
1536
subjectPubKey ,
1537
1537
signerSubjectKeyId );
1538
1538
info .setExtensions (ext );
1539
- X509CertImpl cert = new X509CertImpl ( info );
1540
- cert . sign ( privateKey , sigAlgName );
1539
+ X509CertImpl cert = X509CertImpl
1540
+ . newSigned ( info , privateKey , sigAlgName );
1541
1541
dumpCert (cert , out );
1542
1542
for (Certificate ca : keyStore .getCertificateChain (alias )) {
1543
1543
if (ca instanceof X509Certificate xca ) {
@@ -1589,8 +1589,9 @@ private void doGenCRL(PrintStream out)
1589
1589
badCerts [i ] = new X509CRLEntryImpl (new BigInteger (ids .get (i )), firstDate );
1590
1590
}
1591
1591
}
1592
- X509CRLImpl crl = new X509CRLImpl (owner , firstDate , lastDate , badCerts );
1593
- crl .sign (privateKey , sigAlgName );
1592
+ X509CRLImpl crl = X509CRLImpl .newSigned (
1593
+ new X509CRLImpl .TBSCertList (owner , firstDate , lastDate , badCerts ),
1594
+ privateKey , sigAlgName );
1594
1595
if (rfc ) {
1595
1596
out .println ("-----BEGIN X509 CRL-----" );
1596
1597
out .println (Base64 .getMimeEncoder (64 , CRLF ).encodeToString (crl .getEncodedInternal ()));
@@ -3228,8 +3229,8 @@ private void doSelfCert(String alias, String dname, String sigAlgName)
3228
3229
null );
3229
3230
certInfo .setExtensions (ext );
3230
3231
// Sign the new certificate
3231
- X509CertImpl newCert = new X509CertImpl ( certInfo );
3232
- newCert . sign ( privKey , sigAlgName );
3232
+ X509CertImpl newCert = X509CertImpl . newSigned (
3233
+ certInfo , privKey , sigAlgName );
3233
3234
3234
3235
// Store the new certificate as a single-element certificate chain
3235
3236
keyStore .setKeyEntry (alias , privKey ,
0 commit comments