Documentation
¶
Index ¶
- func EncodeEvidenceToJSON(e *Evidence) ([]byte, error)
- func ValidateAndEncodeEvidenceToJSON(e *Evidence) ([]byte, error)
- type CBORCollection
- type Evidence
- func (e *Evidence) GetImplementationID() *[]byte
- func (e *Evidence) GetInstanceID() *[]byte
- func (e *Evidence) GetRealmPublicKey() *[]byte
- func (e *Evidence) MarshalJSON() ([]byte, error)
- func (e *Evidence) SetClaims(p platform.IClaims, r realm.IClaims) error
- func (e *Evidence) SetUnvalidatedClaims(p platform.IClaims, r realm.IClaims)
- func (e *Evidence) Sign(pSigner cose.Signer, rSigner cose.Signer) ([]byte, error)
- func (e *Evidence) UnmarshalCBOR(buf []byte) error
- func (e *Evidence) UnmarshalJSON(data []byte) error
- func (e *Evidence) Validate() error
- func (e *Evidence) ValidateAndSign(pSigner cose.Signer, rSigner cose.Signer) ([]byte, error)
- func (e *Evidence) Verify(iak crypto.PublicKey) error
- type JSONCollection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeEvidenceToJSON ¶ added in v1.3.0
EncodeEvidenceToJSON marshals CCA evidence to JSON.
func ValidateAndEncodeEvidenceToJSON ¶ added in v1.3.0
ValidateAndEncodeEvidenceToJSON validates and then marshals CCA evidence to JSON.
Types ¶
type CBORCollection ¶
type CBORCollection struct {
PlatformToken *[]byte `cbor:"44234,keyasint"`
RealmToken *[]byte `cbor:"44241,keyasint"`
}
CBORCollection is a wrapper containing the CBOR data for both platform and realm tokens.
type Evidence ¶
type Evidence struct {
PlatformClaims platform.IClaims
RealmClaims realm.IClaims
// contains filtered or unexported fields
}
Evidence is a wrapper around CcaToken
func DecodeAndValidateEvidenceFromCBOR ¶ added in v1.3.0
DecodeAndValidateEvidenceFromCBOR unmarshals CCA claims collection from provided CBOR and validates both sets of claims.
func DecodeAndValidateEvidenceFromJSON ¶ added in v1.3.0
DecodeAndValidateEvidenceFromJSON unmarshals CCA claims collection from provided JSON and validates both sets of claims.
func DecodeEvidenceFromCBOR ¶ added in v1.3.0
DecodeEvidenceFromCBOR unmarshals CCA claims collection from provided CBOR.
func DecodeEvidenceFromJSON ¶ added in v1.3.0
DecodeEvidenceFromJSON unmarshals CCA claims collection from provided JSON.
func (*Evidence) GetImplementationID ¶
GetImplementationID returns the ImplementationID from CCA platform token or a nil pointer if no suitable ImplementationID could be located.
func (*Evidence) GetInstanceID ¶
GetInstanceID returns the InstanceID from CCA platform token or a nil pointer if no suitable InstanceID could be located.
func (*Evidence) GetRealmPublicKey ¶
GetRealmPublicKey returns the RMM Public Key RMM Public Key is used to verify the signature on the Realm Token
func (*Evidence) MarshalJSON ¶
MarshalJSON encodes the realm and platform claims into a JSON object.
func (*Evidence) SetClaims ¶
SetClaims sets the specified realm and platform claims in the evidence aend ensures they are valid.
func (*Evidence) SetUnvalidatedClaims ¶ added in v1.1.0
SetUnvalidatedClaims is the same as SetClaims but without validation.
func (*Evidence) Sign ¶
Sign signs the given evidence using the supplied Platform and Realm Signer and returns the complete CCA token as CBOR bytes
func (*Evidence) UnmarshalCBOR ¶ added in v1.3.0
UnmarshalCBOR extracts the realm and platform tokens from the serialized collection.
func (*Evidence) UnmarshalJSON ¶
UnmarshalJSON extracts the realm and platform tokens from the serialized collection.
func (*Evidence) Validate ¶ added in v1.3.0
Validate that both platform and realm cliams have been set and are valid.
func (*Evidence) ValidateAndSign ¶ added in v1.3.0
ValidateAndSign validates and then signs the given evidence using the supplied Platform and Realm Signer and returns the complete CCA token as CBOR bytes
type JSONCollection ¶
type JSONCollection struct {
PlatformToken json.RawMessage `json:"cca-platform-token,omitempty"`
RealmToken json.RawMessage `json:"cca-realm-delegated-token,omitempty"`
}
JSONCollection is a wrapper containing the JSON data for both platform and realm tokens.