contracts

package
v0.0.0-...-a5e1e4d Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var KeyAlgorithmStrings = map[KeyAlgorithm]string{
	ECDSA:   "ECDSA",
	ED25519: "ED25519",
	RSA:     "RSA",
}

Functions

This section is empty.

Types

type CertificateLightResponse

type CertificateLightResponse struct {
	ID      string    `json:"id"`
	Name    string    `json:"name"`
	Type    string    `json:"type"`
	Created time.Time `json:"created"`
}

type CertificateResponse

type CertificateResponse struct {
	ID                 string    `json:"id"`
	OwnerID            string    `json:"ownerId"`
	Name               string    `json:"name"`
	Type               string    `json:"type"`
	Created            time.Time `json:"created"`
	KeyID              string    `json:"keyId"`
	SignatureAlgorithm string    `json:"signatureAlgorithm"`
	PublicKeyAlgorithm string    `json:"publicKeyAlgorithm"`
	Version            int       `json:"version"`
	SerialNumber       int       `json:"serialNumber"`
	Issuer             *PkixName `json:"issuer"`
	Subject            *PkixName `json:"subject"`
	NotBefore          time.Time `json:"notBefore"`
	NotAfter           time.Time `json:"notAfter"`
	KeyUsage           []string  `json:"keyUsage"`
	ExtKeyUsage        []string  `json:"extKeyUsage"`
	IsCA               bool      `json:"isCA"`
	MaxPathLen         int       `json:"maxPathLen"`
	MaxPathLenZero     bool      `json:"maxPathLenZero"`
	DNSNames           []string  `json:"sanDNSNames"`
}

type CreateCARequest

type CreateCARequest struct {
	Name              string    `json:"name"`
	Organization      string    `json:"organization"`
	Country           string    `json:"country"`
	State             string    `json:"state"`
	Locality          string    `json:"locality"`
	PostalCode        string    `json:"postalCode"`
	StreetAddress     string    `json:"streetAddress"`
	Expiration        time.Time `json:"expiration"`
	ParentCA          string    `json:"parentCA"`
	ParentKeyPassword string    `json:"parentKeyPassword"`
	KeyID             string    `json:"key"`
	KeyPassword       string    `json:"keyPassword"`
}

type CreateCAResponse

type CreateCAResponse struct {
	ID      string    `json:"id"`
	Name    string    `json:"name"`
	Created time.Time `json:"created"`
	Type    string    `json:"type"`
}

type CreateCertificateRequest

type CreateCertificateRequest struct {
	Name                    string    `json:"name"`
	KeyId                   string    `json:"keyId"`
	KeyPassword             string    `json:"keyPassword"`
	KeyUsages               []string  `json:"keyUsages"`
	CommonName              string    `json:"commonName"`
	SubjectAlternativeNames []string  `json:"subjectAlternativeNames"`
	Expiration              time.Time `json:"expiration"`
	CAKeyPassword           string    `json:"caKeyPassword"`
}

type CreateKeyRequest

type CreateKeyRequest struct {
	Algorithm KeyAlgorithm `json:"algorithm"`
	Name      string       `json:"name"`
	Password  string       `json:"password"`
}

type CreateUserRequest

type CreateUserRequest struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
	Password  string `json:"password"`
}

type KeyAlgorithm

type KeyAlgorithm int
const (
	ECDSA KeyAlgorithm = iota
	ED25519
	RSA
	Unknown
)

func AlgorithmFromString

func AlgorithmFromString(algorithm string) (KeyAlgorithm, error)

func (KeyAlgorithm) String

func (a KeyAlgorithm) String() string

type KeyLightResponse

type KeyLightResponse struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Created   time.Time `json:"created"`
	Algorithm string    `json:"algorithm"`
}

type LoginUserRequest

type LoginUserRequest struct {
	Email    string `json:"email"`
	Password string `json:"password"`
}

type LoginUserResponse

type LoginUserResponse struct {
	Session *SessionResponse `json:"session"`
	User    *UserResponse    `json:"user"`
}

type OAuthValidateRequest

type OAuthValidateRequest struct {
	AccessToken string `json:"accessToken"`
	Provider    string `json:"provider"`
}

type PkixName

type PkixName struct {
	Country            []string `json:"country"`
	Organization       []string `json:"organization"`
	OrganizationalUnit []string `json:"organizationalUnit"`
	Locality           []string `json:"locality"`
	Province           []string `json:"province"`
	StreetAddress      []string `json:"streetAddress"`
	PostalCode         []string `json:"postalCode"`
	SerialNumber       string   `json:"serialNumber"`
	CommonName         string   `json:"commonName"`
}

func (*PkixName) FromName

func (n *PkixName) FromName(name *pkix.Name)

type SessionResponse

type SessionResponse struct {
	ID        string    `json:"id"`
	CreatedAt time.Time `json:"createdAt"`
	Expires   time.Time `json:"expires"`
}

type UserResponse

type UserResponse struct {
	ID        string `json:"id"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
}

Jump to

Keyboard shortcuts

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