cert4go

package module
v0.0.0-...-56765ee Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 6 Imported by: 0

README

cert4go

GoDoc Go.Dev reference codecov Action Status Go Report Card Licence Tag

Features

Usage

Installation

Use go get.

    go get github.com/things-go/cert4go

Then import the modbus package into your own code.

    import "github.com/things-go/cert4go"
Example

References

License

This project is under MIT License. See the LICENSE file for the full license text.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotPEMEncodedKey = errors.New("cert4go: key must be PEM encoded PKCS1 or PKCS8 private key")
	ErrNotRSAPrivateKey = errors.New("cert4go: key is not a valid RSA private key")
	ErrNotRSAPublicKey  = errors.New("cert4go: key is not a valid RSA public key")
	ErrNotCertificate   = errors.New("cert4go: key is not a valid certificate")
	ErrNotRSAPfxData    = errors.New("cert4go: pfx data not a valid data")
)

Functions

func LoadPfxFromFile

func LoadPfxFromFile(name, password string) (*rsa.PrivateKey, *x509.Certificate, error)

func LoadRSAPKCS1PrivateKeyFromPEMFile

func LoadRSAPKCS1PrivateKeyFromPEMFile(name string) (*rsa.PrivateKey, error)

func LoadRSAPKCS8PrivateKeyFromPEMFile

func LoadRSAPKCS8PrivateKeyFromPEMFile(name string) (*rsa.PrivateKey, error)

func LoadRSAPrivateKeyFromFile

func LoadRSAPrivateKeyFromFile(name string) (*rsa.PrivateKey, error)

func LoadRSAPrivateKeyFromPEMFile

func LoadRSAPrivateKeyFromPEMFile(name string) (*rsa.PrivateKey, error)

func LoadRSAPublicKeyFromFile

func LoadRSAPublicKeyFromFile(name string) (*rsa.PublicKey, error)

func LoadRSAPublicKeyFromPEMFile

func LoadRSAPublicKeyFromPEMFile(name string) (*rsa.PublicKey, error)

func ParseCertificate

func ParseCertificate(key []byte) (*x509.Certificate, error)

func ParseCertificateFromPEM

func ParseCertificateFromPEM(key []byte) (*x509.Certificate, error)

func ParsePfx

func ParsePfx(pfxData []byte, password string) (*rsa.PrivateKey, *x509.Certificate, error)

func ParseRSAPKCS1PrivateKeyFromPEM

func ParseRSAPKCS1PrivateKeyFromPEM(key []byte, password ...string) (*rsa.PrivateKey, error)

ParseRSAPKCS1PrivateKeyFromPEM PEM encoded PKCS1 private key if password exist,PEM encoded PKCS1 private key protected with password, it will decode with password

func ParseRSAPKCS8PrivateKeyFromPEM

func ParseRSAPKCS8PrivateKeyFromPEM(key []byte, password ...string) (*rsa.PrivateKey, error)

ParseRSAPKCS8PrivateKeyFromPEM PEM encoded PKCS8 private key if password exist,PEM encoded PKCS8 private key protected with password, it will decode with password

func ParseRSAPrivateKey

func ParseRSAPrivateKey(key []byte, password ...string) (*rsa.PrivateKey, error)

ParseRSAPrivateKey parse public key

  • Pem format PKCS1 or PKCS8 public key if password exist,PEM encoded PKCS1 or PKCS8 private key protected with password, it will decode with password
  • PKIX, ASN.1 DER form public key

func ParseRSAPrivateKeyFromPEM

func ParseRSAPrivateKeyFromPEM(key []byte, password ...string) (*rsa.PrivateKey, error)

ParseRSAPrivateKeyFromPEM PEM encoded PKCS1 or PKCS8 private key if password exist,PEM encoded PKCS1 or PKCS8 private key protected with password, it will decode with password

func ParseRSAPublicKey

func ParseRSAPublicKey(key []byte, password ...string) (*rsa.PublicKey, error)

ParseRSAPublicKey parse public key - Pem format PKCS1 or PKCS8 public key - PKIX, ASN.1 DER form public key

func ParseRSAPublicKeyFromPEM

func ParseRSAPublicKeyFromPEM(key []byte, password ...string) (*rsa.PublicKey, error)

ParseRSAPublicKeyFromPEM parse public key - Pem format PKCS1 or PKCS8 public key

Types

This section is empty.

Jump to

Keyboard shortcuts

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