key

package
v0.0.0-...-503c2a9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package key contains utilities to create KeyDescriptor nodes on the fly. Normally xmlsec would handle this, but xmlsec expects certain nodes to be the parent of ds:KeyInfo nodes. This package gives you a simple programatic way to insert nodes in, for example, IDPSSODescriptor nodes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DSA

type DSA struct {
	// contains filtered or unexported fields
}

DSA represents a DSA key

func NewDSA

func NewDSA(pubkey *dsa.PublicKey) *DSA

NewDSA creates a new DSA key representation for the public key

func (*DSA) MakeXMLNode

func (key *DSA) MakeXMLNode(doc types.Document) (types.Node, error)

MakeXMLNode creates a libxml2 node tree to represent this DSA key

func (*DSA) Serialize

func (key *DSA) Serialize() (string, error)

Serialize creates the XML representation for this DSA key

type Key

type Key interface {
	Serialize() (string, error)
}

func Construct

func Construct(n types.Node) (Key, error)

Construct takes the node and creates a new Key. The node must be a KeyInfo node

func Parse

func Parse(buf []byte) (Key, error)

type RSA

type RSA struct {
	// contains filtered or unexported fields
}

RSA represents a RSA key

func NewRSA

func NewRSA(pubkey *rsa.PublicKey) *RSA

NewRSA creates a new RSA key representation for the public key

func (*RSA) MakeXMLNode

func (key *RSA) MakeXMLNode(doc types.Document) (types.Node, error)

func (*RSA) Serialize

func (key *RSA) Serialize() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL