Skip to content

Commit

Permalink
remove deprecated crl api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
tsaarni committed Mar 15, 2023
1 parent 3dd66fc commit dab54cd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crl.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ package certyaml
import (
"bytes"
"crypto/rand"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"math/big"
"os"
"time"
)
Expand Down Expand Up @@ -107,7 +109,14 @@ func (crl *CRL) DER() (crlBytes []byte, err error) {
return nil, err
}

return ca.CreateCRL(rand.Reader, privateKey, revokedCerts, effectiveRevocationTime, effectiveExpiry)
template := &x509.RevocationList{
Number: big.NewInt(0),
ThisUpdate: effectiveRevocationTime,
NextUpdate: effectiveExpiry,
RevokedCertificates: revokedCerts,
}

return x509.CreateRevocationList(rand.Reader, template, &ca, privateKey)
}

// PEM returns the CRL as PEM buffer.
Expand Down

0 comments on commit dab54cd

Please sign in to comment.