Documentation ¶
Index ¶
- func ReadTestCert(inPath string) *x509.Certificate
- func ReadTestRevocationList(tb testing.TB, inPath string) *x509.RevocationList
- func TestLint(lintName string, testCertFilename string) *lint.LintResult
- func TestLintCert(lintName string, cert *x509.Certificate, ctx lint.Configuration) *lint.LintResult
- func TestLintRevocationList(tb testing.TB, lintName string, crl *x509.RevocationList, ...) *lint.LintResult
- func TestLintWithConfig(lintName string, testCertFilename string, configuration string) *lint.LintResult
- func TestRevocationListLint(tb testing.TB, lintName string, testCRLFilename string) *lint.LintResult
- func TestRevocationListLintWithConfig(tb testing.TB, lintName string, testCRLFilename string, configuration string) *lint.LintResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadTestCert ¶
func ReadTestCert(inPath string) *x509.Certificate
ReadTestCert loads a x509.Certificate from the given inPath which is assumed to be relative to `testdata/`.
Important: ReadTestCert is only appropriate for unit tests. It will panic if the inPath file can not be loaded.
func ReadTestRevocationList ¶ added in v3.5.0
func ReadTestRevocationList(tb testing.TB, inPath string) *x509.RevocationList
ReadTestRevocationList loads a x509.RevocationList from the given inPath which is assumed to be relative to `testdata/`.
Important: ReadTestRevocationList is only appropriate for unit tests. It will panic if the inPath file can not be loaded.
func TestLint ¶
func TestLint(lintName string, testCertFilename string) *lint.LintResult
TestLint executes the given lintName against a certificate read from a testcert data file with the given filename. Filenames should be relative to `testdata/` and not absolute file paths.
Important: TestLint is only appropriate for unit tests. It will panic if the lintName is not known or if the testCertFilename can not be loaded, or if the lint result is nil.
func TestLintCert ¶
func TestLintCert(lintName string, cert *x509.Certificate, ctx lint.Configuration) *lint.LintResult
TestLintCert executes a lint with the given name against an already parsed certificate. This is useful when a unit test reads a certificate from disk and then mutates it in some way before trying to lint it.
Important: TestLintCert is only appropriate for unit tests. It will panic if the lintName is not known or if the lint result is nil.
func TestLintRevocationList ¶ added in v3.5.0
func TestLintRevocationList(tb testing.TB, lintName string, crl *x509.RevocationList, ctx lint.Configuration) *lint.LintResult
TestLintRevocationList executes a lint with the given name against an already parsed revocation list. This is useful when a unit test reads a revocation list from disk and then mutates it in some way before trying to lint it.
func TestLintWithConfig ¶ added in v3.4.0
func TestLintWithConfig(lintName string, testCertFilename string, configuration string) *lint.LintResult
func TestRevocationListLint ¶ added in v3.5.0
func TestRevocationListLint(tb testing.TB, lintName string, testCRLFilename string) *lint.LintResult
TestRevocationListLint executes the given lintName against a CRL read from a testcrl data file with the given filename. Filenames should be relative to `testdata/` and not absolute file paths.
func TestRevocationListLintWithConfig ¶ added in v3.5.0
Types ¶
This section is empty.