utils

package
v0.0.0-...-95b87ed Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AEStoEncryptedPEM

func AEStoEncryptedPEM(raw []byte, pwd []byte) ([]byte, error)

func AEStoPEM

func AEStoPEM(raw []byte) []byte

func Clone

func Clone(src []byte) []byte

func DERToPrivateKey

func DERToPrivateKey(der []byte) (key interface{}, err error)

func DERToPublicKey

func DERToPublicKey(raw []byte) (pub interface{}, err error)

func DERToX509Certificate

func DERToX509Certificate(asn1Data []byte) (*x509.Certificate, error)

func DirEmpty

func DirEmpty(path string) (bool, error)

func DirExists

func DirExists(path string) (bool, error)

func DirMissingOrEmpty

func DirMissingOrEmpty(path string) (bool, error)

func ErrToString

func ErrToString(err error) string

func GetCurveHalfOrdersAt

func GetCurveHalfOrdersAt(c elliptic.Curve) *big.Int

func IsLowS

func IsLowS(k *ecdsa.PublicKey, s *big.Int) (bool, error)

func MarshalECDSASignature

func MarshalECDSASignature(r, s *big.Int) ([]byte, error)

func PEMtoAES

func PEMtoAES(raw []byte, pwd []byte) ([]byte, error)

func PEMtoPrivateKey

func PEMtoPrivateKey(raw []byte, pwd []byte) (interface{}, error)

func PEMtoPublicKey

func PEMtoPublicKey(raw []byte, pwd []byte) (interface{}, error)

func PrivateKeyToDER

func PrivateKeyToDER(privateKey *ecdsa.PrivateKey) ([]byte, error)

func PrivateKeyToEncryptedPEM

func PrivateKeyToEncryptedPEM(privateKey interface{}, pwd []byte) ([]byte, error)

func PrivateKeyToPEM

func PrivateKeyToPEM(privateKey interface{}, pwd []byte) ([]byte, error)

func PublicKeyToDER

func PublicKeyToDER(publicKey interface{}) ([]byte, error)

func PublicKeyToEncryptedPEM

func PublicKeyToEncryptedPEM(publicKey interface{}, pwd []byte) ([]byte, error)

func PublicKeyToPEM

func PublicKeyToPEM(publicKey interface{}, pwd []byte) ([]byte, error)

func SignatureToLowS

func SignatureToLowS(k *ecdsa.PublicKey, signature []byte) ([]byte, error)

func ToLowS

func ToLowS(k *ecdsa.PublicKey, s *big.Int) (*big.Int, bool, error)

func UnmarshalECDSASignature

func UnmarshalECDSASignature(raw []byte) (*big.Int, *big.Int, error)

Types

type ECDSASignature

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

Jump to

Keyboard shortcuts

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