Select Git revision
-
Angelo De Caro authored
This change-set moves the BCCSP package under fabric/ Refenreces to the BCCSP package have been updated to reflect the new path. Change-Id: I0a5e6d9c49d8f8099aaa8b21258937d83c2b40d9 Signed-off-by:
Angelo De Caro <adc@zurich.ibm.com>
Angelo De Caro authoredThis change-set moves the BCCSP package under fabric/ Refenreces to the BCCSP package have been updated to reflect the new path. Change-Id: I0a5e6d9c49d8f8099aaa8b21258937d83c2b40d9 Signed-off-by:
Angelo De Caro <adc@zurich.ibm.com>
bccsp.go 4.59 KiB
/*
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.
*/
package bccsp
import (
"crypto"
"hash"
)
// Key represents a cryptographic key
type Key interface {
// Bytes converts this key to its byte representation,
// if this operation is allowed.
Bytes() ([]byte, error)
// SKI returns the subject key identifier of this key.
SKI() []byte
// Symmetric returns true if this key is a symmetric key,
// false is this key is asymmetric
Symmetric() bool
// Private returns true if this key is a private key,
// false otherwise.
Private() bool
// PublicKey returns the corresponding public key part of an asymmetric public/private key pair.
// This method returns an error in symmetric key schemes.
PublicKey() (Key, error)
}
// KeyGenOpts contains options for key-generation with a CSP.
type KeyGenOpts interface {
// Algorithm returns the key generation algorithm identifier (to be used).
Algorithm() string
// Ephemeral returns true if the key to generate has to be ephemeral,
// false otherwise.
Ephemeral() bool
}
// KeyDerivOpts contains options for key-derivation with a CSP.
type KeyDerivOpts interface {
// Algorithm returns the key derivation algorithm identifier (to be used).
Algorithm() string
// Ephemeral returns true if the key to derived has to be ephemeral,
// false otherwise.
Ephemeral() bool
}
// KeyImportOpts contains options for importing the raw material of a key with a CSP.
type KeyImportOpts interface {