test

package
v0.16.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2021 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoopCertificateVerifier cert.Verifier = &noopCertificateVerifier{}
View Source
var NoopJwsVerifier = func(signature []byte, signingTime time.Time, verifier cert.Verifier) ([]byte, error) {
	msg, err := jws.Parse(bytes.NewReader(signature))
	if err != nil {
		return nil, err
	}
	return msg.Payload(), nil
}

NoopJwsVerifier is a JwsVerifier that just parses the JWS without verifying the signatures

Functions

func GenerateCertificateCA added in v0.15.0

func GenerateCertificateCA(name string, signer *x509.Certificate, privKey *rsa.PrivateKey, signerKey *rsa.PrivateKey) []byte

func GenerateCertificateEx

func GenerateCertificateEx(notBefore time.Time, validityInDays int, privKey *rsa.PrivateKey) []byte

func OrganizationID added in v0.15.0

func OrganizationID(value string) core.PartyID

OrganizationID is a helper function which creates PartyIDs for organizations.

func SelfSignCertificateFromCSR

func SelfSignCertificateFromCSR(csr x509.CertificateRequest, notBefore time.Time, validityInDays int) (*x509.Certificate, *rsa.PrivateKey)

func SignCertificateFromCSRWithKey

func SignCertificateFromCSRWithKey(csr x509.CertificateRequest, notBefore time.Time, validityInDays int, ca *x509.Certificate, caPrivKey crypto.Signer) *x509.Certificate

func VendorID added in v0.15.0

func VendorID(value string) core.PartyID

OrganizationID is a helper function which creates PartyIDs for vendors.

Types

type TestRepo

type TestRepo struct {
	Directory string
}

func NewTestRepo

func NewTestRepo(t *testing.T) (*TestRepo, error)

func NewTestRepoFrom

func NewTestRepoFrom(t *testing.T, sourceDir string) (*TestRepo, error)

func (TestRepo) Cleanup

func (r TestRepo) Cleanup()

func (TestRepo) ImportDir

func (r TestRepo) ImportDir(sourceDirectory string) error

func (TestRepo) ImportFileAs

func (r TestRepo) ImportFileAs(sourceFile string, targetFile string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL