...

Package appmanifest

import "github.com/sassoftware/relic/lib/appmanifest"
Overview
Index

Overview ▾

Constants

const (
    NsMsRel        = "http://schemas.microsoft.com/windows/rel/2005/reldata"
    NsMpeg21       = "urn:mpeg:mpeg21:2003:01-REL-R-NS"
    NsAuthenticode = "http://schemas.microsoft.com/windows/pki/2005/Authenticode"
)

func PublicKeyToSnk

func PublicKeyToSnk(pubKey crypto.PublicKey) ([]byte, error)

Convert public key to "snk" format

func PublicKeyToken

func PublicKeyToken(pubKey crypto.PublicKey) (string, error)

Calculate the publicKeyToken from a public key. This involves mangling it into a .snk file format, then hashing it.

http://www.developerfusion.com/article/84422/the-key-to-strong-names/

func PublisherIdentity

func PublisherIdentity(cert *certloader.Certificate) (string, string, error)

func VerifyTimestamp

func VerifyTimestamp(timestamp *pkcs7.ContentInfoSignedData, encryptedDigest []byte, extraCerts []*x509.Certificate) (*pkcs9.CounterSignature, error)

type ManifestSignature

type ManifestSignature struct {
    Signature       *pkcs9.TimestampedSignature
    Hash            crypto.Hash
    AssemblyName    string
    AssemblyVersion string
    PublicKeyToken  string
}

func Verify

func Verify(manifest []byte) (*ManifestSignature, error)

Extract and verify signature on an application manifest. Does not verify X509 chains.

type SignedManifest

type SignedManifest struct {
    ManifestSignature
    Signed          []byte
    EncryptedDigest []byte
}

func Sign

func Sign(manifest []byte, cert *certloader.Certificate, opts crypto.SignerOpts) (*SignedManifest, error)

Sign an application manifest

func (*SignedManifest) AddTimestamp

func (m *SignedManifest) AddTimestamp(token *pkcs7.ContentInfoSignedData) error

Attach a timestamp counter-signature