xmlenc

package
v0.0.0-...-d804d43 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2017 License: BSD-2-Clause Imports: 18 Imported by: 0

Documentation

Overview

Package xmlenc implements xml encrytion natively (https://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html)

Index

Constants

This section is empty.

Variables

View Source
var ErrCannotFindEncryptedDataNode = errors.New("cannot find EncryptedData node")
View Source
var ErrPublicKeyMismatch = errors.New("certificate public key does not match provided private key")

Functions

func Decrypt

func Decrypt(privateKey []byte, doc []byte) ([]byte, error)

Types

type CipherData

type CipherData struct {
	XMLName     xml.Name `xml:"http://www.w3.org/2001/04/xmlenc# CipherData"`
	CipherValue *CipherValue
}

type CipherValue

type CipherValue struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/04/xmlenc# CipherValue"`
	Data    string   `xml:",chardata"`
}

type DigestMethod

type DigestMethod struct {
	XMLName   xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# DigestMethod"`
	Algorithm string   `xml:",attr"`
}

type EncryptedData

type EncryptedData struct {
	XMLName          xml.Name          `xml:"http://www.w3.org/2001/04/xmlenc# EncryptedData"`
	ID               *string           `xml:"Id,attr"`
	Type             *string           `xml:",attr"`
	EncryptionMethod *EncryptionMethod `xml:"http://www.w3.org/2001/04/xmlenc# EncryptionMethod"`
	KeyInfo          *KeyInfo          `xml:"http://www.w3.org/2000/09/xmldsig# KeyInfo"`
	CipherData       *CipherData       `xml:"http://www.w3.org/2001/04/xmlenc# CipherData"`
}

type EncryptedKey

type EncryptedKey struct {
	XMLName          xml.Name          `xml:"http://www.w3.org/2001/04/xmlenc# EncryptedKey"`
	EncryptionMethod *EncryptionMethod `xml:"http://www.w3.org/2001/04/xmlenc# EncryptionMethod"`
	KeyInfo          *KeyInfo          `xml:"http://www.w3.org/2000/09/xmldsig# KeyInfo"`
	CipherData       *CipherData       `xml:"http://www.w3.org/2001/04/xmlenc# CipherData"`
}

type EncryptionMethod

type EncryptionMethod struct {
	XMLName      xml.Name      `xml:"http://www.w3.org/2001/04/xmlenc# EncryptionMethod"`
	Algorithm    *string       `xml:",attr"`
	OAEPparams   *OAEPparams   `xml:"http://www.w3.org/2001/04/xmlenc# OAEPparams"`
	DigestMethod *DigestMethod `xml:"http://www.w3.org/2000/09/xmldsig# DigestMethod"`
}

type ErrUnsupportedAlgorithm

type ErrUnsupportedAlgorithm struct {
	Algorithm string
}

func (ErrUnsupportedAlgorithm) Error

func (e ErrUnsupportedAlgorithm) Error() string

type KeyInfo

type KeyInfo struct {
	XMLName      xml.Name      `xml:"http://www.w3.org/2000/09/xmldsig# KeyInfo"`
	EncryptedKey *EncryptedKey `xml:"http://www.w3.org/2001/04/xmlenc# EncryptedKey"`
	X509Data     *X509Data     `xml:"http://www.w3.org/2000/09/xmldsig# X509Data"`
}

type OAEPparams

type OAEPparams struct {
	XMLName xml.Name `xml:"http://www.w3.org/2001/04/xmlenc# OAEPparams"`
	Data    []byte   `xml:",chardata"`
}

type X509Certificate

type X509Certificate struct {
	XMLName xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# X509Certificate"`
	Data    []byte   `xml:",chardata"`
}

type X509Data

type X509Data struct {
	XMLName         xml.Name `xml:"http://www.w3.org/2000/09/xmldsig# X509Data"`
	X509Certificate *X509Certificate
}

Jump to

Keyboard shortcuts

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