tpp

package
v4.15.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: Apache-2.0 Imports: 23 Imported by: 5

Documentation

Index

Constants

View Source
const (
	SSHCaRootPath = util.PathSeparator + "VED" + util.PathSeparator + "Certificate Authority" + util.PathSeparator + "SSH" + util.PathSeparator + "Templates"
)

Variables

View Source
var RevocationReasonsMap = map[string]RevocationReason{
	"":                       0,
	"none":                   0,
	"key-compromise":         1,
	"ca-compromise":          2,
	"affiliation-changed":    3,
	"superseded":             4,
	"cessation-of-operation": 5,
}

RevocationReasonsMap maps *certificate.RevocationRequest.Reason to TPP-specific webSDK codes

Functions

func NewResponseError

func NewResponseError(b []byte) error

func PolicyExist added in v4.14.0

func PolicyExist(policyName string, c *Connector) (bool, error)

func RequestSshCertificate added in v4.15.0

func RequestSshCertificate(c *Connector, req *certificate.SshCertRequest) (requestID string, err error)

func RetrieveSshCaPrincipals added in v4.15.2

func RetrieveSshCaPrincipals(c *Connector, ca *certificate.SshCaTemplateRequest) ([]string, error)

func RetrieveSshCertificate added in v4.15.0

func RetrieveSshCertificate(c *Connector, req *certificate.SshCertRequest) (*certificate.SshCertRetrieveDetails, error)

func RetrieveSshConfig added in v4.15.2

Types

type Certificate

type Certificate struct {
	//Id                   string   `json:"DN"`
	//ManagedCertificateId string   `json:"DN"`
	CertificateRequestId   string `json:"DN"`
	CertificateRequestGuid string `json:"Guid"`
}

type CertificateDetailsResponse

type CertificateDetailsResponse struct {
	CustomFields []struct {
		Name  string
		Value []string
	}
	Consumers []string
}

type CertificateSearchResponse

type CertificateSearchResponse struct {
	Certificates []Certificate `json:"Certificates"`
	Count        int           `json:"TotalCount"`
}

func ParseCertificateSearchResponse

func ParseCertificateSearchResponse(httpStatusCode int, body []byte) (searchResult *CertificateSearchResponse, err error)

type ConfigReadDNRequest

type ConfigReadDNRequest struct {
	ObjectDN      string `json:",omitempty"`
	AttributeName string `json:",omitempty"`
}

type ConfigReadDNResponse

type ConfigReadDNResponse struct {
	Result int      `json:",omitempty"`
	Values []string `json:",omitempty"`
}

type Connector

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

Connector contains the base data needed to communicate with a TPP Server

func NewConnector

func NewConnector(url string, zone string, verbose bool, trust *x509.CertPool) (*Connector, error)

NewConnector creates a new TPP Connector object used to communicate with TPP

func (*Connector) Authenticate

func (c *Connector) Authenticate(auth *endpoint.Authentication) (err error)

Authenticate authenticates the user to the TPP

func (*Connector) GenerateRequest

func (c *Connector) GenerateRequest(config *endpoint.ZoneConfiguration, req *certificate.Request) (err error)

GenerateRequest creates a new certificate request, based on the zone/policy configuration and the user data

func (*Connector) GetPolicy added in v4.14.0

func (c *Connector) GetPolicy(name string) (*policy.PolicySpecification, error)

func (*Connector) GetRefreshToken

func (c *Connector) GetRefreshToken(auth *endpoint.Authentication) (resp OauthGetRefreshTokenResponse, err error)

Get OAuth refresh and access token

func (*Connector) GetType

func (c *Connector) GetType() endpoint.ConnectorType

func (*Connector) ImportCertificate

func (c *Connector) ImportCertificate(req *certificate.ImportRequest) (*certificate.ImportResponse, error)

func (*Connector) ListCertificates

func (c *Connector) ListCertificates(filter endpoint.Filter) ([]certificate.CertificateInfo, error)

func (*Connector) Ping

func (c *Connector) Ping() (err error)

Ping attempts to connect to the TPP Server WebSDK API and returns an errror if it cannot

func (*Connector) ReadPolicyConfiguration

func (c *Connector) ReadPolicyConfiguration() (policy *endpoint.Policy, err error)

