Documentation ¶
Index ¶
- Variables
- type Ctx
- type Signature
- func (s *Signature) AddKeyValue() error
- func (s *Signature) AddReference(digestMethod TransformID, id, uri, nodeType string) error
- func (s *Signature) AddTransform(transformID TransformID) error
- func (s *Signature) AddX509Data() error
- func (s *Signature) EnsureKeyInfo(ids ...string) error
- func (s *Signature) Sign(key *crypto.Key) error
- type SignatureVerify
- type TransformID
Constants ¶
This section is empty.
Variables ¶
var ( ExclC14N = TransformID(clib.ExclC14N) InclC14N = TransformID(clib.InclC14N) Enveloped = TransformID(clib.Enveloped) Sha1 = TransformID(clib.Sha1) RsaSha1 = TransformID(clib.RsaSha1) )
Functions ¶
This section is empty.
Types ¶
type Ctx ¶
type Ctx struct {
// contains filtered or unexported fields
}
func NewCtx ¶
func NewCtx(mngr *crypto.KeyManager) (*Ctx, error)
NewCtx creates a new XML Signature Context
func (*Ctx) Sign ¶
Sign signs the given document. It automatically searches for the "Signature" node with the namespace "http://www.w3.org/2000/09/xmldsig#".
func (*Ctx) Verify ¶
Verify verifies the signature in the given document. It automatically searches for the "Signature" node with the namespace "http://www.w3.org/2000/09/xmldsig#".
type Signature ¶
type Signature struct {
// contains filtered or unexported fields
}
func NewSignature ¶
NewSignature creates a Signature object.
func (*Signature) AddKeyValue ¶
AddKeyValue adds KeyValue nodes to appropriate location. Before adding these nodes, EnsureKeyInfo is called to makes ure KeyInfo node is created and added.
func (*Signature) AddReference ¶
func (s *Signature) AddReference(digestMethod TransformID, id, uri, nodeType string) error
AddReference adds a Reference node to the appropriate location
func (*Signature) AddTransform ¶
func (s *Signature) AddTransform(transformID TransformID) error
AddTransform adds a Transform node to the appropriate location
func (*Signature) AddX509Data ¶
AddX509Data adds a X509Data node to the apprpriate location
func (*Signature) EnsureKeyInfo ¶
EnsureKeyInfo adds a KeyInfo node to the apprpriate location
type SignatureVerify ¶
type SignatureVerify struct {
// contains filtered or unexported fields
}
SignatureVerify is a convenience wrapper for things that can verify XML strings
func NewSignatureVerify ¶
func NewSignatureVerify() (*SignatureVerify, error)
func (*SignatureVerify) Free ¶
func (v *SignatureVerify) Free()
func (*SignatureVerify) LoadKeyFromFile ¶
func (v *SignatureVerify) LoadKeyFromFile(file string, format crypto.KeyDataFormat) error
func (*SignatureVerify) Verify ¶
func (v *SignatureVerify) Verify(buf []byte) error
func (*SignatureVerify) VerifyString ¶
func (v *SignatureVerify) VerifyString(buf string) error
type TransformID ¶
type TransformID clib.TransformID