multisig

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Multisig = "ms"

Multisig is the type of a multisig identity. It is used to identify a multisig identity in a typed identity (identity.TypedIdentity).

Variables

This section is empty.

Functions

func JoinSignatures

func JoinSignatures(identities []token.Identity, sigmas map[string][]byte) ([]byte, error)

JoinSignatures joins the signatures of the given identities into a single signature The order of the signatures is the same as the order of the identities.

func Unwrap

func Unwrap(raw []byte) (bool, []token.Identity, error)

Unwrap returns the identities wrapped in the given multisig identity It returns the identities and a boolean indicating whether the given identity is a multisig identity

func UnwrapAuditInfo

func UnwrapAuditInfo(info []byte) (bool, [][]byte, error)

UnwrapAuditInfo returns the audit infos wrapped in the given multisig audit info. It returns the audit infos and a boolean indicating whether the given info is a multisig audit info.

func WrapAuditInfo

func WrapAuditInfo(recipients [][]byte) ([]byte, error)

WrapAuditInfo wraps the given audit infos into a multisig audit info

func WrapIdentities

func WrapIdentities(ids ...token.Identity) (token.Identity, error)

WrapIdentities wraps the given identities into a multisig identity

Types

type AuditInfo

type AuditInfo struct {
	IdentityAuditInfos []IdentityAuditInfo
}

AuditInfo represents the audit info of a multisig identity. It is a sequence of audit infos from different identities. The order of the audit infos is the same as the order of the identities.

func (*AuditInfo) Bytes

func (ei *AuditInfo) Bytes() ([]byte, error)

func (*AuditInfo) EnrollmentID

func (ei *AuditInfo) EnrollmentID() string

func (*AuditInfo) RevocationHandle

func (ei *AuditInfo) RevocationHandle() string

type AuditInfoDeserializer

type AuditInfoDeserializer struct {
}

func (*AuditInfoDeserializer) DeserializeAuditInfo

func (a *AuditInfoDeserializer) DeserializeAuditInfo(raw []byte) (driver2.AuditInfo, error)

type AuditInfoMatcher

type AuditInfoMatcher interface {
	GetAuditInfoMatcher(owner driver.Identity, auditInfo []byte) (driver.Matcher, error)
}

type IdentityAuditInfo

type IdentityAuditInfo struct {
	AuditInfo []byte
}

IdentityAuditInfo represents the audit info of an identity

type InfoMatcher

type InfoMatcher struct {
	AuditInfoMatcher []driver.Matcher
}

InfoMatcher matches a multisig identity to its own audit info. It is composed of a list of matchers, one for each identity in the multisig identity.

func (*InfoMatcher) Match

func (e *InfoMatcher) Match(raw []byte) error

type MultiIdentity

type MultiIdentity struct {
	Identities []token.Identity
}

func (*MultiIdentity) Bytes

func (m *MultiIdentity) Bytes() ([]byte, error)

func (*MultiIdentity) Deserialize

func (m *MultiIdentity) Deserialize(raw []byte) error

func (*MultiIdentity) Serialize

func (m *MultiIdentity) Serialize() ([]byte, error)

type MultiSignature

type MultiSignature struct {
	Signatures [][]byte
}

MultiSignature represents a multi-signature It is a sequence of signatures from different identities on the same message. The order of the signatures is the same as the order of the identities.

func (*MultiSignature) Bytes

func (m *MultiSignature) Bytes() ([]byte, error)

func (*MultiSignature) FromBytes

func (m *MultiSignature) FromBytes(raw []byte) error

type TypedIdentityDeserializer

type TypedIdentityDeserializer struct {
	VerifierDeserializer VerifierDES
	AuditInfoMatcher     AuditInfoMatcher
}

func NewTypedIdentityDeserializer

func NewTypedIdentityDeserializer(verifierDeserializer VerifierDES, auditInfoDeserializer AuditInfoMatcher) *TypedIdentityDeserializer

func (*TypedIdentityDeserializer) DeserializeVerifier

func (d *TypedIdentityDeserializer) DeserializeVerifier(typ identity.Type, id []byte) (driver.Verifier, error)

func (*TypedIdentityDeserializer) GetAuditInfo

func (d *TypedIdentityDeserializer) GetAuditInfo(ctx context.Context, id driver.Identity, typ identity.Type, rawIdentity []byte, p driver.AuditInfoProvider) ([]byte, error)

func (*TypedIdentityDeserializer) GetAuditInfoMatcher

func (d *TypedIdentityDeserializer) GetAuditInfoMatcher(owner driver.Identity, auditInfo []byte) (driver.Matcher, error)

func (*TypedIdentityDeserializer) Recipients

func (d *TypedIdentityDeserializer) Recipients(id driver.Identity, typ identity.Type, raw []byte) ([]driver.Identity, error)

type Verifier

type Verifier struct {
	Verifiers []driver.Verifier
}

Verifier is a multi-signature verifier that verifies a multi-signature. It is composed of a list of verifiers, one for each identity that signed the message. The order of the verifiers is the same as the order of the identities.

func (*Verifier) Verify

func (v *Verifier) Verify(msg, raw []byte) error

type VerifierDES

type VerifierDES interface {
	DeserializeVerifier(id driver.Identity) (driver.Verifier, error)
}

Jump to

Keyboard shortcuts

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