inquire

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CartesianProduct

func CartesianProduct(s1, s2 ComparablePrincipalSets) comparablePrincipalSetPairs

CartesianProduct returns a comparablePrincipalSetPairs that is comprised of the combination of every possible pair of ComparablePrincipalSet such that the first element is in s1, and the second element is in s2.

func NewInquireableSignaturePolicy

func NewInquireableSignaturePolicy(sigPol *common.SignaturePolicyEnvelope) policies.InquireablePolicy

NewInquireableSignaturePolicy creates a signature policy that can be inquired, from a policy and a signature policy.

Types

type ComparablePrincipal

type ComparablePrincipal struct {
	// contains filtered or unexported fields
}

ComparablePrincipal defines an MSPPrincipal that can be compared to other principals

func NewComparablePrincipal

func NewComparablePrincipal(principal *msp.MSPPrincipal) *ComparablePrincipal

NewComparablePrincipal creates a ComparablePrincipal out of the given MSPPrincipal. Returns nil if a failure occurs.

func (*ComparablePrincipal) Equal added in v1.4.6

Equal returns whether this ComparablePrincipal is equal to the given ComparablePrincipal.

func (*ComparablePrincipal) IsA

IsA determines whether all identities that satisfy this ComparablePrincipal also satisfy the other ComparablePrincipal. Example: if this ComparablePrincipal is a Peer role, and the other ComparablePrincipal is a Member role, then all identities that satisfy this ComparablePrincipal (are peers) also satisfy the other principal (are members).

func (*ComparablePrincipal) IsFound

func (cp *ComparablePrincipal) IsFound(set ...*ComparablePrincipal) bool

IsFound returns whether the ComparablePrincipal is found among the given set of ComparablePrincipals For the ComparablePrincipal x to be found, there needs to be some ComparablePrincipal y in the set such that x.IsA(y) will be true.

func (*ComparablePrincipal) ToOURole

func (cp *ComparablePrincipal) ToOURole() *ComparablePrincipal

ToOURole converts this ComparablePrincipal to OU principal, and returns nil on failure

func (*ComparablePrincipal) ToRole

ToRole converts this ComparablePrincipal to MSP Role, and returns nil if the conversion failed

type ComparablePrincipalSet

type ComparablePrincipalSet []*ComparablePrincipal

ComparablePrincipalSet aggregates ComparablePrincipals

func NewComparablePrincipalSet

func NewComparablePrincipalSet(set policies.PrincipalSet) ComparablePrincipalSet

NewComparablePrincipalSet constructs a ComparablePrincipalSet out of the given PrincipalSet

func (ComparablePrincipalSet) Clone

Clone returns a copy of this ComparablePrincipalSet

func (ComparablePrincipalSet) Contains

Contains returns whether this ComparablePrincipalSet contains the given ComparablePrincipal. A ComparablePrincipalSet X contains a ComparablePrincipal y if there is a ComparablePrincipal x in X such that x.IsA(y). From here it follows that every signature set that satisfies X, also satisfies y.

func (ComparablePrincipalSet) IsContainedIn

func (cps ComparablePrincipalSet) IsContainedIn(set ComparablePrincipalSet) bool

IsContainedIn returns whether this ComparablePrincipalSet is contained in the given ComparablePrincipalSet. More formally- a ComparablePrincipalSet X is said to be contained in ComparablePrincipalSet Y if for each ComparablePrincipalSet x in X there is a ComparablePrincipalSet y in Y such that y.IsA(x) is true. If a ComparablePrincipalSet X is contained by a ComparablePrincipalSet Y then if a signature set satisfies Y, it also satisfies X, because for each x in X there is a y in Y such that there exists a signature of a corresponding identity such that the identity satisfies y, and therefore satisfies x too.

func (ComparablePrincipalSet) IsSubset

IsSubset returns whether this ComparablePrincipalSet is a subset of the given ComparablePrincipalSet

func (ComparablePrincipalSet) String

func (cps ComparablePrincipalSet) String() string

String returns a string representation of this ComparablePrincipalSet

func (ComparablePrincipalSet) ToPrincipalSet

func (cps ComparablePrincipalSet) ToPrincipalSet() policies.PrincipalSet

ToPrincipalSet converts this ComparablePrincipalSet to a PrincipalSet

type ComparablePrincipalSets

type ComparablePrincipalSets []ComparablePrincipalSet

ComparablePrincipalSets aggregate ComparablePrincipalSets

func Merge

Merge returns ComparablePrincipalSets that the underlying PrincipalSets consist of PrincipalSets that satisfy the endorsement policies that both ComparablePrincipalSets were derived of. More formally speaking, let EP1 and EP2 be endorsement policies, and P1 and P2 be the principal sets that each principal set p in P1 satisfies EP1, and each principal set p in P2 satisfies EP2. Denote as S1 and S2 the ComparablePrincipalSets derived from EP1 and EP2 respectively. Then, S = Merge(S1, S2) wields ComparablePrincipalSets such that every ComparablePrincipalSet s in S, satisfies both EP1 and EP2.

func (ComparablePrincipalSets) ExcludeIndices

func (cps ComparablePrincipalSets) ExcludeIndices(mapping map[int][]int) ComparablePrincipalSets

ExcludeIndices returns a ComparablePrincipalSets without the given indices found in the keys

func (ComparablePrincipalSets) OfMapping

func (cps ComparablePrincipalSets) OfMapping(mapping map[int][]int, sets2 ComparablePrincipalSets) comparablePrincipalSetPairs

OfMapping returns comparablePrincipalSetPairs comprising only of the indices found in the given keys

func (ComparablePrincipalSets) Reduce

Reduce returns the ComparablePrincipalSets in a form such that no element contains another element. Every element that contains some other element is omitted from the result.

func (ComparablePrincipalSets) ToPrincipalSets

func (cps ComparablePrincipalSets) ToPrincipalSets() policies.PrincipalSets

ToPrincipalSets converts this ComparablePrincipalSets to a PrincipalSets

Jump to

Keyboard shortcuts

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