func (k *ecdsaPublicKey) SKI() []byte {
	if k.pubKey == nil {
		return nil
	}
	raw := elliptic.Marshal(k.pubKey.Curve, k.pubKey.X, k.pubKey.Y)
	hash := sha256.New()
	hash.Write(raw)
	return hash.Sum(nil)
}
SKI returns the subject key identifier of this key.
package sw
import (
	"crypto/ecdsa"
	"crypto/elliptic"
	"crypto/sha256"
	"crypto/x509"
	"encoding/pem"
	"errors"
	"fmt"
	"github.com/kfsoftware/hlf-operator/internal/github.com/hyperledger/fabric/bccsp"
)
type ecdsaPrivateKey struct {
	privKey    *ecdsa.PrivateKey
	exportable bool
}
func (k *ecdsaPrivateKey) Bytes() ([]byte, error) {
	if !k.exportable {
		return nil, errors.New("not supported")
	}
	x509Encoded, err := x509.MarshalECPrivateKey(k.privKey)
	if err != nil {
		return nil, err
	}
	pemEncoded := pem.EncodeToMemory(&pem.Block{Type: "PRIVATE KEY", Bytes: x509Encoded})
	return pemEncoded, nil
}
func (k *ecdsaPrivateKey) SKI() []byte {
	if k.privKey == nil {
		return nil
	}
	raw := elliptic.Marshal(k.privKey.Curve, k.privKey.PublicKey.X, k.privKey.PublicKey.Y)
	hash := sha256.New()
	hash.Write(raw)
	return hash.Sum(nil)
}
func (k *ecdsaPrivateKey) Symmetric() bool {
	return false
}
func (k *ecdsaPrivateKey) Private() bool {
	return true
}
func (k *ecdsaPrivateKey) PublicKey() (bccsp.Key, error) {
	return &ecdsaPublicKey{&k.privKey.PublicKey}, nil
}
type ecdsaPublicKey struct {
	pubKey *ecdsa.PublicKey
}
func (k *ecdsaPublicKey) Bytes() (raw []byte, err error) {
	raw, err = x509.MarshalPKIXPublicKey(k.pubKey)
	if err != nil {
		return nil, fmt.Errorf("Failed marshalling key [%s]", err)
	}
	return
}