handlers

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

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

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

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIssuerPublicKey

func NewIssuerPublicKey(pk IssuerPublicKey) *issuerPublicKey

func NewIssuerSecretKey

func NewIssuerSecretKey(sk IssuerSecretKey, exportable bool) *issuerSecretKey

func NewNymPublicKey

func NewNymPublicKey(pk Ecp) *nymPublicKey

func NewNymSecretKey

func NewNymSecretKey(sk Big, pk Ecp, exportable bool) (*nymSecretKey, error)

func NewRevocationPublicKey

func NewRevocationPublicKey(pubKey *ecdsa.PublicKey) *revocationPublicKey

func NewRevocationSecretKey

func NewRevocationSecretKey(sk *ecdsa.PrivateKey, exportable bool) *revocationSecretKey

func NewUserSecretKey

func NewUserSecretKey(sk Big, exportable bool) *userSecretKey

Types

type Big

type Big interface {
	Bytes() ([]byte, error)
}

type CredRequest

type CredRequest interface {
	Sign(sk Big, ipk IssuerPublicKey, nonce []byte) ([]byte, error)

	Verify(credRequest []byte, ipk IssuerPublicKey, nonce []byte) error
}

type Credential

type Credential interface {
	Sign(key IssuerSecretKey, credentialRequest []byte, attributes []bccsp.IdemixAttribute) ([]byte, error)

	Verify(sk Big, ipk IssuerPublicKey, credential []byte, attributes []bccsp.IdemixAttribute) error
}

type CredentialRequestSigner

type CredentialRequestSigner struct {
	CredRequest CredRequest
}

func (*CredentialRequestSigner) Sign

func (c *CredentialRequestSigner) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) ([]byte, error)

type CredentialRequestVerifier

type CredentialRequestVerifier struct {
	CredRequest CredRequest
}

func (*CredentialRequestVerifier) Verify

func (c *CredentialRequestVerifier) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (bool, error)

type CredentialSigner

type CredentialSigner struct {
	Credential Credential
}

func (*CredentialSigner) Sign

func (s *CredentialSigner) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) (signature []byte, err error)

type CredentialVerifier

type CredentialVerifier struct {
	Credential Credential
}

func (*CredentialVerifier) Verify

func (v *CredentialVerifier) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (valid bool, err error)

type CriSigner

type CriSigner struct {
	Revocation Revocation
}

func (*CriSigner) Sign

func (s *CriSigner) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) ([]byte, error)

type CriVerifier

type CriVerifier struct {
	Revocation Revocation
}

func (*CriVerifier) Verify

func (v *CriVerifier) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (bool, error)

type Ecp

type Ecp interface {
	Bytes() ([]byte, error)
}

type Issuer

type Issuer interface {
	NewKey(AttributeNames []string) (IssuerSecretKey, error)

	NewPublicKeyFromBytes(raw []byte, attributes []string) (IssuerPublicKey, error)
}

type IssuerKeyGen

type IssuerKeyGen struct {
	Exportable bool

	Issuer Issuer
}

func (*IssuerKeyGen) KeyGen

func (g *IssuerKeyGen) KeyGen(opts bccsp.KeyGenOpts) (k bccsp.Key, err error)

type IssuerPublicKey

type IssuerPublicKey interface {
	Bytes() ([]byte, error)

	Hash() []byte
}

type IssuerPublicKeyImporter

type IssuerPublicKeyImporter struct {
	Issuer Issuer
}

func (*IssuerPublicKeyImporter) KeyImport

func (i *IssuerPublicKeyImporter) KeyImport(raw interface{}, opts bccsp.KeyImportOpts) (k bccsp.Key, err error)

type IssuerSecretKey

type IssuerSecretKey interface {
	Bytes() ([]byte, error)

	Public() IssuerPublicKey
}

type NymKeyDerivation

type NymKeyDerivation struct {
	Exportable bool

	User User
}

func (*NymKeyDerivation) KeyDeriv

func (kd *NymKeyDerivation) KeyDeriv(k bccsp.Key, opts bccsp.KeyDerivOpts) (dk bccsp.Key, err error)

type NymPublicKeyImporter

type NymPublicKeyImporter struct {
	User User
}

func (*NymPublicKeyImporter) KeyImport

func (i *NymPublicKeyImporter) KeyImport(raw interface{}, opts bccsp.KeyImportOpts) (k bccsp.Key, err error)

type NymSignatureScheme

type NymSignatureScheme interface {
	Sign(sk Big, Nym Ecp, RNym Big, ipk IssuerPublicKey, digest []byte) ([]byte, error)

	Verify(pk IssuerPublicKey, Nym Ecp, signature, digest []byte) error
}

type NymSigner

type NymSigner struct {
	NymSignatureScheme NymSignatureScheme
}

func (*NymSigner) Sign

func (s *NymSigner) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) ([]byte, error)

type NymVerifier

type NymVerifier struct {
	NymSignatureScheme NymSignatureScheme
}

func (*NymVerifier) Verify

func (v *NymVerifier) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (bool, error)

type Revocation

type Revocation interface {
	NewKey() (*ecdsa.PrivateKey, error)

	Sign(key *ecdsa.PrivateKey, unrevokedHandles [][]byte, epoch int, alg bccsp.RevocationAlgorithm) ([]byte, error)

	Verify(pk *ecdsa.PublicKey, cri []byte, epoch int, alg bccsp.RevocationAlgorithm) error
}

type RevocationKeyGen

type RevocationKeyGen struct {
	Exportable bool

	Revocation Revocation
}

func (*RevocationKeyGen) KeyGen

func (g *RevocationKeyGen) KeyGen(opts bccsp.KeyGenOpts) (bccsp.Key, error)

type RevocationPublicKeyImporter

type RevocationPublicKeyImporter struct {
}

func (*RevocationPublicKeyImporter) KeyImport

func (i *RevocationPublicKeyImporter) KeyImport(raw interface{}, opts bccsp.KeyImportOpts) (k bccsp.Key, err error)

type SignatureScheme

type SignatureScheme interface {
	Sign(cred []byte, sk Big, Nym Ecp, RNym Big, ipk IssuerPublicKey, attributes []bccsp.IdemixAttribute,
		msg []byte, rhIndex int, cri []byte) ([]byte, error)

	Verify(ipk IssuerPublicKey, signature, msg []byte, attributes []bccsp.IdemixAttribute, rhIndex int, revocationPublicKey *ecdsa.PublicKey, epoch int) error
}

type Signer

type Signer struct {
	SignatureScheme SignatureScheme
}

func (*Signer) Sign

func (s *Signer) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) ([]byte, error)

type User

type User interface {
	NewKey() (Big, error)

	NewKeyFromBytes(raw []byte) (Big, error)

	MakeNym(sk Big, key IssuerPublicKey) (Ecp, Big, error)

	NewPublicNymFromBytes(raw []byte) (Ecp, error)
}

type UserKeyGen

type UserKeyGen struct {
	Exportable bool

	User User
}

func (*UserKeyGen) KeyGen

func (g *UserKeyGen) KeyGen(opts bccsp.KeyGenOpts) (bccsp.Key, error)

type UserKeyImporter

type UserKeyImporter struct {
	Exportable bool

	User User
}

func (*UserKeyImporter) KeyImport

func (i *UserKeyImporter) KeyImport(raw interface{}, opts bccsp.KeyImportOpts) (k bccsp.Key, err error)

type Verifier

type Verifier struct {
	SignatureScheme SignatureScheme
}

func (*Verifier) Verify

func (v *Verifier) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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