domainkey

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoRecordFound        = errors.New("no record found")
	ErrDNSLookupFailed      = errors.New("dns lookup failed")
	ErrInvalidHashAlgo      = errors.New("invalid hash algorithm")
	ErrInvalidKeyType       = errors.New("invalid key type")
	ErrInvalidServiceType   = errors.New("invalid service type")
	ErrInvalidSelectorFlags = errors.New("invalid selector flags")
	ErrInvalidVersion       = errors.New("invalid version")
)

Functions

This section is empty.

Types

type DomainKey

type DomainKey struct {
	HashAlgo      []HashAlgo      // h hash algorithm separated by colons
	KeyType       KeyType         // k default:rsa
	Notes         string          // n notes
	PublicKey     string          // p public key base64 encoded
	ServiceType   []ServiceType   // s service type separated by colons
	SelectorFlags []SelectorFlags // t flags separated by colons
	Version       string          // v version default:DKIM1
	// contains filtered or unexported fields
}

func LookupARCDomainKey

func LookupARCDomainKey(selector, domain string) (DomainKey, error)

LookupARCDomainKey ARCのドメインキーを検索する versionが含まれていなくてもエラーを返さない

func LookupDKIMDomainKey

func LookupDKIMDomainKey(selector, domain string) (DomainKey, error)

LookupDKIMDomainKey DKIMのドメインキーをLookupする versionがDKIM1でない場合はエラーを返す

func ParseDomainKeyRecode

func ParseDomainKeyRecode(r string) (DomainKey, error)

ドメインキーレコードの解析

func (*DomainKey) IsService

func (d *DomainKey) IsService(service ServiceType) bool

サービスタイプが指定されたものか

func (*DomainKey) IsTestFlag

func (d *DomainKey) IsTestFlag() bool

テストフラグが立っているか

type HashAlgo

type HashAlgo string
const (
	HashAlgoSHA1   HashAlgo = "sha1"
	HashAlgoSHA256 HashAlgo = "sha256"
)

type KeyType

type KeyType string
const (
	KeyTypeRSA     KeyType = "rsa"
	KeyTypeED25519 KeyType = "ed25519"
)

type SelectorFlags

type SelectorFlags string
const (
	SelectorFlagsTest         SelectorFlags = "y"
	SelectorFlagsStrictDomain SelectorFlags = "s" // identifier is strict domain
)

type ServiceType

type ServiceType string
const (
	ServiceTypeEmail ServiceType = "email"
	ServiceTypeAll   ServiceType = "*"
)

Jump to

Keyboard shortcuts

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