bccsp

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: 4 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. 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

Constants

View Source
const (
	ECDSA = "ECDSA"

	ECDSAP256 = "ECDSAP256"

	ECDSAP384 = "ECDSAP384"

	ECDSAReRand = "ECDSA_RERAND"

	RSA = "RSA"

	RSA1024 = "RSA1024"

	RSA2048 = "RSA2048"

	RSA3072 = "RSA3072"

	RSA4096 = "RSA4096"

	AES = "AES"

	AES128 = "AES128"

	AES192 = "AES192"

	AES256 = "AES256"

	HMAC = "HMAC"

	HMACTruncated256 = "HMAC_TRUNCATED_256"

	SHA = "SHA"

	SHA2 = "SHA2"

	SHA3 = "SHA3"

	SHA256 = "SHA256"

	SHA384 = "SHA384"

	SHA3_256 = "SHA3_256"

	SHA3_384 = "SHA3_384"

	X509Certificate = "X509Certificate"
)
View Source
const (
	IDEMIX = "IDEMIX"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AES128KeyGenOpts

type AES128KeyGenOpts struct {
	Temporary bool
}

func (*AES128KeyGenOpts) Algorithm

func (opts *AES128KeyGenOpts) Algorithm() string

func (*AES128KeyGenOpts) Ephemeral

func (opts *AES128KeyGenOpts) Ephemeral() bool

type AES192KeyGenOpts

type AES192KeyGenOpts struct {
	Temporary bool
}

func (*AES192KeyGenOpts) Algorithm

func (opts *AES192KeyGenOpts) Algorithm() string

func (*AES192KeyGenOpts) Ephemeral

func (opts *AES192KeyGenOpts) Ephemeral() bool

type AES256ImportKeyOpts

type AES256ImportKeyOpts struct {
	Temporary bool
}

func (*AES256ImportKeyOpts) Algorithm

func (opts *AES256ImportKeyOpts) Algorithm() string

func (*AES256ImportKeyOpts) Ephemeral

func (opts *AES256ImportKeyOpts) Ephemeral() bool

type AES256KeyGenOpts

type AES256KeyGenOpts struct {
	Temporary bool
}

func (*AES256KeyGenOpts) Algorithm

func (opts *AES256KeyGenOpts) Algorithm() string

func (*AES256KeyGenOpts) Ephemeral

func (opts *AES256KeyGenOpts) Ephemeral() bool

type AESCBCPKCS7ModeOpts

type AESCBCPKCS7ModeOpts struct {
	IV []byte

	PRNG io.Reader
}

type AESKeyGenOpts

type AESKeyGenOpts struct {
	Temporary bool
}

func (*AESKeyGenOpts) Algorithm

func (opts *AESKeyGenOpts) Algorithm() string

func (*AESKeyGenOpts) Ephemeral

func (opts *AESKeyGenOpts) Ephemeral() bool

type BCCSP

type BCCSP interface {
	KeyGen(opts KeyGenOpts) (k Key, err error)

	KeyDeriv(k Key, opts KeyDerivOpts) (dk Key, err error)

	KeyImport(raw interface{}, opts KeyImportOpts) (k Key, err error)

	GetKey(ski []byte) (k Key, err error)

	Hash(msg []byte, opts HashOpts) (hash []byte, err error)

	GetHash(opts HashOpts) (h hash.Hash, err error)

	Sign(k Key, digest []byte, opts SignerOpts) (signature []byte, err error)

	Verify(k Key, signature, digest []byte, opts SignerOpts) (valid bool, err error)

	Encrypt(k Key, plaintext []byte, opts EncrypterOpts) (ciphertext []byte, err error)

	Decrypt(k Key, ciphertext []byte, opts DecrypterOpts) (plaintext []byte, err error)
}

type DecrypterOpts

type DecrypterOpts interface{}

type ECDSAGoPublicKeyImportOpts

type ECDSAGoPublicKeyImportOpts struct {
	Temporary bool
}

func (*ECDSAGoPublicKeyImportOpts) Algorithm

func (opts *ECDSAGoPublicKeyImportOpts) Algorithm() string

func (*ECDSAGoPublicKeyImportOpts) Ephemeral

func (opts *ECDSAGoPublicKeyImportOpts) Ephemeral() bool

type ECDSAKeyGenOpts

type ECDSAKeyGenOpts struct {
	Temporary bool
}

func (*ECDSAKeyGenOpts) Algorithm

func (opts *ECDSAKeyGenOpts) Algorithm() string

func (*ECDSAKeyGenOpts) Ephemeral

func (opts *ECDSAKeyGenOpts) Ephemeral() bool

type ECDSAP256KeyGenOpts

type ECDSAP256KeyGenOpts struct {
	Temporary bool
}

func (*ECDSAP256KeyGenOpts) Algorithm

func (opts *ECDSAP256KeyGenOpts) Algorithm() string

func (*ECDSAP256KeyGenOpts) Ephemeral

func (opts *ECDSAP256KeyGenOpts) Ephemeral() bool

type ECDSAP384KeyGenOpts

type ECDSAP384KeyGenOpts struct {
	Temporary bool
}

func (*ECDSAP384KeyGenOpts) Algorithm

func (opts *ECDSAP384KeyGenOpts) Algorithm() string

func (*ECDSAP384KeyGenOpts) Ephemeral

func (opts *ECDSAP384KeyGenOpts) Ephemeral() bool

type ECDSAPKIXPublicKeyImportOpts

type ECDSAPKIXPublicKeyImportOpts struct {
	Temporary bool
}

func (*ECDSAPKIXPublicKeyImportOpts) Algorithm

func (opts *ECDSAPKIXPublicKeyImportOpts) Algorithm() string

func (*ECDSAPKIXPublicKeyImportOpts) Ephemeral

func (opts *ECDSAPKIXPublicKeyImportOpts) Ephemeral() bool

type ECDSAPrivateKeyImportOpts

type ECDSAPrivateKeyImportOpts struct {
	Temporary bool
}

func (*ECDSAPrivateKeyImportOpts) Algorithm

func (opts *ECDSAPrivateKeyImportOpts) Algorithm() string

func (*ECDSAPrivateKeyImportOpts) Ephemeral

func (opts *ECDSAPrivateKeyImportOpts) Ephemeral() bool

type ECDSAReRandKeyOpts

type ECDSAReRandKeyOpts struct {
	Temporary bool
	Expansion []byte
}

func (*ECDSAReRandKeyOpts) Algorithm

func (opts *ECDSAReRandKeyOpts) Algorithm() string

func (*ECDSAReRandKeyOpts) Ephemeral

func (opts *ECDSAReRandKeyOpts) Ephemeral() bool

func (*ECDSAReRandKeyOpts) ExpansionValue

func (opts *ECDSAReRandKeyOpts) ExpansionValue() []byte

type EncrypterOpts

type EncrypterOpts interface{}

type HMACDeriveKeyOpts

type HMACDeriveKeyOpts struct {
	Temporary bool
	Arg       []byte
}

func (*HMACDeriveKeyOpts) Algorithm

func (opts *HMACDeriveKeyOpts) Algorithm() string

func (*HMACDeriveKeyOpts) Argument

func (opts *HMACDeriveKeyOpts) Argument() []byte

func (*HMACDeriveKeyOpts) Ephemeral

func (opts *HMACDeriveKeyOpts) Ephemeral() bool

type HMACImportKeyOpts

type HMACImportKeyOpts struct {
	Temporary bool
}

func (*HMACImportKeyOpts) Algorithm

func (opts *HMACImportKeyOpts) Algorithm() string

func (*HMACImportKeyOpts) Ephemeral

func (opts *HMACImportKeyOpts) Ephemeral() bool

type HMACTruncated256AESDeriveKeyOpts

type HMACTruncated256AESDeriveKeyOpts struct {
	Temporary bool
	Arg       []byte
}

func (*HMACTruncated256AESDeriveKeyOpts) Algorithm

func (opts *HMACTruncated256AESDeriveKeyOpts) Algorithm() string

func (*HMACTruncated256AESDeriveKeyOpts) Argument

func (opts *HMACTruncated256AESDeriveKeyOpts) Argument() []byte

func (*HMACTruncated256AESDeriveKeyOpts) Ephemeral

func (opts *HMACTruncated256AESDeriveKeyOpts) Ephemeral() bool

type HashOpts

type HashOpts interface {
	Algorithm() string
}

func GetHashOpt

func GetHashOpt(hashFunction string) (HashOpts, error)

type IdemixAttribute

type IdemixAttribute struct {
	Type IdemixAttributeType

	Value interface{}
}

type IdemixAttributeType

type IdemixAttributeType int
const (
	IdemixHiddenAttribute IdemixAttributeType = iota

	IdemixBytesAttribute

	IdemixIntAttribute
)

type IdemixCRISignerOpts

type IdemixCRISignerOpts struct {
	Epoch               int
	RevocationAlgorithm RevocationAlgorithm
	UnrevokedHandles    [][]byte

	H crypto.Hash
}

func (*IdemixCRISignerOpts) HashFunc

func (o *IdemixCRISignerOpts) HashFunc() crypto.Hash

type IdemixCredentialRequestSignerOpts

type IdemixCredentialRequestSignerOpts struct {
	Attributes []int

	IssuerPK Key

	IssuerNonce []byte

	H crypto.Hash
}

func (*IdemixCredentialRequestSignerOpts) HashFunc

func (*IdemixCredentialRequestSignerOpts) IssuerPublicKey

func (o *IdemixCredentialRequestSignerOpts) IssuerPublicKey() Key

type IdemixCredentialSignerOpts

type IdemixCredentialSignerOpts struct {
	Attributes []IdemixAttribute

	IssuerPK Key

	H crypto.Hash
}

func (*IdemixCredentialSignerOpts) HashFunc

func (o *IdemixCredentialSignerOpts) HashFunc() crypto.Hash

func (*IdemixCredentialSignerOpts) IssuerPublicKey

func (o *IdemixCredentialSignerOpts) IssuerPublicKey() Key

type IdemixIIssuerPublicKeyImporterErrorType

type IdemixIIssuerPublicKeyImporterErrorType int
const (
	IdemixIssuerPublicKeyImporterUnmarshallingError IdemixIIssuerPublicKeyImporterErrorType = iota
	IdemixIssuerPublicKeyImporterHashError
	IdemixIssuerPublicKeyImporterValidationError
	IdemixIssuerPublicKeyImporterNumAttributesError
	IdemixIssuerPublicKeyImporterAttributeNameError
)

type IdemixIssuerKeyGenOpts

type IdemixIssuerKeyGenOpts struct {
	Temporary bool

	AttributeNames []string
}

func (*IdemixIssuerKeyGenOpts) Algorithm

func (*IdemixIssuerKeyGenOpts) Algorithm() string

func (*IdemixIssuerKeyGenOpts) Ephemeral

func (o *IdemixIssuerKeyGenOpts) Ephemeral() bool

type IdemixIssuerPublicKeyImportOpts

type IdemixIssuerPublicKeyImportOpts struct {
	Temporary bool

	AttributeNames []string
}

func (*IdemixIssuerPublicKeyImportOpts) Algorithm

func (*IdemixIssuerPublicKeyImportOpts) Ephemeral

func (o *IdemixIssuerPublicKeyImportOpts) Ephemeral() bool

type IdemixIssuerPublicKeyImporterError

type IdemixIssuerPublicKeyImporterError struct {
	Type     IdemixIIssuerPublicKeyImporterErrorType
	ErrorMsg string
	Cause    error
}

func (*IdemixIssuerPublicKeyImporterError) Error

type IdemixNymKeyDerivationOpts

type IdemixNymKeyDerivationOpts struct {
	Temporary bool

	IssuerPK Key
}

func (*IdemixNymKeyDerivationOpts) Algorithm

func (*IdemixNymKeyDerivationOpts) Algorithm() string

func (*IdemixNymKeyDerivationOpts) Ephemeral

func (o *IdemixNymKeyDerivationOpts) Ephemeral() bool

func (*IdemixNymKeyDerivationOpts) IssuerPublicKey

func (o *IdemixNymKeyDerivationOpts) IssuerPublicKey() Key

type IdemixNymPublicKeyImportOpts

type IdemixNymPublicKeyImportOpts struct {
	Temporary bool
}

func (*IdemixNymPublicKeyImportOpts) Algorithm

func (*IdemixNymPublicKeyImportOpts) Algorithm() string

func (*IdemixNymPublicKeyImportOpts) Ephemeral

func (o *IdemixNymPublicKeyImportOpts) Ephemeral() bool

type IdemixNymSignerOpts

type IdemixNymSignerOpts struct {
	Nym Key

	IssuerPK Key

	H crypto.Hash
}

func (*IdemixNymSignerOpts) HashFunc

func (o *IdemixNymSignerOpts) HashFunc() crypto.Hash

type IdemixRevocationKeyGenOpts

type IdemixRevocationKeyGenOpts struct {
	Temporary bool
}

func (*IdemixRevocationKeyGenOpts) Algorithm

func (*IdemixRevocationKeyGenOpts) Algorithm() string

func (*IdemixRevocationKeyGenOpts) Ephemeral

func (o *IdemixRevocationKeyGenOpts) Ephemeral() bool

type IdemixRevocationPublicKeyImportOpts

type IdemixRevocationPublicKeyImportOpts struct {
	Temporary bool
}

func (*IdemixRevocationPublicKeyImportOpts) Algorithm

func (*IdemixRevocationPublicKeyImportOpts) Ephemeral

type IdemixSignerOpts

type IdemixSignerOpts struct {
	Nym Key

	IssuerPK Key

	Credential []byte

	Attributes []IdemixAttribute

	RhIndex int

	CRI []byte

	Epoch int

	RevocationPublicKey Key

	H crypto.Hash
}

func (*IdemixSignerOpts) HashFunc

func (o *IdemixSignerOpts) HashFunc() crypto.Hash

type IdemixUserSecretKeyGenOpts

type IdemixUserSecretKeyGenOpts struct {
	Temporary bool
}

func (*IdemixUserSecretKeyGenOpts) Algorithm

func (*IdemixUserSecretKeyGenOpts) Algorithm() string

func (*IdemixUserSecretKeyGenOpts) Ephemeral

func (o *IdemixUserSecretKeyGenOpts) Ephemeral() bool

type IdemixUserSecretKeyImportOpts

type IdemixUserSecretKeyImportOpts struct {
	Temporary bool
}

func (*IdemixUserSecretKeyImportOpts) Algorithm

func (*IdemixUserSecretKeyImportOpts) Ephemeral

func (o *IdemixUserSecretKeyImportOpts) Ephemeral() bool

type Key

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

	SKI() []byte

	Symmetric() bool

	Private() bool

	PublicKey() (Key, error)
}

