-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change-sets removes all dependencies to the crytpo/primitives package from the msp package. The MSP uses now only the BCCSP for its cryptographic operations. This change-sets also removes all dependencies to the primitives.Hash function. The BCCSP is used to replace thos calls. Change-Id: Ia1432fac29745bb4f42b9acb8334caf69f115b3d Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
- Loading branch information
Showing
8 changed files
with
92 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package sw | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/hyperledger/fabric/core/crypto/bccsp" | ||
) | ||
|
||
// DummyKeyStore is a read-only KeyStore that neither loads nor stores keys. | ||
type DummyKeyStore struct { | ||
} | ||
|
||
// ReadOnly returns true if this KeyStore is read only, false otherwise. | ||
// If ReadOnly is true then StoreKey will fail. | ||
func (ks *DummyKeyStore) ReadOnly() bool { | ||
return true | ||
} | ||
|
||
// GetKey returns a key object whose SKI is the one passed. | ||
func (ks *DummyKeyStore) GetKey(ski []byte) (k bccsp.Key, err error) { | ||
return nil, errors.New("Key not found. This is a dummy KeyStore") | ||
} | ||
|
||
// StoreKey stores the key k in this KeyStore. | ||
// If this KeyStore is read only then the method will fail. | ||
func (ks *DummyKeyStore) StoreKey(k bccsp.Key) (err error) { | ||
return errors.New("Cannot store key. This is a dummy read-only KeyStore") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters