{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package bccsp\n\nCopyright IBM Corp. All Rights Reserved.\n\nSPDX-License-Identifier: Apache-2.0\n\nCopyright IBM Corp. All Rights Reserved.\n\nSPDX-License-Identifier: Apache-2.0\n\nCopyright IBM Corp. 2016 All Rights Reserved.\n\nLicensed 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\n\n\thttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless 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.\n\n## Constants\n\n```go\nconst (\n\t// ECDSA Elliptic Curve Digital Signature Algorithm (key gen, import, sign, verify),\n\t// at default security level.\n\t// Each BCCSP may or may not support default security level. If not supported than\n\t// an error will be returned.\n\tECDSA = \"ECDSA\"\n\n\t// ECDSA Elliptic Curve Digital Signature Algorithm over P-256 curve\n\tECDSAP256 = \"ECDSAP256\"\n\n\t// ECDSA Elliptic Curve Digital Signature Algorithm over P-384 curve\n\tECDSAP384 = \"ECDSAP384\"\n\n\t// ECDSAReRand ECDSA key re-randomization\n\tECDSAReRand = \"ECDSA_RERAND\"\n\n\t// RSA at the default security level.\n\t// Each BCCSP may or may not support default security level. If not supported than\n\t// an error will be returned.\n\tRSA = \"RSA\"\n\t// RSA at 1024 bit security level.\n\tRSA1024 = \"RSA1024\"\n\t// RSA at 2048 bit security level.\n\tRSA2048 = \"RSA2048\"\n\t// RSA at 3072 bit security level.\n\tRSA3072 = \"RSA3072\"\n\t// RSA at 4096 bit security level.\n\tRSA4096 = \"RSA4096\"\n\n\t// AES Advanced Encryption Standard at the default security level.\n\t// Each BCCSP may or may not support default security level. If not supported than\n\t// an error will be returned.\n\tAES = \"AES\"\n\t// AES Advanced Encryption Standard at 128 bit security level\n\tAES128 = \"AES128\"\n\t// AES Advanced Encryption Standard at 192 bit security level\n\tAES192 = \"AES192\"\n\t// AES Advanced Encryption Standard at 256 bit security level\n\tAES256 = \"AES256\"\n\n\t// HMAC keyed-hash message authentication code\n\tHMAC = \"HMAC\"\n\t// HMACTruncated256 HMAC truncated at 256 bits.\n\tHMACTruncated256 = \"HMAC_TRUNCATED_256\"\n\n\t// SHA Secure Hash Algorithm using default family.\n\t// Each BCCSP may or may not support default security level. If not supported than\n\t// an error will be returned.\n\tSHA = \"SHA\"\n\n\t// SHA2 is an identifier for SHA2 hash family\n\tSHA2 = \"SHA2\"\n\t// SHA3 is an identifier for SHA3 hash family\n\tSHA3 = \"SHA3\"\n\n\t// SHA256\n\tSHA256 = \"SHA256\"\n\t// SHA384\n\tSHA384 = \"SHA384\"\n\t// SHA3_256\n\tSHA3_256 = \"SHA3_256\"\n\t// SHA3_384\n\tSHA3_384 = \"SHA3_384\"\n\n\t// X509Certificate Label for X509 certificate related operation\n\tX509Certificate = \"X509Certificate\"\n)\n```\n\n```go\nconst (\n\t// IDEMIX constant to identify Idemix related algorithms\n\tIDEMIX = \"IDEMIX\"\n)\n```\n\n## Types\n\n```go\ntype AES128KeyGenOpts struct {\n\tTemporary bool\n}\n```\nAES128KeyGenOpts contains options for AES key generation at 128 security level\n\n```go\nfunc (opts *AES128KeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *AES128KeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype AES192KeyGenOpts struct {\n\tTemporary bool\n}\n```\nAES192KeyGenOpts contains options for AES key generation at 192  security level\n\n```go\nfunc (opts *AES192KeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *AES192KeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype AES256ImportKeyOpts struct {\n\tTemporary bool\n}\n```\nAES256ImportKeyOpts contains options for importing AES 256 keys.\n\n```go\nfunc (opts *AES256ImportKeyOpts) Algorithm() string\n```\nAlgorithm returns the key importation algorithm identifier (to be used).\n\n```go\nfunc (opts *AES256ImportKeyOpts) Ephemeral() bool\n```\nEphemeral returns true if the key generated has to be ephemeral, false otherwise.\n\n```go\ntype AES256KeyGenOpts struct {\n\tTemporary bool\n}\n```\nAES256KeyGenOpts contains options for AES key generation at 256 security level\n\n```go\nfunc (opts *AES256KeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *AES256KeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype AESCBCPKCS7ModeOpts struct {\n\t// IV is the initialization vector to be used by the underlying cipher.\n\t// The length of IV must be the same as the Block's block size.\n\t// It is used only if different from nil.\n\tIV []byte\n\t// PRNG is an instance of a PRNG to be used by the underlying cipher.\n\t// It is used only if different from nil.\n\tPRNG io.Reader\n}\n```\nAESCBCPKCS7ModeOpts contains options for AES encryption in CBC mode with PKCS7 padding. Notice that both IV and PRNG can be nil. In that case, the BCCSP implementation is supposed to sample the IV using a cryptographic secure PRNG. Notice also that either IV or PRNG can be different from nil.\n\n```go\ntype AESKeyGenOpts struct {\n\tTemporary bool\n}\n```\nAESKeyGenOpts contains options for AES key generation at default security level\n\n```go\nfunc (opts *AESKeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *AESKeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype BCCSP interface {\n\n\t// KeyGen generates a key using opts.\n\tKeyGen(opts KeyGenOpts) (k Key, err error)\n\n\t// KeyDeriv derives a key from k using opts.\n\t// The opts argument should be appropriate for the primitive used.\n\tKeyDeriv(k Key, opts KeyDerivOpts) (dk Key, err error)\n\n\t// KeyImport imports a key from its raw representation using opts.\n\t// The opts argument should be appropriate for the primitive used.\n\tKeyImport(raw interface{}, opts KeyImportOpts) (k Key, err error)\n\n\t// GetKey returns the key this CSP associates to\n\t// the Subject Key Identifier ski.\n\tGetKey(ski []byte) (k Key, err error)\n\n\t// Hash hashes messages msg using options opts.\n\t// If opts is nil, the default hash function will be used.\n\tHash(msg []byte, opts HashOpts) (hash []byte, err error)\n\n\t// GetHash returns and instance of hash.Hash using options opts.\n\t// If opts is nil, the default hash function will be returned.\n\tGetHash(opts HashOpts) (h hash.Hash, err error)\n\n\t// Sign signs digest using key k.\n\t// The opts argument should be appropriate for the algorithm used.\n\t//\n\t// Note that when a signature of a hash of a larger message is needed,\n\t// the caller is responsible for hashing the larger message and passing\n\t// the hash (as digest).\n\tSign(k Key, digest []byte, opts SignerOpts) (signature []byte, err error)\n\n\t// Verify verifies signature against key k and digest\n\t// The opts argument should be appropriate for the algorithm used.\n\tVerify(k Key, signature, digest []byte, opts SignerOpts) (valid bool, err error)\n\n\t// Encrypt encrypts plaintext using key k.\n\t// The opts argument should be appropriate for the algorithm used.\n\tEncrypt(k Key, plaintext []byte, opts EncrypterOpts) (ciphertext []byte, err error)\n\n\t// Decrypt decrypts ciphertext using key k.\n\t// The opts argument should be appropriate for the algorithm used.\n\tDecrypt(k Key, ciphertext []byte, opts DecrypterOpts) (plaintext []byte, err error)\n}\n```\nBCCSP is the blockchain cryptographic service provider that offers the implementation of cryptographic standards and algorithms.\n\n```go\ntype DecrypterOpts interface{}\n```\nDecrypterOpts contains options for decrypting with a CSP.\n\n```go\ntype ECDSAGoPublicKeyImportOpts struct {\n\tTemporary bool\n}\n```\nECDSAGoPublicKeyImportOpts contains options for ECDSA key importation from ecdsa.PublicKey\n\n```go\nfunc (opts *ECDSAGoPublicKeyImportOpts) Algorithm() string\n```\nAlgorithm returns the key importation algorithm identifier (to be used).\n\n```go\nfunc (opts *ECDSAGoPublicKeyImportOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype ECDSAKeyGenOpts struct {\n\tTemporary bool\n}\n```\nECDSAKeyGenOpts contains options for ECDSA key generation.\n\n```go\nfunc (opts *ECDSAKeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *ECDSAKeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype ECDSAP256KeyGenOpts struct {\n\tTemporary bool\n}\n```\nECDSAP256KeyGenOpts contains options for ECDSA key generation with curve P-256.\n\n```go\nfunc (opts *ECDSAP256KeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *ECDSAP256KeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype ECDSAP384KeyGenOpts struct {\n\tTemporary bool\n}\n```\nECDSAP384KeyGenOpts contains options for ECDSA key generation with curve P-384.\n\n```go\nfunc (opts *ECDSAP384KeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *ECDSAP384KeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype ECDSAPKIXPublicKeyImportOpts struct {\n\tTemporary bool\n}\n```\nECDSAPKIXPublicKeyImportOpts contains options for ECDSA public key importation in PKIX format\n\n```go\nfunc (opts *ECDSAPKIXPublicKeyImportOpts) Algorithm() string\n```\nAlgorithm returns the key importation algorithm identifier (to be used).\n\n```go\nfunc (opts *ECDSAPKIXPublicKeyImportOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype ECDSAPrivateKeyImportOpts struct {\n\tTemporary bool\n}\n```\nECDSAPrivateKeyImportOpts contains options for ECDSA secret key importation in DER format or PKCS#8 format.\n\n```go\nfunc (opts *ECDSAPrivateKeyImportOpts) Algorithm() string\n```\nAlgorithm returns the key importation algorithm identifier (to be used).\n\n```go\nfunc (opts *ECDSAPrivateKeyImportOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype ECDSAReRandKeyOpts struct {\n\tTemporary bool\n\tExpansion []byte\n}\n```\nECDSAReRandKeyOpts contains options for ECDSA key re-randomization.\n\n```go\nfunc (opts *ECDSAReRandKeyOpts) Algorithm() string\n```\nAlgorithm returns the key derivation algorithm identifier (to be used).\n\n```go\nfunc (opts *ECDSAReRandKeyOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\nfunc (opts *ECDSAReRandKeyOpts) ExpansionValue() []byte\n```\nExpansionValue returns the re-randomization factor\n\n```go\ntype EncrypterOpts interface{}\n```\nEncrypterOpts contains options for encrypting with a CSP.\n\n```go\ntype HMACDeriveKeyOpts struct {\n\tTemporary bool\n\tArg       []byte\n}\n```\nHMACDeriveKeyOpts contains options for HMAC key derivation.\n\n```go\nfunc (opts *HMACDeriveKeyOpts) Algorithm() string\n```\nAlgorithm returns the key derivation algorithm identifier (to be used).\n\n```go\nfunc (opts *HMACDeriveKeyOpts) Argument() []byte\n```\nArgument returns the argument to be passed to the HMAC\n\n```go\nfunc (opts *HMACDeriveKeyOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype HMACImportKeyOpts struct {\n\tTemporary bool\n}\n```\nHMACImportKeyOpts contains options for importing HMAC keys.\n\n```go\nfunc (opts *HMACImportKeyOpts) Algorithm() string\n```\nAlgorithm returns the key importation algorithm identifier (to be used).\n\n```go\nfunc (opts *HMACImportKeyOpts) Ephemeral() bool\n```\nEphemeral returns true if the key generated has to be ephemeral, false otherwise.\n\n```go\ntype HMACTruncated256AESDeriveKeyOpts struct {\n\tTemporary bool\n\tArg       []byte\n}\n```\nHMACTruncated256AESDeriveKeyOpts contains options for HMAC truncated at 256 bits key derivation.\n\n```go\nfunc (opts *HMACTruncated256AESDeriveKeyOpts) Algorithm() string\n```\nAlgorithm returns the key derivation algorithm identifier (to be used).\n\n```go\nfunc (opts *HMACTruncated256AESDeriveKeyOpts) Argument() []byte\n```\nArgument returns the argument to be passed to the HMAC\n\n```go\nfunc (opts *HMACTruncated256AESDeriveKeyOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype HashOpts interface {\n\n\t// Algorithm returns the hash algorithm identifier (to be used).\n\tAlgorithm() string\n}\n```\nHashOpts contains options for hashing with a CSP.\n\n```go\nfunc GetHashOpt(hashFunction string) (HashOpts, error)\n```\nGetHashOpt returns the HashOpts corresponding to the passed hash function\n\n```go\ntype IdemixAttribute struct {\n\t// Type is the attribute's type\n\tType IdemixAttributeType\n\t// Value is the attribute's value\n\tValue interface{}\n}\n```\n\n```go\ntype IdemixAttributeType int\n```\nIdemixAttributeType represents the type of an idemix attribute\n\n```go\nconst (\n\t// IdemixHiddenAttribute represents an hidden attribute\n\tIdemixHiddenAttribute IdemixAttributeType = iota\n\t// IdemixStringAttribute represents a sequence of bytes\n\tIdemixBytesAttribute\n\t// IdemixIntAttribute represents an int\n\tIdemixIntAttribute\n)\n```\n\n```go\ntype IdemixCRISignerOpts struct {\n\tEpoch               int\n\tRevocationAlgorithm RevocationAlgorithm\n\tUnrevokedHandles    [][]byte\n\t// H is the hash function to be used\n\tH crypto.Hash\n}\n```\nIdemixCRISignerOpts contains the options to generate an Idemix CRI. The CRI is supposed to be generated by the Issuing authority and can be verified publicly by using the revocation public key.\n\n```go\nfunc (o *IdemixCRISignerOpts) HashFunc() crypto.Hash\n```\n\n```go\ntype IdemixCredentialRequestSignerOpts struct {\n\t// Attributes contains a list of indices of the attributes to be included in the\n\t// credential. The indices are with the respect to IdemixIssuerKeyGenOpts#AttributeNames.\n\tAttributes []int\n\t// IssuerPK is the public-key of the issuer\n\tIssuerPK Key\n\t// IssuerNonce is generated by the issuer and used by the client to generate the credential request.\n\t// Once the issuer gets the credential requests, it checks that the nonce is the same.\n\tIssuerNonce []byte\n\t// HashFun is the hash function to be used\n\tH crypto.Hash\n}\n```\nIdemixCredentialRequestSignerOpts contains the option to create a Idemix credential request.\n\n```go\nfunc (o *IdemixCredentialRequestSignerOpts) HashFunc() crypto.Hash\n```\n\n```go\nfunc (o *IdemixCredentialRequestSignerOpts) IssuerPublicKey() Key\n```\nIssuerPublicKey returns the issuer public key used to derive a new unlinkable pseudonym from a credential secret key\n\n```go\ntype IdemixCredentialSignerOpts struct {\n\t// Attributes to include in the credentials. IdemixHiddenAttribute is not allowed here\n\tAttributes []IdemixAttribute\n\t// IssuerPK is the public-key of the issuer\n\tIssuerPK Key\n\t// HashFun is the hash function to be used\n\tH crypto.Hash\n}\n```\nIdemixCredentialSignerOpts contains the options to produce a credential starting from a credential request\n\n```go\nfunc (o *IdemixCredentialSignerOpts) HashFunc() crypto.Hash\n```\nHashFunc returns an identifier for the hash function used to produce the message passed to Signer.Sign, or else zero to indicate that no hashing was done.\n\n```go\nfunc (o *IdemixCredentialSignerOpts) IssuerPublicKey() Key\n```\n\n```go\ntype IdemixIIssuerPublicKeyImporterErrorType int\n```\n\n```go\nconst (\n\tIdemixIssuerPublicKeyImporterUnmarshallingError IdemixIIssuerPublicKeyImporterErrorType = iota\n\tIdemixIssuerPublicKeyImporterHashError\n\tIdemixIssuerPublicKeyImporterValidationError\n\tIdemixIssuerPublicKeyImporterNumAttributesError\n\tIdemixIssuerPublicKeyImporterAttributeNameError\n)\n```\n\n```go\ntype IdemixIssuerKeyGenOpts struct {\n\t// Temporary tells if the key is ephemeral\n\tTemporary bool\n\t// AttributeNames is a list of attributes\n\tAttributeNames []string\n}\n```\nIdemixIssuerKeyGenOpts contains the options for the Idemix Issuer key-generation. A list of attribytes may be optionally passed\n\n```go\nfunc (*IdemixIssuerKeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (o *IdemixIssuerKeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype IdemixIssuerPublicKeyImportOpts struct {\n\tTemporary bool\n\t// AttributeNames is a list of attributes to ensure the import public key has\n\tAttributeNames []string\n}\n```\nIdemixIssuerPublicKeyImportOpts contains the options for importing of an Idemix issuer public key.\n\n```go\nfunc (*IdemixIssuerPublicKeyImportOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (o *IdemixIssuerPublicKeyImportOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype IdemixIssuerPublicKeyImporterError struct {\n\tType     IdemixIIssuerPublicKeyImporterErrorType\n\tErrorMsg string\n\tCause    error\n}\n```\n\n```go\nfunc (r *IdemixIssuerPublicKeyImporterError) Error() string\n```\n\n```go\ntype IdemixNymKeyDerivationOpts struct {\n\t// Temporary tells if the key is ephemeral\n\tTemporary bool\n\t// IssuerPK is the public-key of the issuer\n\tIssuerPK Key\n}\n```\nIdemixNymKeyDerivationOpts contains the options to create a new unlinkable pseudonym from a credential secret key with the respect to the specified issuer public key\n\n```go\nfunc (*IdemixNymKeyDerivationOpts) Algorithm() string\n```\nAlgorithm returns the key derivation algorithm identifier (to be used).\n\n```go\nfunc (o *IdemixNymKeyDerivationOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to derive has to be ephemeral, false otherwise.\n\n```go\nfunc (o *IdemixNymKeyDerivationOpts) IssuerPublicKey() Key\n```\nIssuerPublicKey returns the issuer public key used to derive a new unlinkable pseudonym from a credential secret key\n\n```go\ntype IdemixNymPublicKeyImportOpts struct {\n\t// Temporary tells if the key is ephemeral\n\tTemporary bool\n}\n```\nIdemixNymPublicKeyImportOpts contains the options to import the public part of a pseudonym\n\n```go\nfunc (*IdemixNymPublicKeyImportOpts) Algorithm() string\n```\nAlgorithm returns the key derivation algorithm identifier (to be used).\n\n```go\nfunc (o *IdemixNymPublicKeyImportOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to derive has to be ephemeral, false otherwise.\n\n```go\ntype IdemixNymSignerOpts struct {\n\t// Nym is the pseudonym to be used\n\tNym Key\n\t// IssuerPK is the public-key of the issuer\n\tIssuerPK Key\n\t// H is the hash function to be used\n\tH crypto.Hash\n}\n```\nIdemixNymSignerOpts contains the options to generate an idemix pseudonym signature.\n\n```go\nfunc (o *IdemixNymSignerOpts) HashFunc() crypto.Hash\n```\nHashFunc returns an identifier for the hash function used to produce the message passed to Signer.Sign, or else zero to indicate that no hashing was done.\n\n```go\ntype IdemixRevocationKeyGenOpts struct {\n\t// Temporary tells if the key is ephemeral\n\tTemporary bool\n}\n```\nIdemixRevocationKeyGenOpts contains the options for the Idemix revocation key-generation.\n\n```go\nfunc (*IdemixRevocationKeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (o *IdemixRevocationKeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype IdemixRevocationPublicKeyImportOpts struct {\n\tTemporary bool\n}\n```\nIdemixRevocationPublicKeyImportOpts contains the options for importing of an Idemix revocation public key.\n\n```go\nfunc (*IdemixRevocationPublicKeyImportOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (o *IdemixRevocationPublicKeyImportOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype IdemixSignerOpts struct {\n\t// Nym is the pseudonym to be used\n\tNym Key\n\t// IssuerPK is the public-key of the issuer\n\tIssuerPK Key\n\t// Credential is the byte representation of the credential signed by the issuer\n\tCredential []byte\n\t// Attributes specifies which attribute should be disclosed and which not.\n\t// If Attributes[i].Type = IdemixHiddenAttribute\n\t// then the i-th credential attribute should not be disclosed, otherwise the i-th\n\t// credential attribute will be disclosed.\n\t// At verification time, if the i-th attribute is disclosed (Attributes[i].Type != IdemixHiddenAttribute),\n\t// then Attributes[i].Value must be set accordingly.\n\tAttributes []IdemixAttribute\n\t// RhIndex is the index of attribute containing the revocation handler.\n\t// Notice that this attributed cannot be discloused\n\tRhIndex int\n\t// CRI contains the credential revocation information\n\tCRI []byte\n\t// Epoch is the revocation epoch the signature should be produced against\n\tEpoch int\n\t// RevocationPublicKey is the revocation public key\n\tRevocationPublicKey Key\n\t// H is the hash function to be used\n\tH crypto.Hash\n}\n```\nIdemixSignerOpts contains the options to generate an Idemix signature\n\n```go\nfunc (o *IdemixSignerOpts) HashFunc() crypto.Hash\n```\n\n```go\ntype IdemixUserSecretKeyGenOpts struct {\n\tTemporary bool\n}\n```\nIdemixUserSecretKeyGenOpts contains the options for the generation of an Idemix credential secret key.\n\n```go\nfunc (*IdemixUserSecretKeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (o *IdemixUserSecretKeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype IdemixUserSecretKeyImportOpts struct {\n\tTemporary bool\n}\n```\nIdemixUserSecretKeyImportOpts contains the options for importing of an Idemix credential secret key.\n\n```go\nfunc (*IdemixUserSecretKeyImportOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (o *IdemixUserSecretKeyImportOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype Key interface {\n\n\t// Bytes converts this key to its byte representation,\n\t// if this operation is allowed.\n\tBytes() ([]byte, error)\n\n\t// SKI returns the subject key identifier of this key.\n\tSKI() []byte\n\n\t// Symmetric returns true if this key is a symmetric key,\n\t// false is this key is asymmetric\n\tSymmetric() bool\n\n\t// Private returns true if this key is a private key,\n\t// false otherwise.\n\tPrivate() bool\n\n\t// PublicKey returns the corresponding public key part of an asymmetric public/private key pair.\n\t// This method returns an error in symmetric key schemes.\n\tPublicKey() (Key, error)\n}\n```\nKey represents a cryptographic key\n\n```go\ntype KeyDerivOpts interface {\n\n\t// Algorithm returns the key derivation algorithm identifier (to be used).\n\tAlgorithm() string\n\n\t// Ephemeral returns true if the key to derived has to be ephemeral,\n\t// false otherwise.\n\tEphemeral() bool\n}\n```\nKeyDerivOpts contains options for key-derivation with a CSP.\n\n```go\ntype KeyGenOpts interface {\n\n\t// Algorithm returns the key generation algorithm identifier (to be used).\n\tAlgorithm() string\n\n\t// Ephemeral returns true if the key to generate has to be ephemeral,\n\t// false otherwise.\n\tEphemeral() bool\n}\n```\nKeyGenOpts contains options for key-generation with a CSP.\n\n```go\ntype KeyImportOpts interface {\n\n\t// Algorithm returns the key importation algorithm identifier (to be used).\n\tAlgorithm() string\n\n\t// Ephemeral returns true if the key generated has to be ephemeral,\n\t// false otherwise.\n\tEphemeral() bool\n}\n```\nKeyImportOpts contains options for importing the raw material of a key with a CSP.\n\n```go\ntype KeyStore interface {\n\n\t// ReadOnly returns true if this KeyStore is read only, false otherwise.\n\t// If ReadOnly is true then StoreKey will fail.\n\tReadOnly() bool\n\n\t// GetKey returns a key object whose SKI is the one passed.\n\tGetKey(ski []byte) (k Key, err error)\n\n\t// StoreKey stores the key k in this KeyStore.\n\t// If this KeyStore is read only then the method will fail.\n\tStoreKey(k Key) (err error)\n}\n```\nKeyStore represents a storage system for cryptographic keys. It allows to store and retrieve bccsp.Key objects. The KeyStore can be read only, in that case StoreKey will return an error.\n\n```go\ntype RSA1024KeyGenOpts struct {\n\tTemporary bool\n}\n```\nRSA1024KeyGenOpts contains options for RSA key generation at 1024 security.\n\n```go\nfunc (opts *RSA1024KeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *RSA1024KeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype RSA2048KeyGenOpts struct {\n\tTemporary bool\n}\n```\nRSA2048KeyGenOpts contains options for RSA key generation at 2048 security.\n\n```go\nfunc (opts *RSA2048KeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *RSA2048KeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype RSA3072KeyGenOpts struct {\n\tTemporary bool\n}\n```\nRSA3072KeyGenOpts contains options for RSA key generation at 3072 security.\n\n```go\nfunc (opts *RSA3072KeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *RSA3072KeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype RSA4096KeyGenOpts struct {\n\tTemporary bool\n}\n```\nRSA4096KeyGenOpts contains options for RSA key generation at 4096 security.\n\n```go\nfunc (opts *RSA4096KeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *RSA4096KeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype RSAGoPublicKeyImportOpts struct {\n\tTemporary bool\n}\n```\nECDSAGoPublicKeyImportOpts contains options for RSA key importation from rsa.PublicKey\n\n```go\nfunc (opts *RSAGoPublicKeyImportOpts) Algorithm() string\n```\nAlgorithm returns the key importation algorithm identifier (to be used).\n\n```go\nfunc (opts *RSAGoPublicKeyImportOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype RSAKeyGenOpts struct {\n\tTemporary bool\n}\n```\nRSAKeyGenOpts contains options for RSA key generation.\n\n```go\nfunc (opts *RSAKeyGenOpts) Algorithm() string\n```\nAlgorithm returns the key generation algorithm identifier (to be used).\n\n```go\nfunc (opts *RSAKeyGenOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n```go\ntype RevocationAlgorithm int32\n```\nRevocationAlgorithm identifies the revocation algorithm\n\n```go\nconst (\n\t// AlgNoRevocation means no revocation support\n\tAlgNoRevocation RevocationAlgorithm = iota\n)\n```\n\n```go\ntype SHA256Opts struct {\n}\n```\nSHA256Opts contains options relating to SHA-256.\n\n```go\nfunc (opts *SHA256Opts) Algorithm() string\n```\nAlgorithm returns the hash algorithm identifier (to be used).\n\n```go\ntype SHA384Opts struct {\n}\n```\nSHA384Opts contains options relating to SHA-384.\n\n```go\nfunc (opts *SHA384Opts) Algorithm() string\n```\nAlgorithm returns the hash algorithm identifier (to be used).\n\n```go\ntype SHA3_256Opts struct {\n}\n```\nSHA3\\_256Opts contains options relating to SHA3-256.\n\n```go\nfunc (opts *SHA3_256Opts) Algorithm() string\n```\nAlgorithm returns the hash algorithm identifier (to be used).\n\n```go\ntype SHA3_384Opts struct {\n}\n```\nSHA3\\_384Opts contains options relating to SHA3-384.\n\n```go\nfunc (opts *SHA3_384Opts) Algorithm() string\n```\nAlgorithm returns the hash algorithm identifier (to be used).\n\n```go\ntype SHAOpts struct {\n}\n```\nSHAOpts contains options for computing SHA.\n\n```go\nfunc (opts *SHAOpts) Algorithm() string\n```\nAlgorithm returns the hash algorithm identifier (to be used).\n\n```go\ntype SignerOpts interface {\n\tcrypto.SignerOpts\n}\n```\nSignerOpts contains options for signing with a CSP.\n\n```go\ntype X509PublicKeyImportOpts struct {\n\tTemporary bool\n}\n```\nX509PublicKeyImportOpts contains options for importing public keys from an x509 certificate\n\n```go\nfunc (opts *X509PublicKeyImportOpts) Algorithm() string\n```\nAlgorithm returns the key importation algorithm identifier (to be used).\n\n```go\nfunc (opts *X509PublicKeyImportOpts) Ephemeral() bool\n```\nEphemeral returns true if the key to generate has to be ephemeral, false otherwise.\n\n","path":"github.com/eric-erki/https-hyperledger.org/bccsp","name":"bccsp","synopsis":"","isRedistributable":true}