type KeyDerivOpts

type KeyDerivOpts interface {
	Algorithm() string

	Ephemeral() bool
}

type KeyGenOpts

type KeyGenOpts interface {
	Algorithm() string

	Ephemeral() bool
}

type KeyImportOpts

type KeyImportOpts interface {
	Algorithm() string

	Ephemeral() bool
}

type KeyStore

type KeyStore interface {
	ReadOnly() bool

	GetKey(ski []byte) (k Key, err error)

	StoreKey(k Key) (err error)
}

type RSA1024KeyGenOpts

type RSA1024KeyGenOpts struct {
	Temporary bool
}

func (*RSA1024KeyGenOpts) Algorithm

func (opts *RSA1024KeyGenOpts) Algorithm() string

func (*RSA1024KeyGenOpts) Ephemeral

func (opts *RSA1024KeyGenOpts) Ephemeral() bool

type RSA2048KeyGenOpts

type RSA2048KeyGenOpts struct {
	Temporary bool
}

func (*RSA2048KeyGenOpts) Algorithm

func (opts *RSA2048KeyGenOpts) Algorithm() string

func (*RSA2048KeyGenOpts) Ephemeral

func (opts *RSA2048KeyGenOpts) Ephemeral() bool

type RSA3072KeyGenOpts

type RSA3072KeyGenOpts struct {
	Temporary bool
}

