Documentation ¶
Index ¶
- Variables
- func DecodeTestConfig(data []byte) (map[string]any, error)
- func GetFreePort() (int, error)
- type CA
- type CertificateBuilder
- type CertificateBuilderOption
- func WithDNSNames(names []string) CertificateBuilderOption
- func WithEMailAddresses(addresses []string) CertificateBuilderOption
- func WithExtendedKeyUsage(usage x509.ExtKeyUsage) CertificateBuilderOption
- func WithExtension(extension pkix.Extension) CertificateBuilderOption
- func WithExtraExtension(extension pkix.Extension) CertificateBuilderOption
- func WithGeneratedSubjectKeyID() CertificateBuilderOption
- func WithIPAddresses(addresses []net.IP) CertificateBuilderOption
- func WithIsCA() CertificateBuilderOption
- func WithIssuer(key any, cert *x509.Certificate) CertificateBuilderOption
- func WithKeyUsage(keyUsage x509.KeyUsage) CertificateBuilderOption
- func WithSelfSigned() CertificateBuilderOption
- func WithSerialNumber(SN *big.Int) CertificateBuilderOption
- func WithSignaturePrivKey(key any) CertificateBuilderOption
- func WithSubject(name pkix.Name) CertificateBuilderOption
- func WithSubjectKeyID(skid []byte) CertificateBuilderOption
- func WithSubjectPubKey(key any, alg x509.SignatureAlgorithm) CertificateBuilderOption
- func WithURIs(uris []*url.URL) CertificateBuilderOption
- func WithValidity(notBefore time.Time, duration time.Duration) CertificateBuilderOption
- type EndEntity
- type PatchedOSExit
- type TestingLog
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTestPurpose = errors.New("error raised in a test") ErrTestPurpose2 = errors.New("another error raised in a test") )
Functions ¶
func GetFreePort ¶
Types ¶
type CA ¶
type CA struct { PrivKey *ecdsa.PrivateKey Certificate *x509.Certificate // contains filtered or unexported fields }
func NewCA ¶
func NewCA(privKey *ecdsa.PrivateKey, cert *x509.Certificate) *CA
func (*CA) IssueCertificate ¶
func (ca *CA) IssueCertificate(opts ...CertificateBuilderOption) (*x509.Certificate, error)
type CertificateBuilder ¶
type CertificateBuilder struct {
// contains filtered or unexported fields
}
func NewCertificateBuilder ¶
func NewCertificateBuilder(opts ...CertificateBuilderOption) *CertificateBuilder
func (*CertificateBuilder) Build ¶
func (cb *CertificateBuilder) Build() (*x509.Certificate, error)
type CertificateBuilderOption ¶
type CertificateBuilderOption func(*CertificateBuilder)
func WithDNSNames ¶
func WithDNSNames(names []string) CertificateBuilderOption
func WithEMailAddresses ¶
func WithEMailAddresses(addresses []string) CertificateBuilderOption
func WithExtendedKeyUsage ¶
func WithExtendedKeyUsage(usage x509.ExtKeyUsage) CertificateBuilderOption
func WithExtension ¶
func WithExtension(extension pkix.Extension) CertificateBuilderOption
func WithExtraExtension ¶
func WithExtraExtension(extension pkix.Extension) CertificateBuilderOption
func WithGeneratedSubjectKeyID ¶
func WithGeneratedSubjectKeyID() CertificateBuilderOption
func WithIPAddresses ¶
func WithIPAddresses(addresses []net.IP) CertificateBuilderOption
func WithIsCA ¶
func WithIsCA() CertificateBuilderOption
func WithIssuer ¶
func WithIssuer(key any, cert *x509.Certificate) CertificateBuilderOption
func WithKeyUsage ¶
func WithKeyUsage(keyUsage x509.KeyUsage) CertificateBuilderOption
func WithSelfSigned ¶
func WithSelfSigned() CertificateBuilderOption
func WithSerialNumber ¶
func WithSerialNumber(SN *big.Int) CertificateBuilderOption
func WithSignaturePrivKey ¶
func WithSignaturePrivKey(key any) CertificateBuilderOption
func WithSubject ¶
func WithSubject(name pkix.Name) CertificateBuilderOption
func WithSubjectKeyID ¶
func WithSubjectKeyID(skid []byte) CertificateBuilderOption
func WithSubjectPubKey ¶
func WithSubjectPubKey(key any, alg x509.SignatureAlgorithm) CertificateBuilderOption
func WithURIs ¶
func WithURIs(uris []*url.URL) CertificateBuilderOption
func WithValidity ¶
func WithValidity(notBefore time.Time, duration time.Duration) CertificateBuilderOption
type EndEntity ¶
type EndEntity struct { Certificate *x509.Certificate PrivKey any }
type PatchedOSExit ¶
func PatchOSExit ¶
func PatchOSExit(t *testing.T, mockOSExitImpl func(int)) (*PatchedOSExit, error)
type TestingLog ¶
func (*TestingLog) CollectedLog ¶
func (t *TestingLog) CollectedLog() string
func (*TestingLog) Log ¶
func (t *TestingLog) Log(args ...interface{})
func (*TestingLog) Logf ¶
func (t *TestingLog) Logf(format string, args ...interface{})
Source Files ¶
Click to show internal directories.
Click to hide internal directories.