@@ -2,7 +2,6 @@ package pki
22
33import (
44 "crypto/x509"
5- "crypto/x509/pkix"
65 "encoding/pem"
76 "fmt"
87 "io"
@@ -128,25 +127,25 @@ func (c *ServicesService) getCA(path string, options ...OptionFunc) (*x509.Certi
128127 return pub , block , resp , err
129128}
130129
131- // GetRootCRL
132- func (c * ServicesService ) GetRootCRL (options ... OptionFunc ) (* pkix. CertificateList , * pem.Block , * Response , error ) {
130+ // GetRootRevocationList
131+ func (c * ServicesService ) GetRootRevocationList (options ... OptionFunc ) (* x509. RevocationList , * pem.Block , * Response , error ) {
133132 options = append (options , func (req * http.Request ) error {
134133 req .Header .Del ("Authorization" ) // Remove authorization header
135134 return nil
136135 })
137- return c .getCRL ("core/pki/api/root/crl/pem" , options ... )
136+ return c .getRevocationList ("core/pki/api/root/crl/pem" , options ... )
138137}
139138
140- // GetPolicyCRL
141- func (c * ServicesService ) GetPolicyCRL (options ... OptionFunc ) (* pkix. CertificateList , * pem.Block , * Response , error ) {
139+ // GetPolicyRevocationList
140+ func (c * ServicesService ) GetPolicyRevocationList (options ... OptionFunc ) (* x509. RevocationList , * pem.Block , * Response , error ) {
142141 options = append (options , func (req * http.Request ) error {
143142 req .Header .Del ("Authorization" ) // Remove authorization header
144143 return nil
145144 })
146- return c .getCRL ("core/pki/api/policy/crl/pem" , options ... )
145+ return c .getRevocationList ("core/pki/api/policy/crl/pem" , options ... )
147146}
148147
149- func (c * ServicesService ) getCRL (path string , options ... OptionFunc ) (* pkix. CertificateList , * pem.Block , * Response , error ) {
148+ func (c * ServicesService ) getRevocationList (path string , options ... OptionFunc ) (* x509. RevocationList , * pem.Block , * Response , error ) {
150149 req , err := c .client .newServiceRequest (http .MethodGet , path , nil , options )
151150 if err != nil {
152151 return nil , nil , nil , err
@@ -156,7 +155,7 @@ func (c *ServicesService) getCRL(path string, options ...OptionFunc) (*pkix.Cert
156155 return nil , nil , resp , err
157156 }
158157 if resp == nil {
159- return nil , nil , resp , fmt .Errorf ("getCRL : %w" , ErrEmptyResult )
158+ return nil , nil , resp , fmt .Errorf ("getRevocationList : %w" , ErrEmptyResult )
160159 }
161160 defer func () {
162161 _ = resp .Body .Close ()
@@ -169,7 +168,7 @@ func (c *ServicesService) getCRL(path string, options ...OptionFunc) (*pkix.Cert
169168 if block == nil || block .Type != "X509 CRL" {
170169 return nil , nil , resp , ErrCRLExpected
171170 }
172- pub , err := x509 .ParseCRL (block .Bytes )
171+ pub , err := x509 .ParseRevocationList (block .Bytes )
173172 return pub , block , resp , err
174173}
175174
0 commit comments