func (*RSA3072KeyGenOpts) Algorithm

func (opts *RSA3072KeyGenOpts) Algorithm() string

func (*RSA3072KeyGenOpts) Ephemeral

func (opts *RSA3072KeyGenOpts) Ephemeral() bool

type RSA4096KeyGenOpts

type RSA4096KeyGenOpts struct {
	Temporary bool
}

func (*RSA4096KeyGenOpts) Algorithm

func (opts *RSA4096KeyGenOpts) Algorithm() string

func (*RSA4096KeyGenOpts) Ephemeral

func (opts *RSA4096KeyGenOpts) Ephemeral() bool

type RSAGoPublicKeyImportOpts

type RSAGoPublicKeyImportOpts struct {
	Temporary bool
}

func (*RSAGoPublicKeyImportOpts) Algorithm

func (opts *RSAGoPublicKeyImportOpts) Algorithm() string

func (*RSAGoPublicKeyImportOpts) Ephemeral

func (opts *RSAGoPublicKeyImportOpts) Ephemeral() bool

type RSAKeyGenOpts

type RSAKeyGenOpts struct {
	Temporary bool
}

func (*RSAKeyGenOpts) Algorithm

func (opts *RSAKeyGenOpts) Algorithm() string

func (*RSAKeyGenOpts) Ephemeral

