Skip to content

proposal: crypto/x509: Export CertPool Length #70819

Description

@zapisanchez

Proposal Details

Actually the only way to know if you have some into a certpool is

if (cp.Equal(&x509.CertPool{})) {
fmt.Printf("CertPool is empty")
}

This way, we only can now if empty or not, but we don't now any about the number of certificates added.

I propose to export the len method

func (s *CertPool) Len() int {
	if s == nil {
		return 0
	}
return len(s.lazyCerts)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions