Documentation
¶
Index ¶
- type Client
- type Credential
- func (cred *Credential) CreateToken(req *http.Request, reqBody []byte) (string, error)
- func (cred *Credential) EnrollmentID() (string, error)
- func (cred *Credential) Load() error
- func (cred *Credential) SetVal(val interface{}) error
- func (cred *Credential) Store() error
- func (cred *Credential) Val() (interface{}, error)
- type Identity
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { NewX509Identity(name string, cred *Credential) Identity GetCSP() cccsp.CCCSP }
Client represents a client that will load/store an credential
type Credential ¶
type Credential struct {
// contains filtered or unexported fields
}
Credential represents a X509 credential. Implements Credential interface
func NewCredential ¶
func NewCredential(certFile, keyFile string, c Client) *Credential
NewCredential is constructor for X509 Credential
func (*Credential) CreateToken ¶
CreateToken creates token based on this X509 credential
func (*Credential) EnrollmentID ¶
func (cred *Credential) EnrollmentID() (string, error)
EnrollmentID returns enrollment ID of this X509 credential
func (*Credential) Load ¶
func (cred *Credential) Load() error
Load loads the certificate and key from the location specified by certFile attribute using the BCCSP of the client.
func (*Credential) SetVal ¶
func (cred *Credential) SetVal(val interface{}) error
SetVal sets *Signer for this X509 credential
func (*Credential) Store ¶
func (cred *Credential) Store() error
Store stores the certificate associated with this X509 credential to the location specified by certFile attribute
func (*Credential) Val ¶
func (cred *Credential) Val() (interface{}, error)
Val returns *Signer associated with this X509 credential
type Identity ¶
type Identity interface { GetECert() *Signer GetName() string GetX509Credential() *Credential Store() error }
Identity represents an identity
type Signer ¶
type Signer struct {
// contains filtered or unexported fields
}
Signer represents a signer
func (*Signer) Attributes ¶
func (s *Signer) Attributes() (*attrmgr.Attributes, error)
Attributes returns the attributes that are in the certificate
func (*Signer) GetName ¶
GetName returns common name that is retrieved from the Subject of the certificate
func (*Signer) GetX509Cert ¶
func (s *Signer) GetX509Cert() *x509.Certificate
GetX509Cert returns the x509 certificate for this signer