func (opts *RSAKeyGenOpts) Ephemeral() bool

type RevocationAlgorithm

type RevocationAlgorithm int32
const (
	AlgNoRevocation RevocationAlgorithm = iota
)

type SHA256Opts

type SHA256Opts struct {
}

func (*SHA256Opts) Algorithm

func (opts *SHA256Opts) Algorithm() string

type SHA384Opts

type SHA384Opts struct {
}

func (*SHA384Opts) Algorithm

func (opts *SHA384Opts) Algorithm() string

type SHA3_256Opts

type SHA3_256Opts struct {
}

func (*SHA3_256Opts) Algorithm

func (opts *SHA3_256Opts) Algorithm() string

type SHA3_384Opts

type SHA3_384Opts struct {
}

func (*SHA3_384Opts) Algorithm

func (opts *SHA3_384Opts) Algorithm() string

type SHAOpts

type SHAOpts struct {
}

func (*SHAOpts) Algorithm

func (opts *SHAOpts) Algorithm() string

type SignerOpts

type SignerOpts interface {
	crypto.SignerOpts
}

type X509PublicKeyImportOpts

type X509PublicKeyImportOpts struct {
	Temporary bool
}

func (*X509PublicKeyImportOpts) Algorithm

func (opts *X509PublicKeyImportOpts) Algorithm() string

func (*X509PublicKeyImportOpts) Ephemeral

func (opts *X509PublicKeyImportOpts) Ephemeral() bool

Directories

Path Synopsis
sw

Jump to

Keyboard shortcuts

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