Documentation ¶
Index ¶
- Constants
- Variables
- func AnkiVersion() string
- func BootID() string
- func CertCommonName(cloudDir string) (string, error)
- func CheckFactoryCloudFiles(cloudDir, canonicalESN string) error
- func InstallCrashReporter(procname string)
- func OSUserAgent() grpc.DialOption
- func OSVersion() string
- func PEMData(cloudDir string) ([]byte, error)
- func ParseX509Certificate(cloudDir string) (*x509.Certificate, error)
- func ReadESN() (string, error)
- func TLSKeyPair(cloudDir string) (tls.Certificate, error)
- func UninstallCrashReporter()
- func VictorVersion() string
- func WriteFaceErrorCode(code uint16) error
- type DeviceCertRecord
Constants ¶
const ( CertFilename = "AnkiRobotDeviceCert.pem" KeysFilename = "AnkiRobotDeviceKeys.pem" )
const ( GatewayKey = "/tmp/anki/gateway/trust.key" GatewayCert = "/tmp/anki/gateway/trust.cert" )
Variables ¶
var DefaultCloudDir = "/factory/cloud"
Filenames and default directory for certificate/keys data
Functions ¶
func AnkiVersion ¶
func AnkiVersion() string
func CertCommonName ¶
CertCommonName returns the CommonName field stored in the certificate in the given factory directory
func CheckFactoryCloudFiles ¶
CheckFactoryCloudFiles checks that the factory-programmed "Cloud" directory has been populated with the expected files, and checks that the information in those files looks correct and is consistent with the robot's Electronic Serial Number (ESN).
cloudDir - path of the directory with cloud files. Eg "/factory/cloud".
canonicalESN - the ESN of the robot, in "canonical" string form with lowercase hexadecimal digits. Eg "00e00012" for the 32-bit ESN value 14680082.
func InstallCrashReporter ¶
func InstallCrashReporter(procname string)
func OSUserAgent ¶
func OSUserAgent() grpc.DialOption
OSUserAgent returns a grpc.DialOption that will set a user agent with the string: "Victor/<os_version>", if the OS version can be obtained. Otherwise, nil is returned.
func OSVersion ¶
func OSVersion() string
OSVersion returns a string representation of the OS version, like: 4.15.0-33-generic.x86_64.GNU/Linux
func PEMData ¶
PEMData returns the PEM data located in the given cloud factory directory's certificate file
func ParseX509Certificate ¶
func ParseX509Certificate(cloudDir string) (*x509.Certificate, error)
ParseX509Certificate parses an x509 certificate from the given cloud factory directory
func TLSKeyPair ¶
func TLSKeyPair(cloudDir string) (tls.Certificate, error)
TLSKeyPair returns the public and private key in the given factory directory as a tls.Certificate
func UninstallCrashReporter ¶
func UninstallCrashReporter()
func VictorVersion ¶
func VictorVersion() string
func WriteFaceErrorCode ¶
WriteFaceErrorCode writes the given numerical code to the robot's face with an error message
Types ¶
type DeviceCertRecord ¶
type DeviceCertRecord struct { CommonName string `json:"CommonName"` // CN value in cert Distinguished Name KeysDigest string `json:"KeysDigest"` CertDigest string `json:"CertDigest"` CertSignatureAlgorithm string `json:"CertSignatureAlgorithm"` CertSignature string `json:"CertSignature"` }
DeviceCertRecord is a record of useful facts about an individual device certificate. The device may or may not be a robot.