Documentation ¶
Overview ¶
Package pkcs7 provides signing based on RFC 2315.
Index ¶
- func Sign(r io.Reader, cert *x509.Certificate, priv *rsa.PrivateKey) ([]byte, error)
- func Sign2(r io.Reader, cert *x509.Certificate, priv *rsa.PrivateKey, ...) ([]byte, error)
- type AlgorithmIdentifier
- type Attribute
- type Attributes
- type ContentInfo
- type IssuerAndSerialNumber
- type SignedData
- type SignedDataWrapper
- type SignerInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Sign ¶
func Sign(r io.Reader, cert *x509.Certificate, priv *rsa.PrivateKey) ([]byte, error)
Sign data with cert & private key.
func Sign2 ¶
func Sign2(r io.Reader, cert *x509.Certificate, priv *rsa.PrivateKey, intermediate *x509.Certificate) ([]byte, error)
Sign2 reader with a cert, private key, and intermediate cert.
Types ¶
type AlgorithmIdentifier ¶
type AlgorithmIdentifier struct { Algorithm asn1.ObjectIdentifier Parameters asn1.RawValue }
type Attribute ¶
type Attribute struct { Type asn1.ObjectIdentifier Values []interface{} `asn1:"set"` }
func NewAttribute ¶
func NewAttribute(typ asn1.ObjectIdentifier, val interface{}) Attribute
type Attributes ¶
type Attributes []Attribute
type ContentInfo ¶
type ContentInfo struct { ContentType asn1.ObjectIdentifier Content asn1.RawValue `asn1:"optional"` }
type IssuerAndSerialNumber ¶
type SignedData ¶
type SignedData struct { Version int DigestAlgorithms []AlgorithmIdentifier `asn1:"set"` ContentInfo ContentInfo Certificates asn1.RawValue `asn1:"optional"` Crls asn1.RawValue `asn1:"optional"` SignerInfos []SignerInfo `asn1:"set"` }
type SignedDataWrapper ¶
type SignedDataWrapper struct { Oid asn1.ObjectIdentifier SignedData asn1.RawValue }
type SignerInfo ¶
type SignerInfo struct { Version int SignedIdentifier IssuerAndSerialNumber DigestAlgorithm AlgorithmIdentifier AuthenticatedAttributes Attributes `asn1:"tag:0"` DigestEncryptionAlgorithm AlgorithmIdentifier EncryptedDigest []byte UnauthenticatedAttributes int `asn1:"optional"` }
Click to show internal directories.
Click to hide internal directories.