Documentation ¶
Overview ¶
Contains the API definitions for the CoAP and socket API. The gRPC API is in a separate file
Index ¶
- Constants
- func HashToSignerOpts(hashtype HashFunction, pssOpts *PSSOptions) (crypto.SignerOpts, error)
- func Receive(conn net.Conn) ([]byte, uint32, error)
- func Send(conn net.Conn, payload []byte, t uint32) error
- func SendError(conn net.Conn, format string, args ...interface{}) error
- type AttestationRequest
- type AttestationResponse
- type HashFunction
- type MeasureRequest
- type MeasureResponse
- type PSSOptions
- type SocketError
- type TLSCertRequest
- type TLSCertResponse
- type TLSSignRequest
- type TLSSignResponse
- type VerificationRequest
- type VerificationResponse
Constants ¶
View Source
const ( TypeError uint32 = 0 TypeAttest uint32 = 1 TypeVerify uint32 = 2 TypeMeasure uint32 = 3 TypeTLSSign uint32 = 4 TypeTLSCert uint32 = 5 )
View Source
const (
// Set maximum message length to 10 MB
MaxMsgLen = 1024 * 1024 * 10
)
Variables ¶
This section is empty.
Functions ¶
func HashToSignerOpts ¶
func HashToSignerOpts(hashtype HashFunction, pssOpts *PSSOptions) (crypto.SignerOpts, error)
Converts Protobuf hashtype to crypto.SignerOpts
func Receive ¶
Receive receives data from a socket with the following format
Len uint32 -> Length of the payload to be sent Type uint32 -> Type of the payload payload []byte -> CBOR-encoded payload
Types ¶
type AttestationRequest ¶
type AttestationResponse ¶
type AttestationResponse struct {
AttestationReport []byte `json:"attestationReport" cbor:"0,keyasint"`
}
type HashFunction ¶
type HashFunction int32
const ( HashFunction_SHA1 HashFunction = 0 HashFunction_SHA224 HashFunction = 1 HashFunction_SHA256 HashFunction = 2 HashFunction_SHA384 HashFunction = 3 HashFunction_SHA512 HashFunction = 4 HashFunction_MD4 HashFunction = 5 HashFunction_MD5 HashFunction = 6 HashFunction_MD5SHA1 HashFunction = 7 HashFunction_RIPEMD160 HashFunction = 8 HashFunction_SHA3_224 HashFunction = 9 HashFunction_SHA3_256 HashFunction = 10 HashFunction_SHA3_384 HashFunction = 11 HashFunction_SHA3_512 HashFunction = 12 HashFunction_SHA512_224 HashFunction = 13 HashFunction_SHA512_256 HashFunction = 14 HashFunction_BLAKE2s_256 HashFunction = 15 HashFunction_BLAKE2b_256 HashFunction = 16 HashFunction_BLAKE2b_384 HashFunction = 17 HashFunction_BLAKE2b_512 HashFunction = 18 )
func SignerOptsToHash ¶
func SignerOptsToHash(opts crypto.SignerOpts) (HashFunction, error)
Converts Hash Types from crypto.SignerOpts to the types specified in the CMC interface
type MeasureRequest ¶ added in v0.7.0
type MeasureResponse ¶ added in v0.7.0
type MeasureResponse struct {
Success bool `json:"success" cbor:"0,keyasint"`
}
type PSSOptions ¶
type PSSOptions struct {
SaltLength int32
}
type SocketError ¶
type SocketError struct {
Msg string `json:"msg" cbor:"0,keyasint"`
}
type TLSCertRequest ¶
type TLSCertRequest struct {
Id string `json:"id" cbor:"0,keyasint"`
}
type TLSCertResponse ¶
type TLSCertResponse struct {
Certificate [][]byte `json:"certificate" cbor:"0,keyasint"`
}
type TLSSignRequest ¶
type TLSSignRequest struct { Id string `json:"id" cbor:"0,keyasint"` Content []byte `json:"content" cbor:"1,keyasint"` Hashtype HashFunction `json:"hashType" cbor:"2,keyasint"` PssOpts *PSSOptions `json:"pssOpts" cbor:"3,keyasint"` }
type TLSSignResponse ¶
type TLSSignResponse struct {
SignedContent []byte `json:"signedContent" cbor:"0,keyasint"`
}
type VerificationRequest ¶
type VerificationResponse ¶
type VerificationResponse struct {
VerificationResult []byte `json:"verificationResult" cbor:"0,keyasint"`
}
Click to show internal directories.
Click to hide internal directories.