Documentation
¶
Overview ¶
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Index ¶
- func NewDeserializer(pp *crypto.PublicParams) (*deserializer, error)
- func NewEnrollmentIDDeserializer() *enrollmentService
- type AuditDES
- type DeserializerProvider
- type DeserializerProviderFunc
- type KVS
- type PublicParametersManager
- type QueryEngine
- type Service
- func (s *Service) AuditorCheck(tokenRequest *driver.TokenRequest, ...) error
- func (s *Service) AuditorWallet(id string) driver.AuditorWallet
- func (s *Service) AuditorWalletByIdentity(id view.Identity) driver.AuditorWallet
- func (s *Service) CertifierWallet(id string) driver.CertifierWallet
- func (s *Service) CertifierWalletByIdentity(id view.Identity) driver.CertifierWallet
- func (s *Service) Certify(wallet driver.CertifierWallet, ids []*token.ID, tokens [][]byte, ...) ([][]byte, error)
- func (s *Service) ConfigManager() config.Manager
- func (s *Service) DeserializeIssueAction(raw []byte) (driver.IssueAction, error)
- func (s *Service) DeserializeToken(tok []byte, infoRaw []byte) (*token3.Token, view.Identity, error)
- func (s *Service) DeserializeTransferAction(raw []byte) (driver.TransferAction, error)
- func (s *Service) Deserializer() (driver.Deserializer, error)
- func (s *Service) FetchPublicParams() error
- func (s *Service) GetAuditInfo(id view.Identity) ([]byte, error)
- func (s *Service) GetAuditorVerifier(id view.Identity) (driver.Verifier, error)
- func (s *Service) GetEnrollmentID(auditInfo []byte) (string, error)
- func (s *Service) GetIssuerVerifier(id view.Identity) (driver.Verifier, error)
- func (s *Service) GetOwnerMatcher(raw []byte) (driver.Matcher, error)
- func (s *Service) GetOwnerVerifier(id view.Identity) (driver.Verifier, error)
- func (s *Service) IdentityProvider() driver.IdentityProvider
- func (s *Service) Issue(issuerIdentity view.Identity, typ string, values []uint64, owners [][]byte, ...) (driver.IssueAction, [][]byte, view.Identity, error)
- func (s *Service) IssuerWallet(id string) driver.IssuerWallet
- func (s *Service) IssuerWalletByIdentity(id view.Identity) driver.IssuerWallet
- func (s *Service) MarshalTokenRequestToSign(request *driver.TokenRequest, meta *driver.TokenRequestMetadata) ([]byte, error)
- func (s *Service) NewCertificationRequest(ids []*token.ID) ([]byte, error)
- func (s *Service) OwnerWallet(walletID string) driver.OwnerWallet
- func (s *Service) OwnerWalletByID(id interface{}) driver.OwnerWallet
- func (s *Service) OwnerWalletByIdentity(identity view.Identity) driver.OwnerWallet
- func (s *Service) PublicParams() *crypto.PublicParams
- func (s *Service) PublicParamsManager() driver.PublicParamsManager
- func (s *Service) RegisterIssuerWallet(id string, path string) error
- func (s *Service) RegisterOwnerWallet(id string, path string) error
- func (s *Service) RegisterRecipientIdentity(id view.Identity, auditInfo []byte, metadata []byte) error
- func (s *Service) SpentIDs(ids ...*token.ID) ([]string, error)
- func (s *Service) Transfer(txID string, wallet driver.OwnerWallet, ids []*token3.ID, ...) (driver.TransferAction, *driver.TransferMetadata, error)
- func (s *Service) Validator() driver.Validator
- func (s *Service) VerifyCertifications(ids []*token.ID, certifications [][]byte) error
- func (s *Service) VerifyIssue(ia driver.IssueAction, outputsMetadata [][]byte) error
- func (s *Service) VerifyTransfer(action driver.TransferAction, outputsMetadata [][]byte) error
- func (s *Service) Wallet(identity view.Identity) driver.Wallet
- type SigningIdentity
- type TokenCommitmentLoader
- type TokenLoader
- type TokenVault
- type VaultPublicParamsLoader
- type VaultTokenCommitmentLoader
- type VaultTokenLoader
- type VerifierDES
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDeserializer ¶
func NewDeserializer(pp *crypto.PublicParams) (*deserializer, error)
NewDeserializer returns a deserializer
func NewEnrollmentIDDeserializer ¶
func NewEnrollmentIDDeserializer() *enrollmentService
NewEnrollmentIDDeserializer returns an enrollmentService
Types ¶
type AuditDES ¶
AuditDES deserializes raw bytes into a matcher, which allows an auditor to match an identity to an enrollment ID
type DeserializerProvider ¶
type DeserializerProvider struct {
// contains filtered or unexported fields
}
DeserializerProvider provides the deserializer matching zkatdlog public parameters
func NewDeserializerProvider ¶
func NewDeserializerProvider() *DeserializerProvider
NewDeserializerProvider returns a DeserializerProvider
func (*DeserializerProvider) Deserialize ¶
func (d *DeserializerProvider) Deserialize(params *crypto.PublicParams) (driver.Deserializer, error)
Deserialize returns the deserializer matching the passed public parameters
type DeserializerProviderFunc ¶
type DeserializerProviderFunc = func(params *crypto.PublicParams) (driver.Deserializer, error)
type PublicParametersManager ¶
type PublicParametersManager interface { driver.PublicParamsManager PublicParams() *crypto.PublicParams }
type QueryEngine ¶
type QueryEngine interface { IsMine(id *token3.ID) (bool, error) // UnspentTokensIteratorBy returns an iterator of unspent tokens owned by the passed id and whose type is the passed on. // The token type can be empty. In that case, tokens of any type are returned. UnspentTokensIteratorBy(id, tokenType string) (driver.UnspentTokensIterator, error) ListAuditTokens(ids ...*token3.ID) ([]*token3.Token, error) ListHistoryIssuedTokens() (*token3.IssuedTokens, error) }
type Service ¶
type Service struct { SP view2.ServiceProvider TMSID token2.TMSID PP *crypto.PublicParams PPM PublicParametersManager PPLabel string PublicParamsFetcher driver.PublicParamsFetcher TokenLoader TokenLoader TokenCommitmentLoader TokenCommitmentLoader QE QueryEngine DeserializerProvider DeserializerProviderFunc OwnerWalletsRegistry *identity.WalletsRegistry IssuerWalletsRegistry *identity.WalletsRegistry AuditorWalletsRegistry *identity.WalletsRegistry // contains filtered or unexported fields }
func NewTokenService ¶
func NewTokenService( sp view2.ServiceProvider, tmsID token2.TMSID, PPM PublicParametersManager, tokenLoader TokenLoader, tokenCommitmentLoader TokenCommitmentLoader, queryEngine QueryEngine, identityProvider driver.IdentityProvider, deserializerProvider DeserializerProviderFunc, ppLabel string, configManager config.Manager, kvs KVS, ) (*Service, error)
func (*Service) AuditorCheck ¶
func (s *Service) AuditorCheck(tokenRequest *driver.TokenRequest, tokenRequestMetadata *driver.TokenRequestMetadata, txID string) error
AuditorCheck verifies if the passed tokenRequest matches the tokenRequestMetadata
func (*Service) AuditorWallet ¶
func (s *Service) AuditorWallet(id string) driver.AuditorWallet
func (*Service) AuditorWalletByIdentity ¶
func (s *Service) AuditorWalletByIdentity(id view.Identity) driver.AuditorWallet
func (*Service) CertifierWallet ¶
func (s *Service) CertifierWallet(id string) driver.CertifierWallet
func (*Service) CertifierWalletByIdentity ¶
func (s *Service) CertifierWalletByIdentity(id view.Identity) driver.CertifierWallet
func (*Service) Certify ¶
func (s *Service) Certify(wallet driver.CertifierWallet, ids []*token.ID, tokens [][]byte, request []byte) ([][]byte, error)
Certify returns an array of serialized certifications, such that the i^th certification asserts that the i^th passed token corresponds to the token associated with the i^th passed identifier zkatdlog does not make use of the certification service
func (*Service) ConfigManager ¶
ConfigManager returns the configuration manager associated with the service
func (*Service) DeserializeIssueAction ¶
func (s *Service) DeserializeIssueAction(raw []byte) (driver.IssueAction, error)
DeserializeIssueAction un-marshals raw bytes into a zkatdlog IssueAction
func (*Service) DeserializeToken ¶
func (s *Service) DeserializeToken(tok []byte, infoRaw []byte) (*token3.Token, view.Identity, error)
DeserializeToken un-marshals a token and token info from raw bytes It checks if the un-marshalled token matches the token info. If not, it returns an error. Else it returns the token in cleartext and the identity of its issuer
func (*Service) DeserializeTransferAction ¶
func (s *Service) DeserializeTransferAction(raw []byte) (driver.TransferAction, error)
DeserializeTransferAction un-marshals a TransferAction from the passed array of bytes. DeserializeTransferAction returns an error, if the un-marshalling fails.
func (*Service) Deserializer ¶
func (s *Service) Deserializer() (driver.Deserializer, error)
func (*Service) FetchPublicParams ¶
func (*Service) GetAuditorVerifier ¶
GetAuditorVerifier deserializes the verifier for the passed auditor identity
func (*Service) GetEnrollmentID ¶
func (*Service) GetIssuerVerifier ¶
GetIssuerVerifier deserializes the verifier for the passed issuer identity
func (*Service) GetOwnerMatcher ¶
GetOwnerMatcher deserializes the passed bytes into a Matcher The Matcher can be used later to match an identity to its audit information
func (*Service) GetOwnerVerifier ¶
GetOwnerVerifier deserializes the verifier for the passed owner identity
func (*Service) IdentityProvider ¶
func (s *Service) IdentityProvider() driver.IdentityProvider
IdentityProvider returns the identity provider associated with the service
func (*Service) Issue ¶
func (s *Service) Issue(issuerIdentity view.Identity, typ string, values []uint64, owners [][]byte, opts *driver.IssueOptions) (driver.IssueAction, [][]byte, view.Identity, error)
Issue returns an IssueAction as a function of the passed arguments Issue also returns a serialization TokenInformation associated with issued tokens and the identity of the issuer
func (*Service) IssuerWallet ¶
func (s *Service) IssuerWallet(id string) driver.IssuerWallet
func (*Service) IssuerWalletByIdentity ¶
func (s *Service) IssuerWalletByIdentity(id view.Identity) driver.IssuerWallet
func (*Service) MarshalTokenRequestToSign ¶
func (s *Service) MarshalTokenRequestToSign(request *driver.TokenRequest, meta *driver.TokenRequestMetadata) ([]byte, error)
func (*Service) NewCertificationRequest ¶
NewCertificationRequest creates a request to certify the tokens identified by the passed identifiers zkatdlog does not make use of the certification service
func (*Service) OwnerWallet ¶
func (s *Service) OwnerWallet(walletID string) driver.OwnerWallet
func (*Service) OwnerWalletByID ¶
func (s *Service) OwnerWalletByID(id interface{}) driver.OwnerWallet
func (*Service) OwnerWalletByIdentity ¶
func (s *Service) OwnerWalletByIdentity(identity view.Identity) driver.OwnerWallet
func (*Service) PublicParams ¶
func (s *Service) PublicParams() *crypto.PublicParams
PublicParams returns the public parameters associated with the service
func (*Service) PublicParamsManager ¶
func (s *Service) PublicParamsManager() driver.PublicParamsManager
PublicParamsManager returns the manager of the public parameters associated with the service
func (*Service) RegisterIssuerWallet ¶
func (*Service) RegisterOwnerWallet ¶
func (*Service) RegisterRecipientIdentity ¶
func (*Service) Transfer ¶
func (s *Service) Transfer(txID string, wallet driver.OwnerWallet, ids []*token3.ID, outputTokens []*token3.Token, opts *driver.TransferOptions) (driver.TransferAction, *driver.TransferMetadata, error)
Transfer returns a TransferAction as a function of the passed arguments It also returns the corresponding TransferMetadata
func (*Service) VerifyCertifications ¶
VerifyCertifications checks if the passed certifications are valid with respect to the tokens associated with the passed identifiers If not, VerifyCertifications returns an error zkatdlog does not make use of the certification service
func (*Service) VerifyIssue ¶
func (s *Service) VerifyIssue(ia driver.IssueAction, outputsMetadata [][]byte) error
VerifyIssue checks if the outputs of an IssueAction match the passed metadata
func (*Service) VerifyTransfer ¶
func (s *Service) VerifyTransfer(action driver.TransferAction, outputsMetadata [][]byte) error
VerifyTransfer checks the outputs in the TransferAction against the passed metadata
type SigningIdentity ¶
type SigningIdentity interface { driver.SigningIdentity }
type TokenCommitmentLoader ¶
type TokenLoader ¶
type TokenVault ¶
type VaultPublicParamsLoader ¶
type VaultPublicParamsLoader struct { PublicParamsFetcher driver.PublicParamsFetcher PPLabel string }
func NewVaultPublicParamsLoader ¶
func NewVaultPublicParamsLoader(publicParamsFetcher driver.PublicParamsFetcher, PPLabel string) *VaultPublicParamsLoader
func (*VaultPublicParamsLoader) Fetch ¶
func (s *VaultPublicParamsLoader) Fetch() ([]byte, error)
Fetch fetches the public parameters from the backend
func (*VaultPublicParamsLoader) FetchParams ¶
func (s *VaultPublicParamsLoader) FetchParams() (*crypto.PublicParams, error)
FetchParams fetches the public parameters from the backend and unmarshal them
type VaultTokenCommitmentLoader ¶
type VaultTokenCommitmentLoader struct {
TokenVault TokenVault
}
func (*VaultTokenCommitmentLoader) GetTokenCommitments ¶
GetTokenCommitments takes an array of token identifiers (txID, index) and returns the corresponding tokens
type VaultTokenLoader ¶
type VaultTokenLoader struct {
TokenVault TokenVault
}
func (*VaultTokenLoader) LoadTokens ¶
func (s *VaultTokenLoader) LoadTokens(ids []*token3.ID) ([]string, []*token.Token, []*token.Metadata, []view.Identity, error)
LoadTokens takes an array of token identifiers (txID, index) and returns the keys in the vault matching the token identifiers, the corresponding zkatdlog tokens, the information of the tokens in clear text and the identities of their owners LoadToken returns an error in case of failure