pkix

package
v0.0.0-...-320551d Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PEMTypePrivateKey  string = "RSA PRIVATE KEY"
	PEMTypePublicKey   string = "PUBLIC KEY"
	PEMTypeCertificate string = "CERTIFICATE"
)

Variables

This section is empty.

Functions

func CreateCertificate

func CreateCertificate(caName string, parentCertPemBytes, parentPrivateKeyPemBytes []byte) ([]byte, []byte, []byte, error)

func GenerateKeyPair

func GenerateKeyPair() (*rsa.PrivateKey, crypto.PublicKey, error)

func GenerateSignature

func GenerateSignature(msg, prvKeyPemBytes []byte) ([]byte, error)

func GetPublicKeyFromCertificate

func GetPublicKeyFromCertificate(certPemBytes []byte) ([]byte, error)

func GetSubjectFromCertificate

func GetSubjectFromCertificate(certPemBytes []byte) (pkix.Name, error)

func PEMDecode

func PEMDecode(pemBytes []byte, mode string) []byte

func PEMEncode

func PEMEncode(content []byte, mode string) []byte

func ParseCertificate

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

func VerifyCertificate

func VerifyCertificate(certPemBytes []byte, certDir string) (bool, string, error)

func VerifySignature

func VerifySignature(msg, sig, pubKeyBytes []byte) (bool, string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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