...
1 package schema1
2
3 import (
4 "crypto/x509"
5
6 "github.com/docker/libtrust"
7 "github.com/sirupsen/logrus"
8 )
9
10
11
12 func Verify(sm *SignedManifest) ([]libtrust.PublicKey, error) {
13 js, err := libtrust.ParsePrettySignature(sm.all, "signatures")
14 if err != nil {
15 logrus.WithField("err", err).Debugf("(*SignedManifest).Verify")
16 return nil, err
17 }
18
19 return js.Verify()
20 }
21
22
23
24
25 func VerifyChains(sm *SignedManifest, ca *x509.CertPool) ([][]*x509.Certificate, error) {
26 js, err := libtrust.ParsePrettySignature(sm.all, "signatures")
27 if err != nil {
28 return nil, err
29 }
30
31 return js.VerifyChains(ca)
32 }
33
View as plain text