cryptoutil

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrivateKeyFromCert

func GetPrivateKeyFromCert(cert []byte, cs core.CryptoSuite) (core.Key, error)

GetPrivateKeyFromCert will return private key represented by SKI in cert's public key

func GetPublicKeyFromCert

func GetPublicKeyFromCert(cert []byte, cs core.CryptoSuite) (core.Key, error)

GetPublicKeyFromCert will return public key the from cert

func X509KeyPair

func X509KeyPair(certPEMBlock []byte, pk core.Key, cs core.CryptoSuite) (tls.Certificate, error)

sm2KeyPair will return cer/key pair used for mutual TLS

Types

type PrivateKey

type PrivateKey struct {
	// contains filtered or unexported fields
}

PrivateKey is signer implementation for golang client TLS

func (*PrivateKey) Public

func (priv *PrivateKey) Public() crypto.PublicKey

Public returns the public key corresponding to private key

func (*PrivateKey) Sign

func (priv *PrivateKey) Sign(rand io.Reader, msg []byte, opts crypto.SignerOpts) ([]byte, error)

Sign signs msg with priv, reading randomness from rand. If opts is a *PSSOptions then the PSS algorithm will be used, otherwise PKCS#1 v1.5 will be used. This method is intended to support keys where the private part is kept in, for example, a hardware module.

Jump to

Keyboard shortcuts

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