-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-7513] MSP-like key and cert storage
This change introduces a key value store that supports MSP-like directory structure, the same that is currently used for pre-enrolled users (generated by the cryptogen tool). Also, the CredentialManager is modified to use this type of store for user private keys (in case of SW crypto provider) and user certs. Change-Id: I7e3dcd07d14354deb35514ee9275b88a5e9055ae Signed-off-by: Aleksandar Likic <aleksandar.likic@securekey.com>
- Loading branch information
Aleksandar Likic
committed
Feb 6, 2018
1 parent
4c64194
commit e50cd25
Showing
27 changed files
with
695 additions
and
262 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,34 @@ | ||
/* | ||
Copyright SecureKey Technologies Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package kvstore | ||
|
||
import "github.com/pkg/errors" | ||
|
||
var ( | ||
// ErrNotFound indicates that a value for the key does not exist | ||
ErrNotFound = errors.New("value for key not found") | ||
) | ||
|
||
// KVStore is a generic key-value store interface. | ||
type KVStore interface { | ||
|
||
/** | ||
* Store sets the value for the key. | ||
*/ | ||
Store(key interface{}, value interface{}) error | ||
|
||
/** | ||
* Load returns the value stored in the store for a key. | ||
* If a value for the key was not found, returns (nil, ErrNotFound) | ||
*/ | ||
Load(key interface{}) (interface{}, error) | ||
|
||
/** | ||
* Delete deletes the value for a key. | ||
*/ | ||
Delete(key interface{}) error | ||
} |
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
Oops, something went wrong.