mirror of
https://github.com/outbackdingo/certificates.git
synced 2026-01-27 10:18:34 +00:00
Add comment to differentiate GetRootCertificates and GetRoots.
This commit is contained in:
@@ -29,16 +29,24 @@ func (a *Authority) GetRootCertificate() *x509.Certificate {
|
||||
}
|
||||
|
||||
// GetRootCertificates returns the server root certificates.
|
||||
//
|
||||
// In the Authority interface we also have a similar method, GetRoots, at the
|
||||
// moment the functionality of these two methods are almost identical, but this
|
||||
// method is intended to be used internally by CA HTTP server to load the roots
|
||||
// that will be set in the tls.Config while GetRoots will be used by the
|
||||
// Authority interface and might have extra checks in the future.
|
||||
func (a *Authority) GetRootCertificates() []*x509.Certificate {
|
||||
return a.rootX509Certs
|
||||
}
|
||||
|
||||
// GetRoots returns all the root certificates for this CA.
|
||||
// This method implements the Authority interface.
|
||||
func (a *Authority) GetRoots() ([]*x509.Certificate, error) {
|
||||
return a.rootX509Certs, nil
|
||||
}
|
||||
|
||||
// GetFederation returns all the root certificates in the federation.
|
||||
// This method implements the Authority interface.
|
||||
func (a *Authority) GetFederation() (federation []*x509.Certificate, err error) {
|
||||
a.certificates.Range(func(k, v interface{}) bool {
|
||||
crt, ok := v.(*x509.Certificate)
|
||||
|
||||
Reference in New Issue
Block a user