types

package
v0.0.0-...-041bb98 Latest Latest
Warning

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

Go to latest
Published: May 14, 2017 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotASinglePemBlock = errors.New("Expected single PEM block")
View Source
var UnexpectedPemBlock = errors.New("Unexpected PEM block")

Functions

This section is empty.

Types

type Authorization

type Authorization struct {
	Resource AuthorizationResource
	Location string
	// map challenge uri to per challenge data
	ChallengesData map[string]ChallengeData
}

func (Authorization) Export

func (auth Authorization) Export(password string) (*AuthorizationExport, error)

func (*Authorization) Import

func (auth *Authorization) Import(export AuthorizationExport, prompt PasswordPrompt) error

func (*Authorization) Respond

func (authorization *Authorization) Respond(registration Registration, challengeIndex int) (ChallengeResponding, error)

type AuthorizationExport

type AuthorizationExport struct {
	JsonPem []byte
}

type AuthorizationResource

type AuthorizationResource struct {
	Resource      ResourceAuthorizationTag `json:"resource"`
	DNSIdentifier DNSIdentifier            `json:"identifier,omitempty"`
	Status        AuthorizationStatus      `json:"status,omitempty"`
	Challenges    []Challenge              `json:"challenges,omitempty"`
	Combinations  [][]int                  `json:"combinations,omitempty"`
	Expires       *time.Time               `json:"expires,omitempty"`
}

type AuthorizationStatus

type AuthorizationStatus string

func (AuthorizationStatus) MarshalJSON

func (status AuthorizationStatus) MarshalJSON() (data []byte, err error)

func (AuthorizationStatus) String

func (status AuthorizationStatus) String() string

func (*AuthorizationStatus) UnmarshalJSON

func (status *AuthorizationStatus) UnmarshalJSON(data []byte) error

type Certificate

type Certificate struct {
	Name        string
	Revoked     bool
	Certificate *x509.Certificate
	PrivateKey  *pem.Block
	Location    string
	LinkIssuer  string
}

func (Certificate) Export

func (cert Certificate) Export(password string) (*CertificateExport, error)

func (*Certificate) Import

func (cert *Certificate) Import(export CertificateExport, prompt PasswordPrompt) error

type CertificateExport

type CertificateExport struct {
	Name           string
	Revoked        bool
	CertificatePem []byte
	PrivateKeyPem  []byte
	Location       string
	LinkIssuer     string
}

type Challenge

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

func (*Challenge) GetStatus

func (challenge *Challenge) GetStatus() string

func (*Challenge) GetType

func (challenge *Challenge) GetType() string

func (*Challenge) GetURI

func (challenge *Challenge) GetURI() string

func (*Challenge) GetValidated

func (challenge *Challenge) GetValidated() string

func (*Challenge) MarshalJSON

func (challenge *Challenge) MarshalJSON() (data []byte, err error)

func (*Challenge) UnmarshalJSON

func (challenge *Challenge) UnmarshalJSON(data []byte) error

type ChallengeData

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

func (ChallengeData) GetType

func (cdata ChallengeData) GetType() string

func (ChallengeData) MarshalJSON

func (cdata ChallengeData) MarshalJSON() ([]byte, error)

func (*ChallengeData) UnmarshalJSON

func (cdata *ChallengeData) UnmarshalJSON(data []byte) error

type ChallengeDataImplementation

type ChallengeDataImplementation interface {
	GetType() string
}

type ChallengeImplementation

type ChallengeImplementation interface {
	GetType() string
	GetStatus() string
	GetValidated() string
	GetURI() string
	// contains filtered or unexported methods
}

type ChallengeResponding

type ChallengeResponding interface {
	ResetResponse() error
	InitializeResponse(UI ui.UserInterface) error
	ShowInstructions(UI ui.UserInterface) error
	Verify() error
	SendPayload() (interface{}, error)
	ChallengeData() ChallengeData
	Challenge() Challenge
	Registration() *Registration
}

type DNSIdentifier

type DNSIdentifier string

func (DNSIdentifier) MarshalJSON

func (dnsId DNSIdentifier) MarshalJSON() (data []byte, err error)

func (*DNSIdentifier) UnmarshalJSON

func (dnsId *DNSIdentifier) UnmarshalJSON(data []byte) error

type Directory

type Directory struct {
	RootURL  string
	Resource DirectoryResource
}

type DirectoryResource

type DirectoryResource struct {
	NewRegistration     string `json:"new-reg,omitempty"`
	RecoverRegistration string `json:"recover-reg,omitempty"`
	NewAuthorization    string `json:"new-authz,omitempty"`
	NewCertificate      string `json:"new-cert,omitempty"`
	RevokeCertificate   string `json:"revoke-cert,omitempty"`
}

type JSONSignature

type JSONSignature struct {
	Signature *jose.JsonWebSignature
}

wrapper to marshal/unmarshal json

func (JSONSignature) MarshalJSON

func (sig JSONSignature) MarshalJSON() ([]byte, error)

func (*JSONSignature) UnmarshalJSON

func (sig *JSONSignature) UnmarshalJSON(data []byte) error

type PasswordPrompt

type PasswordPrompt func() (string, error)

type Registration

type Registration struct {
	Resource           RegistrationResource
	SigningKey         SigningKey
	Location           string
	LinkTermsOfService string
	RecoveryToken      string
	Name               string
}

func (Registration) Export

func (reg Registration) Export(password string) (*RegistrationExport, error)

func (*Registration) Import

