Documentation
¶
Index ¶
- Constants
- type AuditInfoDeserializer
- type Deserializer
- func NewDeserializer(ipk []byte, curveID math.CurveID) (*Deserializer, error)
- func NewDeserializerWithBCCSP(sm SchemaManager, schema Schema, ipk []byte, verType csp.VerificationType, ...) (*Deserializer, error)
- func NewDeserializerWithProvider(sm SchemaManager, schema Schema, ipk []byte, verType csp.VerificationType, ...) (*Deserializer, error)
- func (d *Deserializer) DeserializeAuditInfo(ctx context.Context, identity driver.Identity, raw []byte) (driver2.AuditInfo, error)
- func (d *Deserializer) DeserializeVerifier(ctx context.Context, id driver.Identity) (driver.Verifier, error)
- func (d *Deserializer) DeserializeVerifierAgainstNymEID(raw []byte, nymEID []byte) (driver.Verifier, error)
- func (d *Deserializer) GetAuditInfoMatcher(ctx context.Context, owner driver.Identity, auditInfo []byte) (driver.Matcher, error)
- func (d *Deserializer) Info(ctx context.Context, id []byte, auditInfoRaw []byte) (string, error)
- func (d *Deserializer) MatchIdentity(ctx context.Context, id driver.Identity, ai []byte) error
- func (d *Deserializer) String() string
- type KeyManager
- func (p *KeyManager) Anonymous() bool
- func (p *KeyManager) DeserializeSigner(ctx context.Context, raw []byte) (tdriver.Signer, error)
- func (p *KeyManager) DeserializeSigningIdentity(ctx context.Context, raw []byte) (tdriver.SigningIdentity, error)
- func (p *KeyManager) DeserializeVerifier(ctx context.Context, raw []byte) (tdriver.Verifier, error)
- func (p *KeyManager) EnrollmentID() string
- func (p *KeyManager) Identity(ctx context.Context, auditInfo []byte) (*idriver.IdentityDescriptor, error)
- func (p *KeyManager) IdentityType() idriver.IdentityType
- func (p *KeyManager) Info(ctx context.Context, raw []byte, auditInfo []byte) (string, error)
- func (p *KeyManager) IsRemote() bool
- func (p *KeyManager) String() string
- type KeyManagerProvider
- type NewKeyManagerFunc
- type SKI
- type SKIProvider
- type Schema
- type SchemaManager
- type SignerService
- type WrappedKeyManager
Constants ¶
const ( Any bccsp.SignatureType = 100 IdentityType = tdriver.IdemixIdentityType IdentityTypeString = tdriver.IdemixIdentityTypeString )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditInfoDeserializer ¶
type AuditInfoDeserializer struct{}
type Deserializer ¶
type Deserializer struct {
*crypto2.Deserializer
}
func NewDeserializer ¶
func NewDeserializer( ipk []byte, curveID math.CurveID, ) (*Deserializer, error)
NewDeserializer returns a new deserializer for the idemix ExpectEidNymRhNym verification strategy
func NewDeserializerWithBCCSP ¶
func NewDeserializerWithBCCSP( sm SchemaManager, schema Schema, ipk []byte, verType csp.VerificationType, nymEID []byte, cryptoProvider csp.BCCSP, ) (*Deserializer, error)
NewDeserializerWithBCCSP returns a new deserializer for the passed arguments given a crypto provider
func NewDeserializerWithProvider ¶
func NewDeserializerWithProvider( sm SchemaManager, schema Schema, ipk []byte, verType csp.VerificationType, nymEID []byte, cryptoProvider csp.BCCSP, ) (*Deserializer, error)
NewDeserializerWithProvider returns a new deserializer for the passed arguments
func (*Deserializer) DeserializeAuditInfo ¶
func (d *Deserializer) DeserializeAuditInfo(ctx context.Context, identity driver.Identity, raw []byte) (driver2.AuditInfo, error)
DeserializeAuditInfo deserializes a given raw AuditInfo into an AuditInfo
func (*Deserializer) DeserializeVerifier ¶
func (d *Deserializer) DeserializeVerifier(ctx context.Context, id driver.Identity) (driver.Verifier, error)
DeserializeVerifier deserializes a given raw id into a new psudonym signature verifier with id's PK
func (*Deserializer) DeserializeVerifierAgainstNymEID ¶
func (d *Deserializer) DeserializeVerifierAgainstNymEID(raw []byte, nymEID []byte) (driver.Verifier, error)
DeserializeVerifierAgainstNymEID deserializes a given raw id and create a new psudonym signature verifier with id's PK
func (*Deserializer) GetAuditInfoMatcher ¶
func (d *Deserializer) GetAuditInfoMatcher(ctx context.Context, owner driver.Identity, auditInfo []byte) (driver.Matcher, error)
GetAuditInfoMatcher deserializes a given raw AuditInfo into a Matcher
func (*Deserializer) Info ¶
Info returns a string that includes the given identity. If AuditInfo is also provided then the id is cryptographically verified against it and the Enrollment ID (EID) is extracted from the audit info and is printed as well.
func (*Deserializer) MatchIdentity ¶
MatchIdentity deserializes the provided audit information (ai) and verify it matches the given identity (id) by verifying the related ZK proofs
func (*Deserializer) String ¶
func (d *Deserializer) String() string
String returns the Issuer-PK as a string
type KeyManager ¶
type KeyManager struct {
*crypto.Deserializer
SchemaManager SchemaManager
Schema string
// contains filtered or unexported fields
}
KeyManager manages Idemix keys and deserializers
func NewKeyManager ¶
func NewKeyManager( conf *crypto.Config, sigType bccsp.SignatureType, csp bccsp.BCCSP, ) (*KeyManager, error)
NewKeyManager creates a new KeyManager
func NewKeyManagerWithSchema ¶
func NewKeyManagerWithSchema( conf *crypto.Config, sigType bccsp.SignatureType, csp bccsp.BCCSP, sm SchemaManager, schemaName string, ) (*KeyManager, error)
NewKeyManagerWithSchema creates a new KeyManager with the passed schema manager and schema name
func (*KeyManager) Anonymous ¶
func (p *KeyManager) Anonymous() bool
Anonymous returns true if the identity is anonymous
func (*KeyManager) DeserializeSigner ¶
DeserializeSigner deserializes a signer from the given raw bytes
func (*KeyManager) DeserializeSigningIdentity ¶
func (p *KeyManager) DeserializeSigningIdentity(ctx context.Context, raw []byte) (tdriver.SigningIdentity, error)
DeserializeSigningIdentity deserializes a signing identity from the given raw bytes
func (*KeyManager) DeserializeVerifier ¶
DeserializeVerifier deserializes a verifier from the given raw bytes
func (*KeyManager) EnrollmentID ¶
func (p *KeyManager) EnrollmentID() string
EnrollmentID returns the enrollment ID
func (*KeyManager) Identity ¶
func (p *KeyManager) Identity(ctx context.Context, auditInfo []byte) (*idriver.IdentityDescriptor, error)
Identity returns the identity descriptor for the given audit information
func (*KeyManager) IdentityType ¶
func (p *KeyManager) IdentityType() idriver.IdentityType
IdentityType returns the type of the identity
func (*KeyManager) Info ¶
Info returns a string that includes the given identity. If AuditInfo is also provided then the id is cryptographically verified against it and the Enrollment ID (EID) is extracted from the audit info and is printed as well.
func (*KeyManager) IsRemote ¶
func (p *KeyManager) IsRemote() bool
IsRemote returns true if the user key is not available locally
func (*KeyManager) String ¶
func (p *KeyManager) String() string
String returns a string representation of the KeyManager including the issuer PK
type KeyManagerProvider ¶
type KeyManagerProvider struct {
// contains filtered or unexported fields
}
func NewKeyManagerProvider ¶
func (*KeyManagerProvider) Get ¶
func (l *KeyManagerProvider) Get(ctx context.Context, identityConfig *driver.IdentityConfiguration) (membership.KeyManager, error)
type NewKeyManagerFunc ¶
type NewKeyManagerFunc = func( conf *crypto2.Config, sigType bccsp.SignatureType, csp bccsp.BCCSP, ) (membership.KeyManager, error)
type SKIProvider ¶
type SKIProvider struct{}
SKIProvider implements the TypedSKIProvider interface for Idemix identities. It extracts the Subject Key Identifier (SKI) from Idemix identities by computing the SHA-256 hash of the pseudonym public key (NymPublicKey) contained within the serialized identity.
This provider is designed to be registered with the cleanup.SKIExtractor for identity type "idemix" to enable proper SKI extraction during keystore cleanup.
func NewSKIProvider ¶
func NewSKIProvider() *SKIProvider
NewSKIProvider creates a new Idemix SKI provider
func (*SKIProvider) GetSKIsFromIdentity ¶
GetSKIsFromIdentity extracts the SKI from an Idemix identity. It uses the existing SKIFromIdentity function to compute the SHA-256 hash of the NymPublicKey and returns it as a hexadecimal string.
Parameters:
- ctx: Context for cancellation and tracing (currently unused but required by interface)
- identity: Raw bytes of the serialized Idemix identity
Returns:
- []string: A single-element slice containing the SKI in hexadecimal format
- error: An error if the identity cannot be parsed or is invalid
The function returns (nil, nil) for empty identities to allow graceful handling.
type SchemaManager ¶
type SchemaManager interface {
// PublicKeyImportOpts returns the options that `schema` uses to import its public keys
PublicKeyImportOpts(schema string) (*bccsp.IdemixIssuerPublicKeyImportOpts, error)
// SignerOpts returns the options for the passed arguments
SignerOpts(schema string) (*bccsp.IdemixSignerOpts, error)
// NymSignerOpts returns the options that `schema` uses to verify a nym signature
NymSignerOpts(schema string) (*bccsp.IdemixNymSignerOpts, error)
// EidNymAuditOpts returns the options that `sid` must use to audit an EIDNym
EidNymAuditOpts(schema string, attrs [][]byte) (*bccsp.EidNymAuditOpts, error)
// RhNymAuditOpts returns the options that `sid` must use to audit an RhNym
RhNymAuditOpts(schema string, attrs [][]byte) (*bccsp.RhNymAuditOpts, error)
}
SchemaManager handles the various credential schemas. A credential schema contains information about the number of attributes, which attributes must be disclosed when creating proofs, the format of the attributes etc.
type SignerService ¶
type SignerService interface {
RegisterSigner(ctx context.Context, identity tdriver.Identity, signer tdriver.Signer, verifier tdriver.Verifier, info []byte) error
}
SignerService defines the interface for registering a signer
type WrappedKeyManager ¶
type WrappedKeyManager struct {
membership.KeyManager
// contains filtered or unexported fields
}
func (*WrappedKeyManager) Identity ¶
func (k *WrappedKeyManager) Identity(ctx context.Context, auditInfo []byte) (*idriver.IdentityDescriptor, error)