Documentation
¶
Index ¶
- Constants
- func TypeToString(t driver.IdentityType) string
- type Deserializer
- type EnrollmentIDUnmarshaler
- type Identity
- type NetworkBinderService
- type Provider
- func (p *Provider) AreMe(ctx context.Context, identities ...driver.Identity) []string
- func (p *Provider) Bind(ctx context.Context, longTerm driver.Identity, ...) error
- func (p *Provider) GetAuditInfo(ctx context.Context, identity driver.Identity) ([]byte, error)
- func (p *Provider) GetEIDAndRH(ctx context.Context, identity driver.Identity, auditInfo []byte) (string, string, error)
- func (p *Provider) GetEnrollmentID(ctx context.Context, identity driver.Identity, auditInfo []byte) (string, error)
- func (p *Provider) GetRevocationHandler(ctx context.Context, identity driver.Identity, auditInfo []byte) (string, error)
- func (p *Provider) GetSigner(ctx context.Context, identity driver.Identity) (driver.Signer, error)
- func (p *Provider) IsMe(ctx context.Context, identity driver.Identity) bool
- func (p *Provider) RegisterIdentityDescriptor(ctx context.Context, identityDescriptor *idriver.IdentityDescriptor, ...) error
- func (p *Provider) RegisterRecipientData(ctx context.Context, data *driver.RecipientData) error
- func (p *Provider) RegisterRecipientIdentity(ctx context.Context, id driver.Identity) error
- func (p *Provider) RegisterSigner(ctx context.Context, identity driver.Identity, signer driver.Signer, ...) error
- func (p *Provider) RollbackPartialRecipientRegistration(ctx context.Context, id driver.Identity)
- type RecipientRegistrationRollback
- type RoleType
- type SignerEntry
- type Storage
- type StorageProvider
- type Type
- type TypedIdentity
Constants ¶
const ( // IssuerRole is the role of an issuer IssuerRole RoleType = driver.IssuerRole // AuditorRole is the role of an auditor AuditorRole = driver.AuditorRole // OwnerRole is the role of an owner OwnerRole = driver.OwnerRole // CertifierRole is the role of a certifier CertifierRole = driver.CertifierRole )
Variables ¶
This section is empty.
Functions ¶
func TypeToString ¶
func TypeToString(t driver.IdentityType) string
TypeToString return a string identifier for the given identity type. If the type is unknown, it returns the string "Type (<t>)".
Types ¶
type Deserializer ¶
type EnrollmentIDUnmarshaler ¶
type EnrollmentIDUnmarshaler interface {
// GetEnrollmentID returns the enrollment ID from the audit info
GetEnrollmentID(ctx context.Context, identity driver.Identity, auditInfo []byte) (string, error)
// GetRevocationHandler returns the revocation handle from the audit info
GetRevocationHandler(ctx context.Context, identity driver.Identity, auditInfo []byte) (string, error)
// GetEIDAndRH returns both enrollment ID and revocation handle
GetEIDAndRH(ctx context.Context, identity driver.Identity, auditInfo []byte) (string, string, error)
}
EnrollmentIDUnmarshaler decodes an enrollment ID form an audit info
type NetworkBinderService ¶
type Provider ¶
type Provider struct {
Logger logging.Logger
Binder NetworkBinderService
// contains filtered or unexported fields
}
Provider implements the driver.IdentityProvider interface. Provider manages identity-related concepts like signature signers, verifiers, audit information, and so on.
func NewProvider ¶
func NewProvider( logger logging.Logger, storage Storage, deserializer Deserializer, binder NetworkBinderService, enrollmentIDUnmarshaler EnrollmentIDUnmarshaler, ) *Provider
NewProvider returns a new instance of Provider
func (*Provider) AreMe ¶
AreMe returns the hashes of the passed identities that have a signer registered before. Each identity is resolved via the signer cache and configured storage. There is no secondary "is me" cache: a real cache would need careful handling for single-use identities (for example Idemix nyms) and is intentionally omitted here.
func (*Provider) Bind ¶
func (p *Provider) Bind(ctx context.Context, longTerm driver.Identity, ephemeralIdentities ...driver.Identity) error
Bind binds longTerm to the passed ephemeral identities.
func (*Provider) GetAuditInfo ¶
GetAuditInfo returns the audit information associated to the passed identity, nil otherwise. The audit info is retrieved from the configured storage.
func (*Provider) GetEIDAndRH ¶
func (p *Provider) GetEIDAndRH(ctx context.Context, identity driver.Identity, auditInfo []byte) (string, string, error)
GetEIDAndRH returns both enrollment ID and revocation handle
func (*Provider) GetEnrollmentID ¶
func (p *Provider) GetEnrollmentID(ctx context.Context, identity driver.Identity, auditInfo []byte) (string, error)
GetEnrollmentID extracts the enrollment ID from the passed audit info
func (*Provider) GetRevocationHandler ¶
func (p *Provider) GetRevocationHandler(ctx context.Context, identity driver.Identity, auditInfo []byte) (string, error)
GetRevocationHandler extracts the revocation handler from the passed audit info
func (*Provider) GetSigner ¶
GetSigner returns a Signer for passed identity. If a signer cannot be retrieved an error is returned. Signers that can be reused are cached. If a signer is not found in cache, this provider tries to construct an instance of driver.Signer that produces valid signatures under that identity.
func (*Provider) RegisterIdentityDescriptor ¶
func (p *Provider) RegisterIdentityDescriptor(ctx context.Context, identityDescriptor *idriver.IdentityDescriptor, alias driver.Identity) error
RegisterIdentityDescriptor stores the given identity descriptor in the configured storage. If alias is not nil, the alias can be used as an alternative to `idriver.IdentityDescriptor#Identity`.
func (*Provider) RegisterRecipientData ¶
RegisterRecipientData stores the passed recipient data in the configured storage.
func (*Provider) RegisterRecipientIdentity ¶
RegisterRecipientIdentity registers the passed identity as a third-party recipient identity. The wallet layer performs matching and persistence; this provider records nothing here.
func (*Provider) RegisterSigner ¶
func (p *Provider) RegisterSigner(ctx context.Context, identity driver.Identity, signer driver.Signer, verifier driver.Verifier, signerInfo []byte, ephemeral bool) error
RegisterSigner registers a Signer and a Verifier for passed identity. This is implemented via an invocation of RegisterIdentityDescriptor using an IdentityDescriptor with empty AuditInfo. The audit info might or might not be already stored.
func (*Provider) RollbackPartialRecipientRegistration ¶
RollbackPartialRecipientRegistration implements RecipientRegistrationRollback. This provider does not keep partial recipient-registration marks in memory; the hook remains for other IdentityProvider implementations.
type RecipientRegistrationRollback ¶
type RecipientRegistrationRollback interface {
RollbackPartialRecipientRegistration(ctx context.Context, id driver.Identity)
}
RecipientRegistrationRollback is implemented by identity providers that record side effects in RegisterRecipientIdentity before RegisterRecipientData. If RegisterRecipientData never succeeds, the implementation should undo those effects so the node is not left in a half-registered state.
type SignerEntry ¶
type Storage ¶
type Storage interface {
GetAuditInfo(ctx context.Context, id []byte) ([]byte, error)
StoreIdentityData(ctx context.Context, id []byte, identityAudit []byte, tokenMetadata []byte, tokenMetadataAudit []byte) error
StoreSignerInfo(ctx context.Context, id driver.Identity, info []byte) error
GetExistingSignerInfo(ctx context.Context, ids ...driver.Identity) ([]string, error)
SignerInfoExists(ctx context.Context, id []byte) (bool, error)
GetSignerInfo(ctx context.Context, identity []byte) ([]byte, error)
RegisterIdentityDescriptor(ctx context.Context, descriptor *idriver.IdentityDescriptor, alias driver.Identity) error
}
type StorageProvider ¶
type StorageProvider = idriver.StorageProvider
StorageProvider returns storage services scoped to a specific token management system (TMS) identified by token.TMSID. Callers request the concrete store service for the given TMS and use the returned service to access persisted wallet, identity, or keystore data.
type Type ¶
type Type = driver.IdentityType
type TypedIdentity ¶
type TypedIdentity struct {
// Type encodes the type of the identity
Type Type `json:"type,omitempty" protobuf:"bytes,1,opt,name=type,json=type,proto3"`
// Identity encodes the identity itself
Identity Identity `json:"identity,omitempty" protobuf:"bytes,2,opt,name=identity,proto3"`
}
TypedIdentity encodes an identity with a type.
func UnmarshalTypedIdentity ¶
func UnmarshalTypedIdentity(id Identity) (*TypedIdentity, error)
func (TypedIdentity) Bytes ¶
func (i TypedIdentity) Bytes() ([]byte, error)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package boolpolicy provides an identity type whose ownership is governed by a boolean expression over a set of component identities.
|
Package boolpolicy provides an identity type whose ownership is governed by a boolean expression over a set of component identities. |
|
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
interop
|
|
|
htlc/mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
crypto/mocks
Code generated by counterfeiter.
|
Code generated by counterfeiter. |