func (reg *Registration) Import(export RegistrationExport, prompt PasswordPrompt) error

type RegistrationExport

type RegistrationExport struct {
	JsonPem       []byte
	SigningKeyPem []byte
	Location      string
	Name          string
}

type RegistrationResource

type RegistrationResource struct {
	Resource          ResourceRegistrationTag `json:"resource"`
	Contact           []string                `json:"contact,omitempty"`
	AgreementURL      string                  `json:"agreement,omitempty"`
	AuthorizationsURL string                  `json:"authorizations,omitempty"`
	CertificatesURL   string                  `json:"certificates,omitempty"`
}

type Resource

type Resource int
const (
	// action resources to create new resources
	Resource_NewRegistration Resource = iota
	Resource_RecoverRegistration
	Resource_NewAuthorization
	Resource_NewCertificate
	Resource_RevokeCertificate
	// existing resources with an actual value
	Resource_Registration
	Resource_Authorization
	Resource_Challenge
	Resource_Certificate
)

func (Resource) MarshalJSON

func (r Resource) MarshalJSON() ([]byte, error)

func (Resource) String

func (r Resource) String() string

func (Resource) UnmarshalJSON

func (r Resource) UnmarshalJSON(data []byte) error

type ResourceAuthorizationTag

type ResourceAuthorizationTag struct{}

func (ResourceAuthorizationTag) MarshalJSON

func (ResourceAuthorizationTag) MarshalJSON() ([]byte, error)

func (ResourceAuthorizationTag) UnmarshalJSON

func (ResourceAuthorizationTag) UnmarshalJSON(data []byte) error

type ResourceCertificateTag

type ResourceCertificateTag struct{}

func (ResourceCertificateTag) MarshalJSON

func (ResourceCertificateTag) MarshalJSON() ([]byte, error)

func (ResourceCertificateTag) UnmarshalJSON

func (ResourceCertificateTag) UnmarshalJSON(data []byte) error

type ResourceChallengeTag

type ResourceChallengeTag struct{}

func (ResourceChallengeTag) MarshalJSON

func (ResourceChallengeTag) MarshalJSON() ([]byte, error)

func (ResourceChallengeTag) UnmarshalJSON

func (ResourceChallengeTag) UnmarshalJSON(data []byte) error

type ResourceNewAuthorizationTag

type ResourceNewAuthorizationTag struct{}

func (ResourceNewAuthorizationTag) MarshalJSON

func (ResourceNewAuthorizationTag) MarshalJSON() ([]byte, error)

func (ResourceNewAuthorizationTag) UnmarshalJSON

func (ResourceNewAuthorizationTag) UnmarshalJSON(data []byte) error

type ResourceNewCertificateTag

type ResourceNewCertificateTag struct{}

func (ResourceNewCertificateTag) MarshalJSON

func (ResourceNewCertificateTag) MarshalJSON() ([]byte, error)

func (ResourceNewCertificateTag) UnmarshalJSON

func (ResourceNewCertificateTag) UnmarshalJSON(data []byte) error

type ResourceNewRegistrationTag

type ResourceNewRegistrationTag struct{}

func (ResourceNewRegistrationTag) MarshalJSON

func (ResourceNewRegistrationTag) MarshalJSON() ([]byte, error)

func (ResourceNewRegistrationTag) UnmarshalJSON

func (ResourceNewRegistrationTag) UnmarshalJSON(data []byte) error

type ResourceRecoverRegistrationTag

type ResourceRecoverRegistrationTag struct{}

func (ResourceRecoverRegistrationTag) MarshalJSON

func (ResourceRecoverRegistrationTag) MarshalJSON() ([]byte, error)

func (ResourceRecoverRegistrationTag) UnmarshalJSON

func (ResourceRecoverRegistrationTag) UnmarshalJSON(data []byte) error

type ResourceRegistrationTag

type ResourceRegistrationTag struct{}

func (ResourceRegistrationTag) MarshalJSON

func (ResourceRegistrationTag) MarshalJSON() ([]byte, error)

func (ResourceRegistrationTag) UnmarshalJSON

func (ResourceRegistrationTag) UnmarshalJSON(data []byte) error

type ResourceRevokeCertificateTag

type ResourceRevokeCertificateTag struct{}

func (ResourceRevokeCertificateTag) MarshalJSON

func (ResourceRevokeCertificateTag) MarshalJSON() ([]byte, error)

func (ResourceRevokeCertificateTag) UnmarshalJSON

func (ResourceRevokeCertificateTag) UnmarshalJSON(data []byte) error

type SigningKey

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

func CreateSigningKey

func CreateSigningKey(keyType utils.KeyType, curve utils.Curve, rsaBits *int) (SigningKey, error)

func LoadSigningKey

func LoadSigningKey(block pem.Block) (SigningKey, error)

func (SigningKey) EncryptPrivateKey

func (skey SigningKey) EncryptPrivateKey(password string, alg x509.PEMCipher) (*pem.Block, error)

func (SigningKey) GetPublicKey

func (skey SigningKey) GetPublicKey() *jose.JsonWebKey

func (SigningKey) GetSignatureAlgorithm

func (skey SigningKey) GetSignatureAlgorithm() jose.SignatureAlgorithm

func (SigningKey) Sign

func (skey SigningKey) Sign(payload []byte, nonce string) (*jose.JsonWebSignature, error)

func (SigningKey) Verify

func (skey SigningKey) Verify(signature string, payload *[]byte, nonce *string) error

Jump to

Keyboard shortcuts

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