x509

package
v0.0.0-...-9b5a78d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: Apache-2.0 Imports: 13 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 NewSignerInfoFromCert

func NewSignerInfoFromCert(cert *x509.Certificate) *common.SignerInfo

func NewSignerInfoFromPKIXName

func NewSignerInfoFromPKIXName(dn pkix.Name) *common.SignerInfo

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, certPathList []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