Documentation
¶
Index ¶
Constants ¶
View Source
const ( ConnectorTypeUndefined ConnectorType = iota // ConnectorTypeTPP represents the TPP connector type ConnectorTypeTPP DefaultClientID = "vsign-sdk" DefaultScope = "codesignclient;codesign;certificate:manage,discover" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authentication ¶
type Authentication struct {
User string
Password string
APIKey string
JWT string
RefreshToken string
Scope string
ClientId string
AccessToken string
ClientPKCS12 bool
}
Authentication provides a struct for authentication data. Either specify User and Password for Trust Platform or specify an APIKey for Cloud.
type Connector ¶
type Connector interface {
// GetType returns a connector type (cloud/TPP/fake). Can be useful because some features are not supported by a Cloud connection.
GetType() ConnectorType
// SetProject sets a project (by name) for requests with this connector.
SetProject(p string)
// Get codesign protect environment keyid
GetEnvironment() (Environment, error)
// Get codesign protect environment key algorithm
GetEnvironmentKeyAlgorithm() (string, error)
// Sign
//Sign(keyID string, mechanism int, digest string, data string, b64 bool, raw bool) ([]byte, error)
Sign(so *SignOption) ([]byte, error)
// Sign JWT
SignJWT(KeyID string, headerPath string, payloadPath string) (string, error)
// Get GPG public keys
GetWKSPublicKeyBytes(email string) ([]byte, error)
// Get JWKS
GetJwksX5u(cert *x509.Certificate) (string, error)
Ping() (err error)
// Authenticate is usually called by NewClient and it is not required that you manually call it.
Authenticate(auth *Authentication) (err error)
GetCredential(auth *Authentication) (token string, err error)
SetHTTPClient(client *http.Client)
}
Connector provides a common interface for external communications with TPP or Venafi Cloud
type ConnectorType ¶
type ConnectorType int
func (ConnectorType) String ¶
func (t ConnectorType) String() string
type Environment ¶
type SignOption ¶
type SignOption struct {
KeyID string `json:"-"`
Mechanism int `json:"-"`
DigestAlg string `json:"-"`
Payload []byte `json:"-"`
B64Flag bool `json:"-"`
RawFlag bool `json:"-"`
DigestFlag bool `json:"-"`
}
KeyID = CodeSign Protect environment key guid Mechanism = CodeSign Protect PKCS#11 mechanism DigestAlg = {sha1, sha256, sha384, sha512} Payload = Raw byte stream data to be signed B64 = Boolean -> is incoming data already Base64 encoded Raw = Boolean -> Do we need the resulting raw signature ASN1. encoded
Click to show internal directories.
Click to hide internal directories.