acvp

package
v0.0.0-...-a906f12 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-2.0, BSD-3-Clause, ISC, + 2 more Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NotFound = errors.New("acvp: HTTP code 404")

Functions

This section is empty.

Types

type Address

type Address struct {
	URL        string `json:"url,omitempty"`
	Street1    string `json:"street1,omitempty"`
	Street2    string `json:"street2,omitempty"`
	Street3    string `json:"street3,omitempty"`
	Locality   string `json:"locality,omitempty"`
	Region     string `json:"region,omitempty"`
	Country    string `json:"country,omitempty"`
	PostalCode string `json:"postalCode,omitempty"`
}

https://usnistgov.github.io/ACVP/artifacts/draft-fussell-acvp-spec-00.html#rfc.section.11.9

type Algorithm

type Algorithm map[string]interface{}

type Condition

type Condition struct {
	Param    string
	Relation Relation
	Value    string
}

type Conjunction

type Conjunction []Condition

type Dependency

type Dependency map[string]interface{}

type LargeUploadRequest

type LargeUploadRequest struct {
	Size uint64 `json:"submissionSize,omitempty"`
	URL  string `json:"vectorSetUrl,omitempty"`
}

type LargeUploadResponse

type LargeUploadResponse struct {
	URL         string `json:"url"`
	AccessToken string `json:"accessToken"`
}

type Module

type Module struct {
	URL         string   `json:"url,omitempty"`
	Name        string   `json:"name,omitempty"`
	Version     string   `json:"version,omitempty"`
	Type        string   `json:"type,omitempty"`
	Website     string   `json:"website,omitempty"`
	VendorURL   string   `json:"vendorUrl,omitempty"`
	AddressURL  string   `json:"addressUrl,omitempty"`
	ContactURLs []string `json:"contactUrls,omitempty"`
	Description string   `json:"description,omitempty"`
}

https://usnistgov.github.io/ACVP/artifacts/draft-fussell-acvp-spec-00.html#rfc.section.11.11

type OperationalEnvironment

type OperationalEnvironment struct {
	URL            string       `json:"url,omitempty"`
	Name           string       `json:"name,omitempty"`
	DependencyUrls []string     `json:"dependencyUrls,omitempty"`
	Dependencies   []Dependency `json:"dependencies,omitempty"`
}

type Person

type Person struct {
	URL          string   `json:"url,omitempty"`
	FullName     string   `json:"fullName,omitempty"`
	VendorURL    string   `json:"vendorUrl,omitempty"`
	Emails       []string `json:"emails,omitempty"`
	PhoneNumbers []struct {
		Number string `json:"number,omitempty"`
		Type   string `json:"type,omitempty"`
	} `json:"phoneNumbers,omitempty"`
}

https://usnistgov.github.io/ACVP/artifacts/draft-fussell-acvp-spec-00.html#rfc.section.11.10

type Query

type Query []Conjunction

type Relation

type Relation int
const (
	Equals           Relation = iota
	NotEquals        Relation = iota
	GreaterThan      Relation = iota
	GreaterThanEqual Relation = iota
	LessThan         Relation = iota
	LessThanEqual    Relation = iota
	Contains         Relation = iota
	StartsWith       Relation = iota
	EndsWith         Relation = iota
)

func (Relation) String

func (rel Relation) String() string

type RequestStatus

type RequestStatus struct {
	URL         string `json:"url,omitempty"`
	Status      string `json:"status,omitempty"`
	Message     string `json:"message,omitempty"`
	ApprovedURL string `json:"approvedUrl,omitempty"`
}

type Server

type Server struct {
	// PrefixTokens are access tokens that apply to URLs under a certain prefix.
	// The keys of this map are strings like "acvp/v1/testSessions/1234" and the
	// values are JWT access tokens.
	PrefixTokens map[string]string
	// SizeLimit is the maximum number of bytes that the server can accept as an
	// upload before the large endpoint support must be used.
	SizeLimit uint64
	// AccessToken is the top-level access token for the current session.
	AccessToken string
	// contains filtered or unexported fields
}

Server represents an ACVP server.

func NewServer

func NewServer(prefix string, logFile string, derCertificates [][]byte, privateKey crypto.PrivateKey, totp func() string) *Server

NewServer returns a fresh Server instance representing the ACVP server at prefix (e.g. "https://acvp.example.com/"). A copy of all bytes exchanged will be written to logFile, if not empty.

func (*Server) Delete

func (server *Server) Delete(endPoint string) error

func (*Server) Get

func (server *Server) Get(out interface{}, endPoint string) error

func (*Server) GetBytes

func (server *Server) GetBytes(endPoint string) ([]byte, error)

func (*Server) GetPaged

func (server *Server) GetPaged(out interface{}, endPoint string, condition Query) error

GetPaged returns an array of records of some type using one or more requests to the server. See https://usnistgov.github.io/ACVP/artifacts/draft-fussell-acvp-spec-00.html#paging_response

func (*Server) Login

func (server *Server) Login() error

Login sends a login request and stores the returned access tokens for use with future requests. The login process isn't specifically documented in draft-fussell-acvp-spec and the best reference is https://github.com/usnistgov/ACVP/wiki#credentials-for-accessing-the-demo-server

func (*Server) Post

func (server *Server) Post(out interface{}, endPoint string, contents []byte) error

func (*Server) Put

func (server *Server) Put(out interface{}, endPoint string, contents []byte) error

type SessionResults

type SessionResults struct {
	Passed  bool `json:"passed"`
	Results []struct {
		URL    string `json:"vectorSetUrl,omitempty"`
		Status string `json:"status"`
	} `json:"results"`
}

type TestSession

type TestSession struct {
	URL           string                   `json:"url,omitempty"`
	ACVPVersion   string                   `json:"acvpVersion,omitempty"`
	Created       string                   `json:"createdOn,omitempty"`
	Expires       string                   `json:"expiresOn,omitempty"`
	VectorSetURLs []string                 `json:"vectorSetUrls,omitempty"`
	AccessToken   string                   `json:"accessToken,omitempty"`
	Algorithms    []map[string]interface{} `json:"algorithms,omitempty"`
	EncryptAtRest bool                     `json:"encryptAtRest,omitempty"`
	IsSample      bool                     `json:"isSample,omitempty"`
	Publishable   bool                     `json:"publishable,omitempty"`
	Passed        bool                     `json:"passed,omitempty"`
}

type Vectors

type Vectors struct {
	Retry    uint64 `json:"retry,omitempty"`
	ID       uint64 `json:"vsId"`
	Algo     string `json:"algorithm,omitempty"`
	Revision string `json:"revision,omitempty"`
}

type Vendor

type Vendor struct {
	URL         string    `json:"url,omitempty"`
	Name        string    `json:"name,omitempty"`
	ParentURL   string    `json:"parentUrl,omitempty"`
	Website     string    `json:"website,omitempty"`
	Emails      []string  `json:"emails,omitempty"`
	ContactsURL string    `json:"contactsUrl,omitempty"`
	Addresses   []Address `json:"addresses,omitempty"`
}

https://usnistgov.github.io/ACVP/artifacts/draft-fussell-acvp-spec-00.html#rfc.section.11.8.3.1

Jump to

Keyboard shortcuts

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