csp

package
v2.1.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2020 License: Apache-2.0 Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Copyright IBM Corp. All Rights Reserved.

SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GeneratePrivateKey

func GeneratePrivateKey(keystorePath string) (*ecdsa.PrivateKey, error)

GeneratePrivateKey creates an EC private key using a P-256 curve and stores it in keystorePath.

func LoadPrivateKey

func LoadPrivateKey(keystorePath string) (*ecdsa.PrivateKey, error)

LoadPrivateKey loads a private key from a file in keystorePath. It looks for a file ending in "_sk" and expects a PEM-encoded PKCS8 EC private key.

Types

type ECDSASignature

type ECDSASignature struct {
	R, S *big.Int
}

type ECDSASigner

type ECDSASigner struct {
	PrivateKey *ecdsa.PrivateKey
}

* ECDSA signer implements the crypto.Signer interface for ECDSA keys. The Sign method ensures signatures are created with Low S values since Fabric normalizes all signatures to Low S. See https://github.com/bitcoin/bips/blob/master/bip-0146.mediawiki#low_s for more detail.

func (*ECDSASigner) Public

func (e *ECDSASigner) Public() crypto.PublicKey

Public returns the ecdsa.PublicKey associated with PrivateKey.

func (*ECDSASigner) Sign

func (e *ECDSASigner) Sign(rand io.Reader, digest []byte, opts crypto.SignerOpts) ([]byte, error)

Sign signs the digest and ensures that signatures use the Low S value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL