func UnmarshalEncryptedKeys(data []byte) (*EncryptedKeys, error) {
	keys := new(EncryptedKeys)
	rest, err := asn1.Unmarshal(data, keys)
	if err != nil {
		return nil, err
	}
	if len(rest) != 0 {
		return nil, ErrExtraData
	}
	return keys, nil
}
UnmarshalEncryptedKeys constructs EncryptedKeys from serialized representation.
package asn1
import (
	"encoding/asn1"
	"fmt"
	"time"
)
var (
	ErrExtraData = fmt.Errorf("unexpected extra ASN.1 data")
)
var (
	Sha256OID = asn1.ObjectIdentifier([]int{2, 16, 840, 1, 101, 3, 4, 2, 1})
)
type SignedContainer struct {
	Payload    SignedPayload
	Signatures []Signature `asn1:"set"`
}
func (container *SignedContainer) Marshal() ([]byte, error) {
	return asn1.Marshal(*container)
}
type VerifiedContainer struct {
	Payload    VerifiedPayload
	Signatures []Signature `asn1:"set"`
}
func UnmarshalVerifiedContainer(data []byte) (*VerifiedContainer, error) {
	container := new(VerifiedContainer)
	rest, err := asn1.Unmarshal(data, container)
	if err != nil {
		return nil, err
	}
	if len(rest) != 0 {
		return nil, ErrExtraData
	}
	return container, nil
}
type SignedPayload struct {
	ContentType  ContentType
	Version      int
	LastModified time.Time `asn1:"utc"`
	Data         interface{}
}
func (payload *SignedPayload) Marshal() ([]byte, error) {
	return asn1.Marshal(*payload)
}
type VerifiedPayload struct {
	RawContent   asn1.RawContent
	ContentType  ContentType
	Version      int
	LastModified time.Time `asn1:"utc"`
	Data         asn1.RawValue
}
type ContentType asn1.Enumerated
const (
	TypeKeyRing ContentType = iota + 1
	TypeKeyDirectory
	TypeDirectKeyDirectory
	TypeEncryptedKeys
)
const (
	KeyRingVersion2 = 2
)
type Signature struct {
	Algorithm asn1.ObjectIdentifier
	Signature []byte
}
type DirectKeyDirectory struct {
	Name     LikelyUTF8String
	KeyRings []KeyRing            `asn1:"set,optional,tag:1"`
	Children []DirectKeyDirectory `asn1:"set,optional,tag:2"`
}
type KeyDirectory struct {
	Name     LikelyUTF8String
	KeyRings []KeyRingReference      `asn1:"set,optional,tag:1"`
	Children []KeyDirectoryReference `asn1:"set,optional,tag:2"`
}
func UnmarshalKeyDirectory(data []byte) (*KeyDirectory, error) {
	container := new(KeyDirectory)
	rest, err := asn1.Unmarshal(data, container)
	if err != nil {
		return nil, err
	}
	if len(rest) != 0 {
		return nil, ErrExtraData
	}
	return container, nil
}
type EncryptedKeys struct {
	KeyRings []KeyRing `asn1:"set"`
}
func (keys *EncryptedKeys) Marshal() ([]byte, error) {
	return asn1.Marshal(*keys)
}