testutils

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Overview

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const IntermediateCAFileName = "intermediateCA"
View Source
const RootCAFileName = "rootCA"

Variables

This section is empty.

Functions

func CertTemplate

func CertTemplate(subjectCN string, ips []net.IP) (*x509.Certificate, error)

func GenerateIntermediateCA

func GenerateIntermediateCA(subjectCN string, host string, rootCAKeyPair tls.Certificate) ([]byte, []byte, error)

func GenerateRootCA

func GenerateRootCA(subjectCN string, host string) ([]byte, []byte, error)

func GenerateTestCrypto added in v0.2.2

func GenerateTestCrypto(t *testing.T, names []string, withIntermediateCA ...bool) string

func IssueCertificate

func IssueCertificate(subjectCN string, host string, rootCAKeyPair tls.Certificate) ([]byte, []byte, error)

func LoadTestCA added in v0.2.2

func LoadTestCA(t *testing.T, tempDir, name string) (cert *x509.Certificate, key []byte)

func LoadTestCrypto added in v0.2.2

func LoadTestCrypto(t *testing.T, tempDir, name string) (*x509.Certificate, crypto.Signer)

func SignatureFromQuery

func SignatureFromQuery(t *testing.T, signer crypto.Signer, query interface{}) []byte

func SignatureFromTx

func SignatureFromTx(t *testing.T, signer crypto.Signer, tx interface{}) []byte

func SignedConfigTxEnvelope

func SignedConfigTxEnvelope(t *testing.T, signer crypto.Signer, tx *types.ConfigTx) *types.ConfigTxEnvelope

func SignedDBAdministrationTxEnvelope

func SignedDBAdministrationTxEnvelope(t *testing.T, signer crypto.Signer, tx *types.DBAdministrationTx) *types.DBAdministrationTxEnvelope

func SignedDataTxEnvelope

func SignedDataTxEnvelope(t *testing.T, signers []crypto.Signer, tx *types.DataTx) *types.DataTxEnvelope

func VerifyPayloadSignature

func VerifyPayloadSignature(t *testing.T, rawCert []byte, payload interface{}, sig []byte)

Types

This section is empty.

Jump to

Keyboard shortcuts

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