Documentation ¶
Overview ¶
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Index ¶
- func UnmarshalCommand(raw []byte) (*token.Command, error)
- type Issuer
- type Marshaler
- type PolicyBasedAccessControl
- type PolicyChecker
- type Prover
- func (s *Prover) MarshalErrorResponse(command []byte, e error) (*token.SignedCommandResponse, error)
- func (s *Prover) ProcessCommand(ctx context.Context, sc *token.SignedCommand) (*token.SignedCommandResponse, error)
- func (s *Prover) RequestImport(ctx context.Context, header *token.Header, requestImport *token.ImportRequest) (*token.CommandResponse_TokenTransaction, error)
- func (s *Prover) ValidateHeader(header *token.Header) error
- type ResponseMarshaler
- type SignedDataPolicyChecker
- type Signer
- type SignerIdentity
- type TMSManager
- type TimeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Issuer ¶
type Issuer interface { // Issue creates an import request transaction. RequestImport(tokensToIssue []*token.TokenToIssue) (*token.TokenTransaction, error) }
An Issuer creates token import requests.
type Marshaler ¶
type Marshaler interface {
MarshalCommandResponse(command []byte, responsePayload interface{}) (*token.SignedCommandResponse, error)
}
A Marshaler is responsible for marshaling and signging command responses.
type PolicyBasedAccessControl ¶
type PolicyBasedAccessControl struct {
SignedDataPolicyChecker SignedDataPolicyChecker
}
PolicyBasedAccessControl implements token command access control functions.
func (*PolicyBasedAccessControl) Check ¶
func (ac *PolicyBasedAccessControl) Check(sc *token.SignedCommand, c *token.Command) error
type PolicyChecker ¶
type PolicyChecker interface {
Check(sc *token.SignedCommand, c *token.Command) error
}
A PolicyChecker is responsible for performing policy based access control checks related to token commands.
type Prover ¶
type Prover struct { Marshaler Marshaler PolicyChecker PolicyChecker TMSManager TMSManager }
A Provider is responslble for processing token commands.
func (*Prover) MarshalErrorResponse ¶
func (*Prover) ProcessCommand ¶
func (s *Prover) ProcessCommand(ctx context.Context, sc *token.SignedCommand) (*token.SignedCommandResponse, error)
func (*Prover) RequestImport ¶
func (s *Prover) RequestImport(ctx context.Context, header *token.Header, requestImport *token.ImportRequest) (*token.CommandResponse_TokenTransaction, error)
type ResponseMarshaler ¶
ResponseMarshaler produces token.SignedCommandResponse
func NewResponseMarshaler ¶
func NewResponseMarshaler(signerID SignerIdentity) (*ResponseMarshaler, error)
func (*ResponseMarshaler) MarshalCommandResponse ¶
func (s *ResponseMarshaler) MarshalCommandResponse(command []byte, responsePayload interface{}) (*token.SignedCommandResponse, error)
type SignedDataPolicyChecker ¶
type SignedDataPolicyChecker interface { // CheckPolicyBySignedData checks that the provided signed data is valid with respect to // specified policy for the specified channel. CheckPolicyBySignedData(channelID, policyName string, sd []*common.SignedData) error }
type SignerIdentity ¶
type SignerIdentity interface { Signer // Serialize returns a byte representation of this identity which is used to verify // messages signed by this SignerIdentity Serialize() ([]byte, error) }
SignerIdentity signs messages and serializes its public identity to bytes