smime

package
v0.0.0-...-a8a18e3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2024 License: Unlicense Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parse

func Parse(data []byte) (ret interface{}, err error)

Types

type Attribute

type Attribute struct {
	Type   asn1.ObjectIdentifier
	Values [][]byte
}

type Data

type Data []byte

type EncryptionAlgorithm

type EncryptionAlgorithm int
const (
	UnknownEncryptionAlgorithm EncryptionAlgorithm = iota
	RSA
	RC2_CBC
	RC4
	DES_EDE3_CBC
	RC5_CBC_Pad
	ID_DES_CDMF
)

type IssuerAndSerialNumber

type IssuerAndSerialNumber struct {
	Issuer       pkix.Name
	SerialNumber *big.Int
}

func (IssuerAndSerialNumber) Matches

func (sid IssuerAndSerialNumber) Matches(cert *x509.Certificate) bool

type SignedData

type SignedData struct {
	Version          int
	DigestAlgorithms []pkix.AlgorithmIdentifier

	ContentType asn1.ObjectIdentifier
	Content     []byte

	Certificates []*x509.Certificate
	CRLs         []*pkix.CertificateList

	Signers []*Signer
}

func (*SignedData) CheckSignature

func (s *SignedData) CheckSignature() (err error)

type Signer

type Signer struct {
	Id SignerId

	RawSignedAttributes []byte
	SignedAttributes    []Attribute
	UnsignedAttributes  []Attribute

	DigestAlgorithm    pkix.AlgorithmIdentifier
	SignatureAlgorithm pkix.AlgorithmIdentifier

	Signature []byte
}

type SignerId

type SignerId interface {
	Matches(*x509.Certificate) bool
}

Either IssuerAndSerialNumber or SubjectKeyIdentifier

type SubjectKeyIdentifier

type SubjectKeyIdentifier []byte

func (SubjectKeyIdentifier) Matches

func (sid SubjectKeyIdentifier) Matches(cert *x509.Certificate) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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