cry

package
v0.0.0-...-2f2a033 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMalformedPem = errors.New("malformed pem")
)

Functions

func ParseBase64PKCS1PrivateKey

func ParseBase64PKCS1PrivateKey(s string) (priv *rsa.PrivateKey, err error)

ParseBase64PKCS1PrivateKey ...

func ParseBase64PKCS8PrivateKey

func ParseBase64PKCS8PrivateKey(s string) (priv *rsa.PrivateKey, err error)

ParseBase64PKCS8PrivateKey ...

func ParseBase64PKIXPublicKey

func ParseBase64PKIXPublicKey(s string) (pub *rsa.PublicKey, err error)

ParseBase64PKIXPublicKey ...

func ParsePemPKCS1PrivateKey

func ParsePemPKCS1PrivateKey(s string) (priv *rsa.PrivateKey, err error)

ParsePemPKCS1PrivateKey ...

func ParsePemPKCS8PrivateKey

func ParsePemPKCS8PrivateKey(s string) (priv *rsa.PrivateKey, err error)

ParsePemPKCS8PrivateKey ...

func ParsePemPKIXPublicKey

func ParsePemPKIXPublicKey(s string) (pub *rsa.PublicKey, err error)

ParsePemPKIXPublicKey ...

func RsaSignWithHash

func RsaSignWithHash(content string, hash crypto.Hash, priv *rsa.PrivateKey) (string, error)

RsaSignWithHash ...

func VerifyKeyPair

func VerifyKeyPair(priv *rsa.PrivateKey, pub *rsa.PublicKey) error

VerifyKeyPair ...

func VerifyRsaSignWithHash

func VerifyRsaSignWithHash(content, sign string, hash crypto.Hash, pub *rsa.PublicKey) error

VerifyRsaSignWithHash ...

Types

type RsaKeyPair

type RsaKeyPair struct {
	Priv         *rsa.PrivateKey
	Pub          *rsa.PublicKey
	PrivPKCS1Pem string
	PubPKIXPem   string
}

RsaKeyPair ...

func GenRsaKey

func GenRsaKey(bits int) (*RsaKeyPair, error)

GenRsaKey ...

Jump to

Keyboard shortcuts

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