Documentation ¶
Index ¶
- Variables
- type Conn
- func (conn *Conn) AddCert(id string, name string, serial *big.Int, keyId []byte, expiry time.Time, ...) error
- func (conn *Conn) CertsByUUID(id uuid.UUID) ([]big.Int, error)
- func (conn *Conn) GetCertBySerial(serial *big.Int) ([]byte, error)
- func (conn *Conn) GetSerial() (*big.Int, error)
- func (conn *Conn) MarkRegistered(device string) error
- func (conn *Conn) SerialValid(serial *big.Int) (bool, error)
- func (conn *Conn) UnregisteredDevices() ([]string, error)
Constants ¶
This section is empty.
Variables ¶
var NonUnique = errors.New("Non Unique Serial")
NonUnique is an error that indicates a given serial number was not unique.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
func (*Conn) AddCert ¶
func (conn *Conn) AddCert(id string, name string, serial *big.Int, keyId []byte, expiry time.Time, cert []byte) error
AddCert adds a newly generated certificate to the database.
func (*Conn) CertsByUUID ¶
CertsByUUID returns a list of valid certs associated with a UUID
func (*Conn) GetCertBySerial ¶
GetCertBySerial gets certificate for the given serial.
func (*Conn) GetSerial ¶
Generate a serial number for a certificate. The serial number is required to be unique for all certificates generated by a given authority. To help with this, we will use a timestamp for the signature. We scan the database to make sure that timestamp is not already taken (to protect against clock changes).
func (*Conn) MarkRegistered ¶
MarkRegistered indicates that the given device has successfully been marked as registered with the Cloud service.
func (*Conn) SerialValid ¶
SerialValid checks if a valid certificate exists for the specified serial
func (*Conn) UnregisteredDevices ¶
UnregisteredDevices returns a list of devices that have not been registered with the cloud. This may need to be extended to return certificate information, if we add support for a cloud service that does not support signed certificates.