Versions in this module Expand all Collapse all v1 v1.5.0 Jan 23, 2023 Changes in this version + const AlgorithmAttr + const ApplicationHeaderSgntrTag + const ApplicationHeaderTag + const CanonicalizationMethodTag + const DefaultIdAttr + const DefaultPrefix + const DigestMethodTag + const DigestValueTag + const InclusiveNamespacesTag + const KeyInfoTag + const Namespace + const PrefixListAttr + const RSASHA1SignatureMethod + const RSASHA256SignatureMethod + const RSASHA512SignatureMethod + const ReferenceTag + const SignatureMethodTag + const SignatureTag + const SignatureValueTag + const SignedInfoTag + const TransformTag + const TransformsTag + const URIAttr + const X509CertificateTag + const X509DataTag + const X509IssuerNameTag + const X509IssuerSerialTag + const X509SerialNumberTag + const X509SubjectNameTag + var ErrInvalidSignature = errors.New("Invalid Signature") + var ErrMissingCertificates = fmt.Errorf("No public certificates provided") + var ErrMissingSignature = errors.New("Missing signature referencing the top-level element") + var ErrNonRSAKey = fmt.Errorf("Private key was not RSA") + type AlgorithmID string + const CanonicalXML10ExclusiveAlgorithmId + const CanonicalXML10ExclusiveWithCommentsAlgorithmId + const CanonicalXML10RecAlgorithmId + const CanonicalXML10WithCommentsAlgorithmId + const CanonicalXML11AlgorithmId + const CanonicalXML11WithCommentsAlgorithmId + const EnvelopedSignatureAltorithmId + func (id AlgorithmID) String() string + type BahInfo struct + Head *etree.Element + Key *rsa.PrivateKey + UniqueDataId string + type BahValidateInfo struct + Cert *x509.Certificate + El *etree.Element + NewRefs []types.Reference + Signature *types.Signature + type Canonicalizer interface + Algorithm func() AlgorithmID + Canonicalize func(el *etree.Element) ([]byte, error) + func MakeC14N10ExclusiveCanonicalizerWithPrefixList(prefixList string) Canonicalizer + func MakeC14N10ExclusiveWithCommentsCanonicalizerWithPrefixList(prefixList string) Canonicalizer + func MakeC14N10RecCanonicalizer() Canonicalizer + func MakeC14N10WithCommentsCanonicalizer() Canonicalizer + func MakeC14N11Canonicalizer() Canonicalizer + func MakeC14N11WithCommentsCanonicalizer() Canonicalizer + func MakeNullCanonicalizer() Canonicalizer + type Clock struct + func NewFakeClock(wrapped clockwork.Clock) *Clock + func NewFakeClockAt(t time.Time) *Clock + func NewRealClock() *Clock + func (c *Clock) After(d time.Duration) <-chan time.Time + func (c *Clock) Now() time.Time + func (c *Clock) Sleep(d time.Duration) + type MemoryX509CertificateStore struct + Roots []*x509.Certificate + func (mX509cs *MemoryX509CertificateStore) Certificates() ([]*x509.Certificate, error) + type MemoryX509KeyStore struct + func (ks *MemoryX509KeyStore) GetKeyPair() (*rsa.PrivateKey, []byte, error) + type NullCanonicalizer struct + func (c *NullCanonicalizer) Algorithm() AlgorithmID + func (c *NullCanonicalizer) Canonicalize(el *etree.Element) ([]byte, error) + type SigningContext struct + Canonicalizer Canonicalizer + Hash crypto.Hash + IdAttribute string + KeyStore X509KeyStore + Prefix string + func NewDefaultSigningContext(ks X509KeyStore) *SigningContext + func NewRtpSigningContext(ks X509KeyStore) *SigningContext + func (ctx *SigningContext) BahChecking(el *etree.Element) (*etree.Element, *etree.Element, error) + func (ctx *SigningContext) BahSignEnveloped(el *etree.Element, uniqueDataId string) (*etree.Element, error) + func (ctx *SigningContext) ConstructBahSignature(bahInfo *BahInfo) (*etree.Element, error) + func (ctx *SigningContext) ConstructSignature(el *etree.Element, enveloped bool) (*etree.Element, error) + func (ctx *SigningContext) GetDigestAlgorithmIdentifier() string + func (ctx *SigningContext) GetSignatureMethodIdentifier() string + func (ctx *SigningContext) SetSignatureMethod(algorithmID string) error + func (ctx *SigningContext) SignEnveloped(el *etree.Element) (*etree.Element, error) + func (ctx *SigningContext) SignString(content string) ([]byte, error) + type TLSCertKeyStore tls.Certificate + func (d TLSCertKeyStore) GetChain() ([][]byte, error) + func (d TLSCertKeyStore) GetKeyPair() (*rsa.PrivateKey, []byte, error) + type ValidationContext struct + CertificateStore X509CertificateStore + Clock *Clock + IdAttribute string + func NewDefaultValidationContext(certificateStore X509CertificateStore) *ValidationContext + func (ctx *ValidationContext) BahValidate(el *etree.Element) (*etree.Element, bool, error) + func (ctx *ValidationContext) Validate(el *etree.Element) (*etree.Element, error) + type X509CertificateStore interface + Certificates func() (roots []*x509.Certificate, err error) + type X509ChainStore interface + GetChain func() (certs [][]byte, err error) + type X509KeyStore interface + GetKeyPair func() (privateKey *rsa.PrivateKey, cert []byte, err error) + func RandomKeyStoreForTest() X509KeyStore