Documentation ¶
Index ¶
- Variables
- func NewPublicKeyFromJWK(j []byte) (crypto.PublicKey, error)
- func NewSignerFromJWK(j []byte) (cose.Signer, error)
- func ValidProfile(p eat.Profile) error
- type Entities
- type Entity
- type Locator
- type Meta
- func (o *Meta) FromCBOR(data []byte) error
- func (o *Meta) FromJSON(data []byte) error
- func (o *Meta) SetSigner(name string, uri *string) *Meta
- func (o *Meta) SetValidity(notAfter time.Time, notBefore *time.Time) *Meta
- func (o Meta) ToCBOR() ([]byte, error)
- func (o Meta) ToJSON() ([]byte, error)
- func (o Meta) Valid() error
- type Role
- type Roles
- type SignedCorim
- type Signer
- type Tag
- type UnsignedCorim
- func (o *UnsignedCorim) AddComid(c comid.Comid) *UnsignedCorim
- func (o *UnsignedCorim) AddCoswid(c swid.SoftwareIdentity) *UnsignedCorim
- func (o *UnsignedCorim) AddCots(c cots.ConciseTaStore) *UnsignedCorim
- func (o *UnsignedCorim) AddDependentRim(href string, thumbprint *swid.HashEntry) *UnsignedCorim
- func (o *UnsignedCorim) AddEntity(name string, regID *string, roles ...Role) *UnsignedCorim
- func (o *UnsignedCorim) AddProfile(urlOrOID string) *UnsignedCorim
- func (o *UnsignedCorim) FromCBOR(data []byte) error
- func (o *UnsignedCorim) FromJSON(data []byte) error
- func (o UnsignedCorim) GetID() string
- func (o *UnsignedCorim) SetID(v interface{}) *UnsignedCorim
- func (o *UnsignedCorim) SetRimValidity(notAfter time.Time, notBefore *time.Time) *UnsignedCorim
- func (o UnsignedCorim) ToCBOR() ([]byte, error)
- func (o UnsignedCorim) Valid() error
- type Validity
Constants ¶
This section is empty.
Variables ¶
var ( CoswidTag = []byte{0xd9, 0x01, 0xf9} // 505() ComidTag = []byte{0xd9, 0x01, 0xfa} // 506() )
var ( ContentType = "application/rim+cbor" NoExternalData = []byte("") HeaderLabelCorimMeta = int64(8) )
Functions ¶
func ValidProfile ¶
ValidProfile checks that the supplied profile is in one of the supported formats (i.e., URI or OID)
Types ¶
type Entities ¶
type Entities []Entity
Entities is an array of entity-map's
type Entity ¶
type Entity struct { EntityName string `cbor:"0,keyasint" json:"name"` RegID *comid.TaggedURI `cbor:"1,keyasint,omitempty" json:"regid,omitempty"` Roles Roles `cbor:"2,keyasint" json:"roles"` }
Entity stores an entity-map capable of CBOR and JSON serializations.
func (*Entity) SetEntityName ¶
SetEntityName is used to set the EntityName field of Entity using supplied name
type Locator ¶
type Locator struct { Href comid.TaggedURI `cbor:"0,keyasint" json:"href"` Thumbprint *swid.HashEntry `cbor:"1,keyasint,omitempty" json:"thumbprint,omitempty"` }
Locator is the internal representation of the corim-locator-map with CBOR and JSON serialization.
type Meta ¶
type Meta struct { Signer Signer `cbor:"0,keyasint" json:"signer"` Validity *Validity `cbor:"1,keyasint,omitempty" json:"validity,omitempty"` }
Meta stores a corim-meta-map with JSON and CBOR serializations. It carries information about the CoRIM signer and, optionally, a validity period associated with the signed assertion. A corim-meta-map is serialized to CBOR and added to the protected header structure in the signed-corim as a byte string
func (*Meta) SetSigner ¶
SetSigner populates the Signer element in the target Meta with the supplied name and optional URI
func (*Meta) SetValidity ¶
SetValidity sets the validity period of the target Meta to the supplied time range
type Roles ¶
type Roles []Role
func (Roles) MarshalJSON ¶
func (*Roles) UnmarshalJSON ¶
type SignedCorim ¶
type SignedCorim struct { UnsignedCorim UnsignedCorim Meta Meta // contains filtered or unexported fields }
SignedCorim encodes a signed-corim message (i.e., a COSE Sign1 wrapped CoRIM) with signature and verification methods
func (*SignedCorim) FromCOSE ¶
func (o *SignedCorim) FromCOSE(buf []byte) error
FromCOSE decodes and effects syntactic validation on the supplied signed-corim message, including the embedded unsigned-corim and corim-meta. On success, the unsigned-corim-map is made available via the UnsignedCorim field while the corim-meta-map is decoded into the Meta field.
type Signer ¶
type Signer struct { Name string `cbor:"0,keyasint" json:"name"` URI *comid.TaggedURI `cbor:"1,keyasint,omitempty" json:"uri,omitempty"` }
type UnsignedCorim ¶
type UnsignedCorim struct { ID swid.TagID `cbor:"0,keyasint" json:"corim-id"` Tags []Tag `cbor:"1,keyasint" json:"tags"` DependentRims *[]Locator `cbor:"2,keyasint,omitempty" json:"dependent-rims,omitempty"` Profiles *[]eat.Profile `cbor:"3,keyasint,omitempty" json:"profiles,omitempty"` RimValidity *Validity `cbor:"4,keyasint,omitempty" json:"validity,omitempty"` Entities *Entities `cbor:"5,keyasint,omitempty" json:"entities,omitempty"` }
UnsignedCorim is the top-level representation of the unsigned-corim-map with CBOR and JSON serialization.
func NewUnsignedCorim ¶
func NewUnsignedCorim() *UnsignedCorim
NewUnsignedCorim instantiates an empty UnsignedCorim
func (*UnsignedCorim) AddComid ¶
func (o *UnsignedCorim) AddComid(c comid.Comid) *UnsignedCorim
AddComid appends the CBOR encoded (and appropriately tagged) CoMID to the tags array of the unsigned-corim-map
func (*UnsignedCorim) AddCoswid ¶
func (o *UnsignedCorim) AddCoswid(c swid.SoftwareIdentity) *UnsignedCorim
AddCoswid appends the CBOR encoded (and appropriately tagged) CoSWID to the tags array of the unsigned-corim-map
func (*UnsignedCorim) AddCots ¶
func (o *UnsignedCorim) AddCots(c cots.ConciseTaStore) *UnsignedCorim
AddCots appends the CBOR encoded (and appropriately tagged) CoTS to the tags array of the unsigned-corim-map
func (*UnsignedCorim) AddDependentRim ¶
func (o *UnsignedCorim) AddDependentRim(href string, thumbprint *swid.HashEntry) *UnsignedCorim
AddDependentRim creates a corim-locator-map from the supplied arguments and appends it to the dependent RIMs in the unsigned-corim-map
func (*UnsignedCorim) AddEntity ¶
func (o *UnsignedCorim) AddEntity(name string, regID *string, roles ...Role) *UnsignedCorim
AddEntity adds an organizational entity, together with the roles this entity claims with regards to the CoRIM, to the target UnsignerCorim. name is the entity name, regID is a URI that uniquely identifies the entity. For the moment, roles can only be RoleManifestCreator.
func (*UnsignedCorim) AddProfile ¶
func (o *UnsignedCorim) AddProfile(urlOrOID string) *UnsignedCorim
AddProfile appends the supplied profile identifier (either a URL or OID) to the profiles array in the unsigned-corim-map
func (*UnsignedCorim) FromCBOR ¶
func (o *UnsignedCorim) FromCBOR(data []byte) error
FromCBOR deserializes a CBOR-encoded unsigned CoRIM into the target UnsignedCorim
func (*UnsignedCorim) FromJSON ¶
func (o *UnsignedCorim) FromJSON(data []byte) error
FromJSON deserializes a JSON-encoded unsigned CoRIM into the target UnsignedCorim
func (UnsignedCorim) GetID ¶
func (o UnsignedCorim) GetID() string
GetID retrieves the corim-id from the unsigned-corim-map as a string
func (*UnsignedCorim) SetID ¶
func (o *UnsignedCorim) SetID(v interface{}) *UnsignedCorim
SetID sets the corim-id in the unsigned-corim-map to the supplied value. The corim-id can be passed as UUID in string or binary form (i.e., byte array), or as a (non-empty) string
func (*UnsignedCorim) SetRimValidity ¶
func (o *UnsignedCorim) SetRimValidity(notAfter time.Time, notBefore *time.Time) *UnsignedCorim
SetRimValidity can be used to set the validity period of the CoRIM. The caller must supply a "not-after" timestamp and optionally a "not-before" timestamp.
func (UnsignedCorim) ToCBOR ¶
func (o UnsignedCorim) ToCBOR() ([]byte, error)
ToCBOR serializes the target unsigned CoRIM to CBOR
func (UnsignedCorim) Valid ¶
func (o UnsignedCorim) Valid() error
Valid checks the validity (according to the spec) of the target unsigned CoRIM
type Validity ¶
type Validity struct { NotBefore *time.Time `cbor:"0,keyasint,omitempty" json:"not-before,omitempty"` NotAfter time.Time `cbor:"1,keyasint" json:"not-after"` }
func NewValidity ¶
func NewValidity() *Validity