mocks

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockIdentity

type MockIdentity struct {
	mock.Mock

	ID string
}

func (*MockIdentity) Anonymous

func (m *MockIdentity) Anonymous() bool

func (*MockIdentity) ExpiresAt

func (m *MockIdentity) ExpiresAt() time.Time

func (*MockIdentity) GetCertificatePEM

func (*MockIdentity) GetCertificatePEM() ([]byte, error)

GetCertificatePEM is not implemented.

func (*MockIdentity) GetIdentifier

func (m *MockIdentity) GetIdentifier() *msp.IdentityIdentifier

func (*MockIdentity) GetMSPIdentifier

func (*MockIdentity) GetMSPIdentifier() string

func (*MockIdentity) GetOrganizationalUnits

func (*MockIdentity) GetOrganizationalUnits() []*msp.OUIdentifier

func (*MockIdentity) SatisfiesPrincipal

func (m *MockIdentity) SatisfiesPrincipal(principal *pmsp.MSPPrincipal) error

func (*MockIdentity) Serialize

func (*MockIdentity) Serialize() ([]byte, error)

SerializeWithCert is not implemented.

func (*MockIdentity) SerializeWithIDOfCert

func (*MockIdentity) SerializeWithIDOfCert() ([]byte, error)

SerializeWithIDOfCert is not implemented.

func (*MockIdentity) Validate

func (m *MockIdentity) Validate() error

func (*MockIdentity) Verify

func (*MockIdentity) Verify(msg []byte, sig []byte) error

type MockMSP

type MockMSP struct {
	mock.Mock
}

func (*MockMSP) DeserializeIdentity

func (m *MockMSP) DeserializeIdentity(identity *msppb.Identity) (msp.Identity, error)

DeserializeIdentity converts the proto identity to msp identity.

func (*MockMSP) GetDefaultSigningIdentity

func (m *MockMSP) GetDefaultSigningIdentity() (msp.SigningIdentity, error)

func (*MockMSP) GetIdentifier

func (m *MockMSP) GetIdentifier() (string, error)

func (*MockMSP) GetKnownDeserializedIdentity

func (*MockMSP) GetKnownDeserializedIdentity(msp.IdentityIdentifier) msp.Identity

GetKnownDeserializedIdentity returns a known identity matching the given IdentityIdentifier.

func (*MockMSP) GetTLSIntermediateCerts

func (m *MockMSP) GetTLSIntermediateCerts() [][]byte

func (*MockMSP) GetTLSRootCerts

func (m *MockMSP) GetTLSRootCerts() [][]byte

func (*MockMSP) GetType

func (m *MockMSP) GetType() msp.ProviderType

func (*MockMSP) GetVersion

func (m *MockMSP) GetVersion() msp.MSPVersion

func (*MockMSP) IsWellFormed

func (*MockMSP) IsWellFormed(*msppb.Identity) error

IsWellFormed checks whether the certificate present in the identity is valid.

func (*MockMSP) SatisfiesPrincipal

func (m *MockMSP) SatisfiesPrincipal(id msp.Identity, principal *pmsp.MSPPrincipal) error

func (*MockMSP) Setup

func (m *MockMSP) Setup(config *pmsp.MSPConfig) error

func (*MockMSP) Validate

func (m *MockMSP) Validate(id msp.Identity) error

type MockSigningIdentity

type MockSigningIdentity struct {
	mock.Mock
	*MockIdentity
}

func (*MockSigningIdentity) GetPublicVersion

func (*MockSigningIdentity) GetPublicVersion() msp.Identity

func (*MockSigningIdentity) Sign

func (*MockSigningIdentity) Sign(msg []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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