func (*Connector) ReadZoneConfiguration

func (c *Connector) ReadZoneConfiguration() (config *endpoint.ZoneConfiguration, err error)

ReadZoneConfiguration reads the policy data from TPP to get locked and pre-configured values for certificate requests

func (*Connector) RefreshAccessToken

func (c *Connector) RefreshAccessToken(auth *endpoint.Authentication) (resp OauthRefreshAccessTokenResponse, err error)

Refresh OAuth access token

func (*Connector) RenewCertificate

func (c *Connector) RenewCertificate(renewReq *certificate.RenewalRequest) (requestID string, err error)

RenewCertificate attempts to renew the certificate

func (*Connector) RequestCertificate

func (c *Connector) RequestCertificate(req *certificate.Request) (requestID string, err error)

RequestCertificate submits the CSR to TPP returning the DN of the requested Certificate

func (*Connector) RequestSSHCertificate added in v4.15.0

func (c *Connector) RequestSSHCertificate(req *certificate.SshCertRequest) (requestID string, err error)

func (*Connector) RetrieveCertificate

func (c *Connector) RetrieveCertificate(req *certificate.Request) (certificates *certificate.PEMCollection, err error)

RetrieveCertificate attempts to retrieve the requested certificate

func (*Connector) RetrieveSSHCertificate added in v4.15.0

func (c *Connector) RetrieveSSHCertificate(req *certificate.SshCertRequest) (response *certificate.SshCertRetrieveDetails, err error)

func (*Connector) RetrieveSshConfig added in v4.15.2

func (c *Connector) RetrieveSshConfig(ca *certificate.SshCaTemplateRequest) (*certificate.SshConfig, error)

func (*Connector) RevokeAccessToken added in v4.12.1

func (c *Connector) RevokeAccessToken(auth *endpoint.Authentication) (err error)

RevokeAccessToken - call to revoke token so that it can never be used again

func (*Connector) RevokeCertificate

func (c *Connector) RevokeCertificate(revReq *certificate.RevocationRequest) (err error)

RevokeCertificate attempts to revoke the certificate

func (*Connector) SetHTTPClient

func (c *Connector) SetHTTPClient(client *http.Client)

func (*Connector) SetPolicy added in v4.14.0

func (c *Connector) SetPolicy(name string, ps *policy.PolicySpecification) (string, error)

func (*Connector) SetZone

func (c *Connector) SetZone(z string)

func (*Connector) VerifyAccessToken added in v4.12.1

func (c *Connector) VerifyAccessToken(auth *endpoint.Authentication) (resp OauthVerifyTokenResponse, err error)

VerifyAccessToken - call to check whether token is valid and, if so, return its properties

type OauthGetRefreshTokenResponse

type OauthGetRefreshTokenResponse struct {
	Access_token  string `json:"access_token,omitempty"`
	Expires       int    `json:"expires,omitempty"`
	Identity      string `json:"identity,omitempty"`
	Refresh_token string `json:"refresh_token,omitempty"`
	Scope         string `json:"scope,omitempty"`
	Token_type    string `json:"token_type,omitempty"`
}

type OauthRefreshAccessTokenResponse

type OauthRefreshAccessTokenResponse struct {
	Access_token  string `json:"access_token,omitempty"`
	Expires       int    `json:"expires,omitempty"`
	Identity      string `json:"identity,omitempty"`
	Refresh_token string `json:"refresh_token,omitempty"`
	Token_type    string `json:"token_type,omitempty"`
}

type OauthVerifyTokenResponse added in v4.12.1

type OauthVerifyTokenResponse struct {
	AccessIssuedOn string `json:"access_issued_on_ISO8601,omitempty"`
	ClientID       string `json:"application,omitempty"`
	Expires        string `json:"expires_ISO8601,omitempty"`
	GrantIssuedOn  string `json:"grant_issued_on_ISO8601,omitempty"`
	Identity       string `json:"identity,omitempty"`
	Scope          string `json:"scope,omitempty"`
	ValidFor       int    `json:"valid_for,omitempty"`
}

type RevocationReason

type RevocationReason int

type SearchRequest

type SearchRequest []string

Jump to

Keyboard shortcuts

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