Documentation
¶
Overview ¶
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Copyright IBM Corp. 2016 All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func New(keyStore bccsp.KeyStore, curve *math.Curve, translator idemix.Translator, ...) (*csp, error)
- func NewAries(keyStore bccsp.KeyStore, curve *math.Curve, _translator idemix.Translator, ...) (*csp, error)
- type CSP
- func (csp *CSP) AddWrapper(t reflect.Type, w any) error
- func (csp *CSP) GetKey(ski []byte) (k bccsp.Key, err error)
- func (csp *CSP) KeyDeriv(k bccsp.Key, opts bccsp.KeyDerivOpts) (dk bccsp.Key, err error)
- func (csp *CSP) KeyGen(opts bccsp.KeyGenOpts) (k bccsp.Key, err error)
- func (csp *CSP) KeyImport(raw any, opts bccsp.KeyImportOpts) (k bccsp.Key, err error)
- func (csp *CSP) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) (signature []byte, err error)
- func (csp *CSP) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (valid bool, err error)
- type KeyDeriver
- type KeyGenerator
- type KeyImporter
- type Signer
- type Verifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CSP ¶
type CSP struct {
KeyGenerators map[reflect.Type]KeyGenerator
KeyDerivers map[reflect.Type]KeyDeriver
KeyImporters map[reflect.Type]KeyImporter
Signers map[reflect.Type]Signer
Verifiers map[reflect.Type]Verifier
// contains filtered or unexported fields
}
CSP provides a generic implementation of the BCCSP interface based on wrappers. It can be customized by providing implementations for the following algorithm-based wrappers: KeyGenerator, KeyDeriver, KeyImporter, Signer, Verifier. Each wrapper is bound to a Go type representing either an option or a key.
func (*CSP) AddWrapper ¶
AddWrapper binds the passed type to the passed wrapper. Notice that that wrapper must be an instance of one of the following interfaces: KeyGenerator, KeyDeriver, KeyImporter, Signer, Verifier.
func (*CSP) KeyDeriv ¶
KeyDeriv derives a key from k using opts. The opts argument should be appropriate for the primitive used.
func (*CSP) KeyImport ¶
KeyImport imports a key from its raw representation using opts. The opts argument should be appropriate for the primitive used.
func (*CSP) Sign ¶
func (csp *CSP) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) (signature []byte, err error)
Sign signs digest using key k. The opts argument should be appropriate for the primitive used.
Note that when a signature of a hash of a larger message is needed, the caller is responsible for hashing the larger message and passing the hash (as digest).
type KeyDeriver ¶
type KeyDeriver interface {
// KeyDeriv derives a key from k using opts.
// The opts argument should be appropriate for the primitive used.
KeyDeriv(k bccsp.Key, opts bccsp.KeyDerivOpts) (dk bccsp.Key, err error)
}
KeyDeriver is a BCCSP-like interface that provides key derivation algorithms
type KeyGenerator ¶
type KeyGenerator interface {
// KeyGen generates a key using opts.
KeyGen(opts bccsp.KeyGenOpts) (k bccsp.Key, err error)
}
KeyGenerator is a BCCSP-like interface that provides key generation algorithms
type KeyImporter ¶
type KeyImporter interface {
// KeyImport imports a key from its raw representation using opts.
// The opts argument should be appropriate for the primitive used.
KeyImport(raw any, opts bccsp.KeyImportOpts) (k bccsp.Key, err error)
}
KeyImporter is a BCCSP-like interface that provides key import algorithms
type Signer ¶
type Signer interface {
// Sign signs digest using key k.
// The opts argument should be appropriate for the algorithm used.
//
// Note that when a signature of a hash of a larger message is needed,
// the caller is responsible for hashing the larger message and passing
// the hash (as digest).
Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) (signature []byte, err error)
}
Signer is a BCCSP-like interface that provides signing algorithms
type Verifier ¶
type Verifier interface {
// Verify verifies signature against key k and digest
// The opts argument should be appropriate for the algorithm used.
Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (valid bool, err error)
}
Verifier is a BCCSP-like interface that provides verifying algorithms
Directories
¶
| Path | Synopsis |
|---|---|
|
schemes
|
|
|
weak-bb
Deprecated: Package weakbb implements Weak Boneh-Boyen signatures for epoch-based revocation.
|
Deprecated: Package weakbb implements Weak Boneh-Boyen signatures for epoch-based revocation. |
|
mock
Code generated by counterfeiter.
|
Code generated by counterfeiter. |