Documentation ¶
Overview ¶
Example (CompletePrimaryTag) ¶
tag, _ := NewTag( "com.acme.rrd2013-ce-sp1-v4-1-5-0", "ACME Roadrunner Detector 2013 Coyote Edition SP1", "4.1.5", ) entity, _ := swid.NewEntity("The ACME Corporation", swid.RoleTagCreator, swid.RoleSoftwareCreator) _ = entity.SetRegID("acme.com") _ = tag.AddEntity(*entity) entity, _ = swid.NewEntity("Coyote Services, Inc.", swid.RoleDistributor) _ = entity.SetRegID("mycoyote.com") _ = tag.AddEntity(*entity) link, _ := swid.NewLink("www.gnu.org/licenses/gpl.txt", *swid.NewRel("license")) _ = tag.AddLink(*link) meta := swid.SoftwareMeta{ ActivationStatus: "trial", Product: "Roadrunner Detector", ColloquialVersion: "2013", Edition: "coyote", Revision: "sp1", } _ = tag.AddSoftwareMeta(meta) fileSize := int64(532712) fileHash, _ := hex.DecodeString("a314fc2dc663ae7a6b6bc6787594057396e6b3f569cd50fd5ddb4d1bbafd2b6a") dir := swid.Directory{ FileSystemItem: swid.FileSystemItem{ Root: "%programdata%", FsName: "rrdetector", }, PathElements: &swid.PathElements{ Files: &swid.Files{ swid.File{ FileSystemItem: swid.FileSystemItem{ FsName: "rrdetector.exe", }, Size: &fileSize, Hash: &swid.HashEntry{ HashAlgID: 1, HashValue: fileHash, }, }, }, }, } file := swid.File{ FileSystemItem: swid.FileSystemItem{ FsName: "test.exe", }, Size: &fileSize, Hash: &swid.HashEntry{ HashAlgID: 1, HashValue: fileHash, }, } payload := swid.NewPayload() _ = payload.AddDirectory(dir) _ = payload.AddFile(file) tag.Payload = payload // encode tag to XML data, _ := tag.ToXML() fmt.Println(string(data))
Output: <AbbreviatedSwidTag xmlns="http://standards.iso.org/iso/19770/-2/2015/schema.xsd" tagId="com.acme.rrd2013-ce-sp1-v4-1-5-0" name="ACME Roadrunner Detector 2013 Coyote Edition SP1" version="4.1.5"><Meta activationStatus="trial" colloquialVersion="2013" edition="coyote" product="Roadrunner Detector" revision="sp1"></Meta><Entity name="The ACME Corporation" regid="acme.com" role="tagCreator softwareCreator"></Entity><Entity name="Coyote Services, Inc." regid="mycoyote.com" role="distributor"></Entity><Link href="www.gnu.org/licenses/gpl.txt" rel="license"></Link><Payload><Directory name="rrdetector" root="%programdata%"><File name="rrdetector.exe" size="532712" hash="sha-256;oxT8LcZjrnpra8Z4dZQFc5bms/VpzVD9XdtNG7r9K2o="></File></Directory><File name="test.exe" size="532712" hash="sha-256;oxT8LcZjrnpra8Z4dZQFc5bms/VpzVD9XdtNG7r9K2o="></File></Payload></AbbreviatedSwidTag>
Example (Decode_CBOR) ¶
cots := ConciseTaStore{} err := cots.FromCBOR(cotsCBOR) if err != nil { fmt.Printf("FAIL: %v", err) } else { fmt.Println("OK") }
Output: OK
Example (Decode_JSON) ¶
cots := ConciseTaStore{} err := cots.FromJSON([]byte(ConciseTaStoreTemplateSingleOrg)) if err != nil { fmt.Printf("FAIL: %v", err) } else { fmt.Println("OK") }
Output: OK
Example (Encode_environment_SWID_keys_cert) ¶
exampleTaData := []byte{0x30, 0x82, 0x1, 0xe5, 0x30, 0x82, 0x1, 0x8b, 0xa0, 0x3, 0x2, 0x1, 0x2, 0x2, 0x14, 0xb, 0xdc, 0x4a, 0xa0, 0x51, 0x79, 0x50, 0x3e, 0x58, 0xf2, 0x75, 0xd5, 0x52, 0x46, 0x73, 0x47, 0xbc, 0xaf, 0xb5, 0x33, 0x30, 0xa, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x4, 0x3, 0x2, 0x30, 0x52, 0x31, 0xb, 0x30, 0x9, 0x6, 0x3, 0x55, 0x4, 0x6, 0xc, 0x2, 0x55, 0x53, 0x31, 0x1a, 0x30, 0x18, 0x6, 0x3, 0x55, 0x4, 0xa, 0xc, 0x11, 0x5a, 0x65, 0x73, 0x74, 0x79, 0x20, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x27, 0x30, 0x25, 0x6, 0x3, 0x55, 0x4, 0x3, 0xc, 0x1e, 0x5a, 0x65, 0x73, 0x74, 0x79, 0x20, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x30, 0x1e, 0x17, 0xd, 0x32, 0x32, 0x30, 0x35, 0x31, 0x39, 0x31, 0x35, 0x31, 0x33, 0x30, 0x37, 0x5a, 0x17, 0xd, 0x33, 0x32, 0x30, 0x35, 0x31, 0x36, 0x31, 0x35, 0x31, 0x33, 0x30, 0x37, 0x5a, 0x30, 0x52, 0x31, 0xb, 0x30, 0x9, 0x6, 0x3, 0x55, 0x4, 0x6, 0xc, 0x2, 0x55, 0x53, 0x31, 0x1a, 0x30, 0x18, 0x6, 0x3, 0x55, 0x4, 0xa, 0xc, 0x11, 0x5a, 0x65, 0x73, 0x74, 0x79, 0x20, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x27, 0x30, 0x25, 0x6, 0x3, 0x55, 0x4, 0x3, 0xc, 0x1e, 0x5a, 0x65, 0x73, 0x74, 0x79, 0x20, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x30, 0x59, 0x30, 0x13, 0x6, 0x7, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x2, 0x1, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x3, 0x1, 0x7, 0x3, 0x42, 0x0, 0x4, 0x97, 0xcf, 0x6d, 0x70, 0xd7, 0x6a, 0x30, 0x40, 0xc, 0x79, 0xf1, 0xeb, 0xab, 0x6a, 0xd6, 0x16, 0x88, 0x71, 0x24, 0x87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, 0x50, 0x75, 0x4b, 0xe8, 0xaa, 0x58} swname := "Bitter Paper" cots := NewConciseTaStore(). AddEnvironmentGroup( *NewEnvironmentGroup(). SetAbbreviatedSwidTag( AbbreviatedSwidTag{ Entities: swid.Entities{ makeZestyEntityWithRoles(swid.RoleSoftwareCreator), }, }, ), ). AddPermClaims( EatCWTClaim{ SoftwareNameLabel: &swname, }, ). SetKeys( TasAndCas{ Tas: []TrustAnchor{ *NewTrustAnchor(). SetData(exampleTaData). SetFormat(0), }, }, ) cbor, err := cots.ToCBOR() if err == nil { fmt.Printf("%x\n", cbor) } json, err := cots.ToJSON() if err == nil { fmt.Printf("%s\n", string(json)) }
Output: a30281a102a102a2181f715a657374792048616e64732c20496e632e1821020481a11903e66c42697474657220506170657206a1008182005901e9308201e53082018ba00302010202140bdc4aa05179503e58f275d552467347bcafb533300a06082a8648ce3d0403023052310b300906035504060c025553311a3018060355040a0c115a657374792048616e64732c20496e632e3127302506035504030c1e5a657374792048616e64732c20496e632e20547275737420416e63686f72301e170d3232303531393135313330375a170d3332303531363135313330375a3052310b300906035504060c025553311a3018060355040a0c115a657374792048616e64732c20496e632e3127302506035504030c1e5a657374792048616e64732c20496e632e20547275737420416e63686f723059301306072a8648ce3d020106082a8648ce3d0301070342000497cf6d70d76a30400c79f1ebab6ad6168871248710d4f4c1207adaef02d19867136791f2c2b29f6f2dcc3c2125c2f2d2fdee4f59094b67af43332f0dfb5ca440a33f303d301d0603551d0e04160414f6dad1e5128bbf0de9e95343b371c6f7ffe7e26e300b0603551d0f040403020284300f0603551d130101ff040530030101ff300a06082a8648ce3d040302034800304502201da58be7fa442c6cd849ef3567224a9203c225158966b21afd40f3192cf347980221009827b3e0a1aba2514a3994fa6efa9fd6c610b8905fbed93fcb5250754be8aa58 {"environments":[{"swidtag":{"entity":[{"entity-name":"Zesty Hands, Inc.","role":"softwareCreator"}]}}],"permclaims":[{"swname":"Bitter Paper"}],"keys":{"tas":[{"format":0,"data":"MIIB5TCCAYugAwI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4, 0xa, 0xc, 0x7, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x31, 0x1d, 0x30, 0x1b, 0x6, 0x3, 0x55, 0x4, 0x3, 0xc, 0x14, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x30, 0x1e, 0x17, 0xd, 0x32, 0x32, 0x30, 0x35, 0x31, 0x39, 0x31, 0x35, 0x31, 0x33, 0x30, 0x37, 0x5a, 0x17, 0xd, 0x33, 0x32, 0x30, 0x35, 0x31, 0x36, 0x31, 0x35, 0x31, 0x33, 0x30, 0x37, 0x5a, 0x30, 0x3e, 0x31, 0xb, 0x30, 0x9, 0x6, 0x3, 0x55, 0x4, 0x6, 0xc, 0x2, 0x55, 0x53, 0x31, 0x10, 0x30, 0xe, 0x6, 0x3, 0x55, 0x4, 0xa, 0xc, 0x7, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x31, 0x1d, 0x30, 0x1b, 0x6, 0x3, 0x55, 0x4, 0x3, 0xc, 0x14, 0x45, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x30, 0x59, 0x30, 0x13, 0x6, 0x7, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x2, 0x1, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x3, 0x1, 0x7, 0x3, 0x42, 0x0, 0x4, 0xe3, 0x51, 0xaa, 0x10, 0x39, 0x24, 0x7, 0xa4, 0xbd, 0x3, 0x7c, 0xa0, 0xbc, 0x11, 0x54, 0xd0, 0xe7, 0x1, 0xf0, 0x67, 0x4f, 0x39, 0xcb, 0x2c, 0x4f, 0x92, 0x10, 0x69, 0x2c, 0xeb, 0xbe, 0xec, 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, 0x73, 0x74, 0x20, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0xa0, 0x82, 0x1, 0xe5, 0x30, 0x82, 0x1, 0x8b, 0xa0, 0x3, 0x2, 0x1, 0x2, 0x2, 0x14, 0xb, 0xdc, 0x4a, 0xa0, 0x51, 0x79, 0x50, 0x3e, 0x58, 0xf2, 0x75, 0xd5, 0x52, 0x46, 0x73, 0x47, 0xbc, 0xaf, 0xb5, 0x33, 0x30, 0xa, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x4, 0x3, 0x2, 0x30, 0x52, 0x31, 0xb, 0x30, 0x9, 0x6, 0x3, 0x55, 0x4, 0x6, 0xc, 0x2, 0x55, 0x53, 0x31, 0x1a, 0x30, 0x18, 0x6, 0x3, 0x55, 0x4, 0xa, 0xc, 0x11, 0x5a, 0x65, 0x73, 0x74, 0x79, 0x20, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x27, 0x30, 0x25, 0x6, 0x3, 0x55, 0x4, 0x3, 0xc, 0x1e, 0x5a, 0x65, 0x73, 0x74, 0x79, 0x20, 0x48, 0x61, 0x6e, 0x64, 0x73, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x30, 0x1e, 0x17, 0xd, 0x32, 0x32, 0x30, 0x35, 0x31, 0x39, 0x31, 0x35, 0x31, 0x33, 0x30, 0x37, 0x5a, 0x17, 0xd, 0x33, 0x32, 0x30, 0x35, 0x31, 0x36, 0x31, 0x35, 0x31, 0x33, 0x30, 0x37, 0x5a, 0x30, 0x52, 0x31, 0xb, 0x30, 0x9, 0x6, 0x3, 0x55, 0x4, 0x6, 0xc, 0x2, 0x55, 0x53, 0x31, 0x1a, 0x30, 0x18, 0x6, 0x3, 0x55, 0x4, 0xa, 0xc, 0x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 0x30, 0x9, 0x6, 0x3, 0x55, 0x4, 0x6, 0xc, 0x2, 0x55, 0x53, 0x31, 0x1f, 0x30, 0x1d, 0x6, 0x3, 0x55, 0x4, 0xa, 0xc, 0x16, 0x53, 0x6e, 0x6f, 0x62, 0x62, 0x69, 0x73, 0x68, 0x20, 0x41, 0x70, 0x70, 0x61, 0x72, 0x65, 0x6c, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x2c, 0x30, 0x2a, 0x6, 0x3, 0x55, 0x4, 0x3, 0xc, 0x23, 0x53, 0x6e, 0x6f, 0x62, 0x62, 0x69, 0x73, 0x68, 0x20, 0x41, 0x70, 0x70, 0x61, 0x72, 0x65, 0x6c, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x20, 0x54, 0x72, 0x75, 0x73, 0x74, 0x20, 0x41, 0x6e, 0x63, 0x68, 0x6f, 0x72, 0x30, 0x1e, 0x17, 0xd, 0x32, 0x32, 0x30, 0x35, 0x31, 0x39, 0x31, 0x35, 0x31, 0x33, 0x30, 0x38, 0x5a, 0x17, 0xd, 0x33, 0x32, 0x30, 0x35, 0x31, 0x36, 0x31, 0x35, 0x31, 0x33, 0x30, 0x38, 0x5a, 0x30, 0x5c, 0x31, 0xb, 0x30, 0x9, 0x6, 0x3, 0x55, 0x4, 0x6, 0xc, 0x2, 0x55, 0x53, 0x31, 0x1f, 0x30, 0x1d, 0x6, 0x3, 0x55, 0x4, 0xa, 0xc, 0x16, 0x53, 0x6e, 0x6f, 0x62, 0x62, 0x69, 0x73, 0x68, 0x20, 0x41, 0x70, 0x70, 0x61, 0x72, 0x65, 0x6c, 0x2c, 0x20, 0x49, 0x6e, 0x63, 0x2e, 0x31, 0x2c, 0x30, 0x2a, 0x6, 0x3, 0x55, 0x4, 0x3, 0xc, 0x23, 0x53, 0x6e, 0x6f, 0x62, 0x62, 0x69, 0x73, 0x68, 0x20, 0x41, 0x70, 0x70, 0x61, 0x72, 0x65, 0x6c, 0x2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 0x46, 0x2, 0x21, 0x0, 0xb6, 0x71, 0xfe, 0x37, 0x7f, 0x73, 0xcf, 0x94, 0x23, 0xba, 0xfd, 0xdc, 0x6f, 0xe3, 0x47, 0xed, 0x22, 0xc, 0x71, 0x4e, 0x82, 0x87, 0x17, 0xbd, 0x94, 0xcc, 0x43, 0x6f, 0xef, 0xec, 0xb8, 0xca, 0x2, 0x21, 0x0, 0x81, 0xad, 0xb, 0xfa, 0xfa, 0x48, 0x66, 0x85, 0x31, 0xa3, 0xfb, 0xcc, 0x3d, 0x84, 0x96, 0x80, 0x6e, 0x21, 0x74, 0xed, 0xc9, 0x6b, 0xbc, 0x1f, 0x9, 0x7e, 0x60, 0x67, 0x57, 0x45, 0x8f, 0x77} cots := NewConciseTaStore(). SetTagIdentity("ab0f44b1-bfdc-4604-ab4a-30f80407ebcc", nil). AddEnvironmentGroup( *NewEnvironmentGroup(). SetNamedTaStore("Miscellaneous TA Store"), ). SetKeys( TasAndCas{ Tas: []TrustAnchor{ *NewTrustAnchor(). SetData(exampleTaData1). SetFormat(0), *NewTrustAnchor(). SetData(exampleTaData2). SetFormat(1), *NewTrustAnchor(). SetData(exampleTaData3). SetFormat(1), }, }, ) cbor, err := cots.ToCBOR() if err == nil { fmt.Printf("%x\n", cbor) } json, err := cots.ToJSON() if err == nil { fmt.Printf("%s\n", string(json)) }
Output: a301a10050ab0f44b1bfdc4604ab4a30f80407ebcc0281a103764d697363656c6c616e656f75732054412053746f726506a1008382005901c1308201bd30820164a003020102021500d09d90bf3d525cc773d522ed77d59e22bba45b88300a06082a8648ce3d040302303e310b300906035504060c0255533110300e060355040a0c074578616d706c65311d301b06035504030c144578616d706c6520547275737420416e63686f72301e170d3232303531393135313330375a170d3332303531363135313330375a303e310b300906035504060c0255533110300e060355040a0c074578616d706c65311d301b06035504030c144578616d706c6520547275737420416e63686f723059301306072a8648ce3d020106082a8648ce3d03010703420004e351aa10392407a4bd037ca0bc1154d0e701f0674f39cb2c4f9210692cebbeec1d27977dc56165751e0e237bfdfb1536e99a884591429661df35cfc0bf2b50cca33f303d301d0603551d0e04160414015c45c9acb0462a715dd710a078c01549f1013f300b0603551d0f040403020284300f0603551d130101ff040530030101ff300a06082a8648ce3d040302034700304402200b06274006c7e9cc6d254cbf4487d6fa0146ea9f317e9281196e0be9a6fbedf5022056813e6e110dd23eb048fcde3e32eb11d0fe3c48328c7279adb035d523eaff5382015902baa28202b6308202b23059301306072a8648ce3d020106082a8648ce3d0301070342000497cf6d70d76a30400c79f1ebab6ad6168871248710d4f4c1207adaef02d19867136791f2c2b29f6f2dcc3c2125c2f2d2fdee4f59094b67af43332f0dfb5ca4400414f6dad1e5128bbf0de9e95343b371c6f7ffe7e26e3082023d3052310b300906035504060c025553311a3018060355040a0c115a657374792048616e64732c20496e632e3127302506035504030c1e5a657374792048616e64732c20496e632e20547275737420416e63686f72a08201e53082018ba00302010202140bdc4aa05179503e58f275d552467347bcafb533300a06082a8648ce3d0403023052310b300906035504060c025553311a3018060355040a0c115a657374792048616e64732c20496e632e3127302506035504030c1e5a657374792048616e64732c20496e632e20547275737420416e63686f72301e170d3232303531393135313330375a170d3332303531363135313330375a3052310b300906035504060c025553311a3018060355040a0c115a657374792048616e64732c20496e632e3127302506035504030c1e5a657374792048616e64732c20496e632e20547275737420416e63686f723059301306072a8648ce3d020106082a8648ce3d0301070342000497cf6d70d76a30400c79f1ebab6ad6168871248710d4f4c1207adaef02d19867136791f2c2b29f6f2dcc3c2125c2f2d2fdee4f59094b67af43332f0dfb5ca440a33f303d301d0603551d0e04160414f6dad1e5128bbf0de9e95343b371c6f7ffe7e26e300b0603551d0f040403020284300f0603551d130101ff040530030101ff300a06082a8648ce3d040302034800304502201da58be7fa442c6cd849ef3567224a9203c225158966b21afd40f3192cf347980221009827b3e0a1aba2514a3994fa6efa9fd6c610b8905fbed93fcb5250754be8aa5882015902d9a28202d5308202d13059301306072a8648ce3d020106082a8648ce3d03010703420004cdd1fe64cf2c04cd93986da576dcedcdf1c92edfd2682cd8e51cfc0409b5c30d6a742e900ed73db8f3f868cba516fd364c4cf3d1ffddd7c07b06d7a992172f1704148a84cff98095a3bc36d6eea518d6978d9bd71f603082025c305c310b300906035504060c025553311f301d060355040a0c16536e6f6262697368204170706172656c2c20496e632e312c302a06035504030c23536e6f6262697368204170706172656c2c20496e632e20547275737420416e63686f72a08201fa3082019fa0030201020214101b934465c01045441e1bb8c5a7c09ea9bea988300a06082a8648ce3d040302305c310b300906035504060c025553311f301d060355040a0c16536e6f6262697368204170706172656c2c20496e632e312c302a06035504030c23536e6f6262697368204170706172656c2c20496e632e20547275737420416e63686f72301e170d3232303531393135313330385a170d3332303531363135313330385a305c310b300906035504060c025553311f301d060355040a0c16536e6f6262697368204170706172656c2c20496e632e312c302a06035504030c23536e6f6262697368204170706172656c2c20496e632e20547275737420416e63686f723059301306072a8648ce3d020106082a8648ce3d03010703420004cdd1fe64cf2c04cd93986da576dcedcdf1c92edfd2682cd8e51cfc0409b5c30d6a742e900ed73db8f3f868cba516fd364c4cf3d1ffddd7c07b06d7a992172f17a33f303d301d0603551d0e041604148a84cff98095a3bc36d6eea518d6978d9bd71f60300b0603551d0f040403020284300f0603551d130101ff040530030101ff300a06082a8648ce3d0403020349003046022100b671fe377f73cf9423bafddc6fe347ed220c714e828717bd94cc436fefecb8ca02210081ad0bfafa48668531a3fbcc3d8496806e2174edc96bbc1f097e606757458f77 {"tag-identity":{"id":"ab0f44b1-bfdc-4604-ab4a-30f80407ebcc"},"environments":[{"namedtastore":"Miscellaneous TA Store"}],"keys":{"tas":[{"format":0,"data":"MIIBvTCCAWSgAwIBAgIVANCdkL89UlzHc9Ui7XfVniK7pFuIMAoGCCqGSM49BAMCMD4xCzAJBgNVBAYMAlVTMRAwDgYDVQQKDAdFeGFtcGxlMR0wGwYDVQQDDBRFeGFtcGxlIFRydXN0IEFuY2hvcjAeFw0yMjA1MTkxNTEzMDdaFw0zMjA1MTYxNTEzMDdaMD4xCzAJBgNVBAYMAlVTMRAwDgYDV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MAsGA1UdDwQEAwIChDAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQC2cf43f3PPlCO6/dxv40ftIgxxToKHF72UzENv7+y4ygIhAIGtC/r6SGaFMaP7zD2EloBuIXTtyWu8Hwl+YGdXRY93"}]}}
Example (Encode_single_organization_keys_spki) ¶
tagVersion := uint(5) exampleTaData := []byte{0x30, 0x59, 0x30, 0x13, 0x6, 0x7, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x2, 0x1, 0x6, 0x8, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x3, 0x1, 0x7, 0x3, 0x42, 0x0, 0x4, 0xad, 0x8a, 0xc, 0x1, 0xda, 0x9e, 0xda, 0x2, 0x53, 0xdc, 0x2b, 0xc2, 0x72, 0x27, 0xd9, 0xc7, 0x21, 0x3d, 0xf8, 0xdf, 0x13, 0xe8, 0x9c, 0xb9, 0xcd, 0xb7, 0xa8, 0xe4, 0xb6, 0x2d, 0x9c, 0xe8, 0xa9, 0x9a, 0x2d, 0x70, 0x5c, 0xf, 0x7f, 0x80, 0xdb, 0x65, 0xc0, 0x6, 0xd1, 0x9, 0x14, 0x22, 0xb4, 0x7f, 0xc6, 0x11, 0xcb, 0xd4, 0x68, 0x69, 0x73, 0x3d, 0x9c, 0x48, 0x38, 0x84, 0xd5, 0xfe} cots := NewConciseTaStore(). SetTagIdentity("ab0f44b1-bfdc-4604-ab4a-30f80407ebcc", &tagVersion). AddEnvironmentGroup( *NewEnvironmentGroup(). SetEnvironment( comid.Environment{ Class: comid.NewClassOID("1.2.3.4.5"). SetVendor("Worthless Sea, Inc."), }, ), ). SetKeys( TasAndCas{ Tas: []TrustAnchor{ *NewTrustAnchor(). SetData(exampleTaData). SetFormat(2), }, }, ) cbor, err := cots.ToCBOR() if err == nil { fmt.Printf("%x\n", cbor) } json, err := cots.ToJSON() if err == nil { fmt.Printf("%s\n", string(json)) }
Output: a301a20050ab0f44b1bfdc4604ab4a30f80407ebcc01050281a101a100a200d86f442a0304050173576f7274686c657373205365612c20496e632e06a100818202585b3059301306072a8648ce3d020106082a8648ce3d03010703420004ad8a0c01da9eda0253dc2bc27227d9c7213df8df13e89cb9cdb7a8e4b62d9ce8a99a2d705c0f7f80db65c006d1091422b47fc611cbd46869733d9c483884d5fe {"tag-identity":{"id":"ab0f44b1-bfdc-4604-ab4a-30f80407ebcc","version":5},"environments":[{"environment":{"class":{"id":{"type":"oid","value":"1.2.3.4.5"},"vendor":"Worthless Sea, Inc."}}}],"keys":{"tas":[{"format":2,"data":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAErYoMAdqe2gJT3CvCcifZxyE9+N8T6Jy5zbeo5LYtnOipmi1wXA9/gNtlwAbRCRQitH/GEcvUaGlzPZxIOITV/g=="}]}}
Example (Links) ¶
// make new tag tag, _ := NewTag("example.acme.roadrunner-sw-v1-0-0", "Roadrunner software bundle", "1.0.0") // make entity and add it to the tag entity, _ := swid.NewEntity("ACME Ltd", swid.RoleTagCreator, swid.RoleSoftwareCreator, swid.RoleAggregator) _ = entity.SetRegID("acme.example") _ = tag.AddEntity(*entity) // make links and append them to tag link, _ := swid.NewLink("example.acme.roadrunner-hw-v1-0-0", *swid.NewRel("psa-rot-compound")) _ = tag.AddLink(*link) link, _ = swid.NewLink("example.acme.roadrunner-sw-bl-v1-0-0", *swid.NewRel(swid.RelComponent)) _ = tag.AddLink(*link) link, _ = swid.NewLink("example.acme.roadrunner-sw-prot-v1-0-0", *swid.NewRel(swid.RelComponent)) _ = tag.AddLink(*link) link, _ = swid.NewLink("example.acme.roadrunner-sw-arot-v1-0-0", *swid.NewRel(swid.RelComponent)) _ = tag.AddLink(*link) // encode tag to JSON data, _ := tag.ToJSON() fmt.Println(string(data)) // encode tag to XML data, _ = tag.ToXML() fmt.Println(string(data))
Output: {"tag-id":"example.acme.roadrunner-sw-v1-0-0","software-name":"Roadrunner software bundle","software-version":"1.0.0","entity":[{"entity-name":"ACME Ltd","reg-id":"acme.example","role":["tagCreator","softwareCreator","aggregator"]}],"link":[{"href":"example.acme.roadrunner-hw-v1-0-0","rel":"psa-rot-compound"},{"href":"example.acme.roadrunner-sw-bl-v1-0-0","rel":"component"},{"href":"example.acme.roadrunner-sw-prot-v1-0-0","rel":"component"},{"href":"example.acme.roadrunner-sw-arot-v1-0-0","rel":"component"}]} <AbbreviatedSwidTag xmlns="http://standards.iso.org/iso/19770/-2/2015/schema.xsd" tagId="example.acme.roadrunner-sw-v1-0-0" name="Roadrunner software bundle" version="1.0.0"><Entity name="ACME Ltd" regid="acme.example" role="tagCreator softwareCreator aggregator"></Entity><Link href="example.acme.roadrunner-hw-v1-0-0" rel="psa-rot-compound"></Link><Link href="example.acme.roadrunner-sw-bl-v1-0-0" rel="component"></Link><Link href="example.acme.roadrunner-sw-prot-v1-0-0" rel="component"></Link><Link href="example.acme.roadrunner-sw-arot-v1-0-0" rel="component"></Link></AbbreviatedSwidTag>
Example (List_of_cots_roundtrip) ¶
snobTa, _ := os.ReadFile("../cocli/data/cots/Snobbish Apparel_ta.ta") sharedTa, _ := os.ReadFile("../cocli/data/cots/shared_ta.ta") // cts1 egSnob := NewEnvironmentGroup() egSnob.SetAbbreviatedSwidTag(AbbreviatedSwidTag{}) egSnob.SwidTag.Entities = swid.Entities{} eSnob := swid.Entity{EntityName: "Snobbish Apparel, Inc."} _ = eSnob.SetRoles(swid.RoleSoftwareCreator) egSnob.SwidTag.Entities = append(egSnob.SwidTag.Entities, eSnob) cts1 := ConciseTaStore{} cts1.Keys = NewTasAndCas() cts1.Keys.AddTaCert(snobTa) cts1.Environments = *NewEnvironmentGroups() cts1.AddEnvironmentGroup(*egSnob) exclName := "Legal Lawyer" exclClaims1 := EatCWTClaim{SoftwareNameLabel: &exclName} cts1.AddExclClaims(exclClaims1) // cts2 egShared := NewEnvironmentGroup() egShared.Environment = &comid.Environment{} egShared.Environment.Class = comid.NewClassOID("1.2.3.4.5") cts2 := ConciseTaStore{} cts2.Keys = NewTasAndCas() cts2.Keys.AddTaCert(sharedTa) cts2.Environments = *NewEnvironmentGroups() cts2.AddEnvironmentGroup(*egShared) cts := NewConciseTaStores() cts.AddConciseTaStores(cts1) cts.AddConciseTaStores(cts2) ctsCBOR, _ := cts.ToCBOR() var roundtripCBOR ConciseTaStores _ = roundtripCBOR.FromCBOR(ctsCBOR) err := roundtripCBOR.Valid() if err != nil { fmt.Printf("CBOR roundtrip FAIL %s\n", err) } else { fmt.Printf("CBOR roundtrip OK\n") } ctsJSON, _ := cts.ToJSON() var roundtripJSON ConciseTaStores _ = roundtripJSON.FromJSON(ctsJSON) err = roundtripJSON.Valid() if err != nil { fmt.Printf("JSON roundtrip FAIL %s\n", err) } else { fmt.Printf("JSON roundtrip OK\n") }
Output: CBOR roundtrip OK JSON roundtrip OK
Index ¶
- Variables
- type AbbreviatedSwidTag
- func (t *AbbreviatedSwidTag) AddEntity(e swid.Entity) error
- func (t *AbbreviatedSwidTag) AddLink(l swid.Link) error
- func (t *AbbreviatedSwidTag) AddSoftwareMeta(m swid.SoftwareMeta) error
- func (t *AbbreviatedSwidTag) FromCBOR(data []byte) error
- func (t *AbbreviatedSwidTag) FromJSON(data []byte) error
- func (t *AbbreviatedSwidTag) FromXML(data []byte) error
- func (t AbbreviatedSwidTag) ToCBOR() ([]byte, error)
- func (t AbbreviatedSwidTag) ToJSON() ([]byte, error)
- func (t AbbreviatedSwidTag) ToXML() ([]byte, error)
- func (t AbbreviatedSwidTag) Valid() error
- type ConciseTaStore
- func (o *ConciseTaStore) AddEnvironmentGroup(eg EnvironmentGroup) *ConciseTaStore
- func (o *ConciseTaStore) AddExclClaims(exclclaim EatCWTClaim) *ConciseTaStore
- func (o *ConciseTaStore) AddPermClaims(permclaim EatCWTClaim) *ConciseTaStore
- func (o *ConciseTaStore) AddPurpose(purpose string) *ConciseTaStore
- func (o *ConciseTaStore) FromCBOR(data []byte) error
- func (o *ConciseTaStore) FromJSON(data []byte) error
- func (o *ConciseTaStore) SetKeys(keys TasAndCas) *ConciseTaStore
- func (o *ConciseTaStore) SetLanguage(language string) *ConciseTaStore
- func (o *ConciseTaStore) SetTagIdentity(tagID interface{}, tagIDVersion *uint) *ConciseTaStore
- func (o ConciseTaStore) ToCBOR() ([]byte, error)
- func (o ConciseTaStore) ToJSON() ([]byte, error)
- func (o ConciseTaStore) Valid() error
- type ConciseTaStores
- func (o *ConciseTaStores) AddConciseTaStores(cts ConciseTaStore) *ConciseTaStores
- func (o *ConciseTaStores) FromCBOR(data []byte) error
- func (o *ConciseTaStores) FromJSON(data []byte) error
- func (o ConciseTaStores) ToCBOR() ([]byte, error)
- func (o ConciseTaStores) ToJSON() ([]byte, error)
- func (o ConciseTaStores) Valid() error
- type EatCWTClaim
- type EatCWTClaims
- type EnvironmentGroup
- func (o *EnvironmentGroup) FromCBOR(data []byte) error
- func (o *EnvironmentGroup) FromJSON(data []byte) error
- func (o *EnvironmentGroup) SetAbbreviatedSwidTag(swidtag AbbreviatedSwidTag) *EnvironmentGroup
- func (o *EnvironmentGroup) SetEnvironment(environment comid.Environment) *EnvironmentGroup
- func (o *EnvironmentGroup) SetNamedTaStore(namedtastore string) *EnvironmentGroup
- func (o EnvironmentGroup) ToCBOR() ([]byte, error)
- func (o EnvironmentGroup) ToJSON() ([]byte, error)
- func (o EnvironmentGroup) Valid() error
- type EnvironmentGroups
- type HardwareVersionType
- type TaFormat
- type TasAndCas
- func (o *TasAndCas) AddCaCert(cert []byte) *TasAndCas
- func (o *TasAndCas) AddTaCert(cert []byte) *TasAndCas
- func (o *TasAndCas) FromCBOR(data []byte) error
- func (o *TasAndCas) FromJSON(data []byte) error
- func (o TasAndCas) ToCBOR() ([]byte, error)
- func (o TasAndCas) ToJSON() ([]byte, error)
- func (o TasAndCas) Valid() error
- type TrustAnchor
- func (o *TrustAnchor) FromCBOR(data []byte) error
- func (o *TrustAnchor) FromJSON(data []byte) error
- func (o *TrustAnchor) SetData(data []byte) *TrustAnchor
- func (o *TrustAnchor) SetFormat(format TaFormat) *TrustAnchor
- func (o TrustAnchor) ToCBOR() ([]byte, error)
- func (o TrustAnchor) ToJSON() ([]byte, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( ConciseTaStoreTemplateSingleOrg = `` /* 420-byte string literal not displayed */ ConciseTaStoreTemplateMultipleOrgs = `` /* 2829-byte string literal not displayed */ ConciseTaStoreTemplateEnvSWID = `` /* 967-byte string literal not displayed */ )
var (
CotsTag = []byte{0xd9, 0x01, 0xfb} // 507()
)
Functions ¶
This section is empty.
Types ¶
type AbbreviatedSwidTag ¶
type AbbreviatedSwidTag struct { XMLName xml.Name `cbor:"-" json:"-"` swid.CoSWIDExtension swid.GlobalAttributes // A 16 byte binary string or textual identifier uniquely referencing a // software component. The tag identifier MUST be globally unique. If // represented as a 16 byte binary string, the identifier MUST be a valid // universally unique identifier as defined by [RFC4122]. There are no // strict guidelines on how this identifier is structured, but examples // include a 16 byte GUID (e.g. class 4 UUID) [RFC4122], or a text string // appended to a DNS domain name to ensure uniqueness across organizations. TagID *swid.TagID `cbor:"0,keyasint,omitempty" json:"tag-id,omitempty" xml:"tagId,attr,omitempty"` // An integer value that indicate the specific release revision of the tag. // Typically, the initial value of this field is set to 0 and the value is // monotonically increased for subsequent tags produced for the same // software component release. This value allows a CoSWID tag producer to // correct an incorrect tag previously released without indicating a change // to the underlying software component the tag represents. For example, the // tag version could be changed to add new metadata, to correct a broken // link, to add a missing payload entry, etc. When producing a revised tag, // the new tag-version value MUST be greater than the old tag-version value. TagVersion int `cbor:"12,keyasint,omitempty" json:"tag-version,omitempty" xml:"tagVersion,attr,omitempty"` // A boolean value that indicates if the tag identifies and describes an // installable software component in its pre-installation state. Installable // software includes a installation package or installer for a software // component, a software update, or a patch. If the CoSWID tag represents // installable software, the corpus item MUST be set to "true". If not // provided, the default value MUST be considered "false" Corpus bool `cbor:"8,keyasint,omitempty" json:"corpus,omitempty" xml:"corpus,attr,omitempty"` // A boolean value that indicates if the tag identifies and describes an // installed patch that has made incremental changes to a software component // installed on an endpoint. Typically, an installed patch has made a set of // file modifications to pre-installed software and does not alter the // version number or the descriptive metadata of an installed software // component. If a CoSWID tag is for a patch, the patch item MUST be set to // "true". If not provided, the default value MUST be considered "false". // // Note: If the software component's version number is modified, then the // correct course of action would be to replace the previous primary tag for // the component with a new primary tag that reflected this new version. In // such a case, the new tag would have a patch item value of "false" or // would omit this item completely. Patch bool `cbor:"9,keyasint,omitempty" json:"patch,omitempty" xml:"patch,attr,omitempty"` // A boolean value that indicates if the tag is providing additional // information to be associated with another referenced SWID or CoSWID tag. // This allows tools and users to record their own metadata about a software // component without modifying SWID primary or patch tags created by a // software provider. If a CoSWID tag is a supplemental tag, the // supplemental item MUST be set to "true". If not provided, the default // value MUST be considered "false". Supplemental bool `cbor:"11,keyasint,omitempty" json:"supplemental,omitempty" xml:"supplemental,attr,omitempty"` // This textual item provides the software component's name. This name is // likely the same name that would appear in a package management tool. SoftwareName string `cbor:"1,keyasint,omitempty" json:"software-name,omitempty" xml:"name,attr,omitempty"` // A textual value representing the specific release or development version // of the software component. SoftwareVersion string `cbor:"13,keyasint,omitempty" json:"software-version,omitempty" xml:"version,attr,omitempty"` // An integer or textual value representing the versioning scheme used for // the software-version item. If an integer value is used it MUST be an // index value in the range -256 to 65535. Integer values in the range -256 // to -1 are reserved for testing and use in closed environments (see // section Section 5.2.2). Integer values in the range 0 to 65535 correspond // to registered entries in the IANA "SWID/CoSWID Version Scheme Value" // registry (see section Section 5.2.4. If a string value is used it MUST be // a private use name as defined in section Section 5.2.2. String values // based on a Version Scheme Name from the IANA "SWID/CoSWID Version Scheme // Value" registry MUST NOT be used, as these values are less concise than // their index value equivalent. VersionScheme *swid.VersionScheme `cbor:"14,keyasint,omitempty" json:"version-scheme,omitempty" xml:"versionScheme,attr,omitempty"` // This text value is a hint to the tag consumer to understand what target // platform this tag applies to. This item represents a query as defined by // the W3C Media Queries Recommendation (see // http://www.w3.org/TR/2012/REC-css3-mediaqueries-20120619) Media string `cbor:"10,keyasint,omitempty" json:"media,omitempty" xml:"media,attr,omitempty"` // An open-ended map of key/value data pairs. A number of predefined keys // can be used within this item providing for common usage and semantics // across the industry. Use of this map allows any additional attribute to // be included in the tag. It is expected that industry groups will use a // common set of attribute names to allow for interoperability within their // communities. SoftwareMetas *swid.SoftwareMetas `cbor:"5,keyasint,omitempty" json:"software-meta,omitempty" xml:"Meta,omitempty"` // Provides information about one or more organizations responsible for // producing the CoSWID tag, and producing or releasing the software // component referenced by this CoSWID tag. Entities swid.Entities `cbor:"2,keyasint" json:"entity" xml:"Entity"` // Provides a means to establish relationship arcs between the tag and // another items. A given link can be used to establish the relationship // between tags or to reference another resource that is related to the // CoSWID tag, e.g. vulnerability database association, ROLIE feed // [RFC8322], MUD resource [RFC8520], software download location, etc). This // is modeled after the HTML "link" element. Links *swid.Links `cbor:"4,keyasint,omitempty" json:"link,omitempty" xml:"Link,omitempty"` // This item represents a collection of software artifacts (described by // child items) that compose the target software. For example, these // artifacts could be the files included with an installer for a corpus tag // or installed on an endpoint when the software component is installed for // a primary or patch tag. The artifacts listed in a payload may be a // superset of the software artifacts that are actually installed. Based on // user selections at install time, an installation might not include every // artifact that could be created or executed on the endpoint when the // software component is installed or run. Payload *swid.Payload `cbor:"6,keyasint,omitempty" json:"payload,omitempty" xml:"Payload,omitempty"` // This item can be used to record the results of a software discovery // process used to identify untagged software on an endpoint or to represent // indicators for why software is believed to be installed on the endpoint. // In either case, a CoSWID tag can be created by the tool performing an // analysis of the software components installed on the endpoint. Evidence *swid.Evidence `cbor:"3,keyasint,omitempty" json:"evidence,omitempty" xml:"Evidence,omitempty"` }
This is copied from the SoftwareIdentity implementation in github.com/veraison/swid with most fields made optional here.
func NewTag ¶
func NewTag(tagID interface{}, softwareName, softwareVersion string) (*AbbreviatedSwidTag, error)
NewTag instantiates a new SWID tag with the supplied tag identifier and software name and version
func (*AbbreviatedSwidTag) AddEntity ¶
func (t *AbbreviatedSwidTag) AddEntity(e swid.Entity) error
AddEntity adds the supplied Entity to the receiver AbbreviatedSwidTag
func (*AbbreviatedSwidTag) AddLink ¶
func (t *AbbreviatedSwidTag) AddLink(l swid.Link) error
AddLink adds the supplied Link to the receiver AbbreviatedSwidTag
func (*AbbreviatedSwidTag) AddSoftwareMeta ¶
func (t *AbbreviatedSwidTag) AddSoftwareMeta(m swid.SoftwareMeta) error
AddSoftwareMeta adds the supplied SoftwareMeta to the receiver AbbreviatedSwidTag
func (*AbbreviatedSwidTag) FromCBOR ¶
func (t *AbbreviatedSwidTag) FromCBOR(data []byte) error
FromCBOR deserializes the supplied CBOR encoded CoSWID into the receiver AbbreviatedSwidTag
func (*AbbreviatedSwidTag) FromJSON ¶
func (t *AbbreviatedSwidTag) FromJSON(data []byte) error
FromJSON deserializes the supplied JSON encoded CoSWID into the receiver AbbreviatedSwidTag
func (*AbbreviatedSwidTag) FromXML ¶
func (t *AbbreviatedSwidTag) FromXML(data []byte) error
FromXML deserializes the supplied XML encoded CoSWID into the receiver AbbreviatedSwidTag
func (AbbreviatedSwidTag) ToCBOR ¶
func (t AbbreviatedSwidTag) ToCBOR() ([]byte, error)
ToCBOR serializes the receiver AbbreviatedSwidTag to CoSWID
func (AbbreviatedSwidTag) ToJSON ¶
func (t AbbreviatedSwidTag) ToJSON() ([]byte, error)
ToJSON serializes the receiver AbbreviatedSwidTag to CoSWID using the JSON formatter
func (AbbreviatedSwidTag) ToXML ¶
func (t AbbreviatedSwidTag) ToXML() ([]byte, error)
ToXML serializes the receiver AbbreviatedSwidTag to SWID
func (AbbreviatedSwidTag) Valid ¶
func (t AbbreviatedSwidTag) Valid() error
type ConciseTaStore ¶
type ConciseTaStore struct { Language *string `cbor:"0,keyasint,omitempty" json:"language,omitempty"` TagIdentity *comid.TagIdentity `cbor:"1,keyasint,omitempty" json:"tag-identity,omitempty"` Environments EnvironmentGroups `cbor:"2,keyasint" json:"environments"` Purposes []string `cbor:"3,keyasint,omitempty" json:"purposes,omitempty"` PermClaims EatCWTClaims `cbor:"4,keyasint,omitempty" json:"permclaims,omitempty"` ExclClaims EatCWTClaims `cbor:"5,keyasint,omitempty" json:"exclclaims,omitempty"` Keys *TasAndCas `cbor:"6,keyasint" json:"keys"` }
func NewConciseTaStore ¶
func NewConciseTaStore() *ConciseTaStore
func (*ConciseTaStore) AddEnvironmentGroup ¶
func (o *ConciseTaStore) AddEnvironmentGroup(eg EnvironmentGroup) *ConciseTaStore
func (*ConciseTaStore) AddExclClaims ¶
func (o *ConciseTaStore) AddExclClaims(exclclaim EatCWTClaim) *ConciseTaStore
func (*ConciseTaStore) AddPermClaims ¶
func (o *ConciseTaStore) AddPermClaims(permclaim EatCWTClaim) *ConciseTaStore
func (*ConciseTaStore) AddPurpose ¶
func (o *ConciseTaStore) AddPurpose(purpose string) *ConciseTaStore
func (*ConciseTaStore) FromCBOR ¶
func (o *ConciseTaStore) FromCBOR(data []byte) error
FromCBOR deserializes a CBOR-encoded CoTS into the target ConciseTaStore
func (*ConciseTaStore) FromJSON ¶
func (o *ConciseTaStore) FromJSON(data []byte) error
FromJSON deserializes a JSON-encoded CoTS into the target ConciseTaStore
func (*ConciseTaStore) SetKeys ¶
func (o *ConciseTaStore) SetKeys(keys TasAndCas) *ConciseTaStore
func (*ConciseTaStore) SetLanguage ¶
func (o *ConciseTaStore) SetLanguage(language string) *ConciseTaStore
func (*ConciseTaStore) SetTagIdentity ¶
func (o *ConciseTaStore) SetTagIdentity(tagID interface{}, tagIDVersion *uint) *ConciseTaStore
func (ConciseTaStore) ToCBOR ¶
func (o ConciseTaStore) ToCBOR() ([]byte, error)
ToCBOR serializes the target ConciseTaStore to CBOR
func (ConciseTaStore) ToJSON ¶
func (o ConciseTaStore) ToJSON() ([]byte, error)
FromJSON deserializes a JSON-encoded CoTS into the target ConsiseTaStore
func (ConciseTaStore) Valid ¶
func (o ConciseTaStore) Valid() error
Valid iterates over the range of individual entities to check for validity
type ConciseTaStores ¶
type ConciseTaStores []ConciseTaStore
func NewConciseTaStores ¶
func NewConciseTaStores() *ConciseTaStores
func (*ConciseTaStores) AddConciseTaStores ¶
func (o *ConciseTaStores) AddConciseTaStores(cts ConciseTaStore) *ConciseTaStores
func (*ConciseTaStores) FromCBOR ¶
func (o *ConciseTaStores) FromCBOR(data []byte) error
FromCBOR deserializes a CBOR-encoded CoTS into the target ConsiseTaStores
func (*ConciseTaStores) FromJSON ¶
func (o *ConciseTaStores) FromJSON(data []byte) error
FromJSON deserializes a JSON-encoded CoTS into the target ConsiseTaStores
func (ConciseTaStores) ToCBOR ¶
func (o ConciseTaStores) ToCBOR() ([]byte, error)
ToCBOR serializes the target ConciseTaStores to CBOR
func (ConciseTaStores) ToJSON ¶
func (o ConciseTaStores) ToJSON() ([]byte, error)
ToJSON serializes the target ConsiseTaStore to JSON
func (ConciseTaStores) Valid ¶
func (o ConciseTaStores) Valid() error
type EatCWTClaim ¶
type EatCWTClaim struct { Nonce *eat.Nonce `cbor:"10,keyasint,omitempty" json:"nonce,omitempty"` UEID *eat.UEID `cbor:"11,keyasint,omitempty" json:"ueid,omitempty"` Origination *eat.StringOrURI `cbor:"12,keyasint,omitempty" json:"origination,omitempty"` OemID *[]byte `cbor:"13,keyasint,omitempty" json:"oemid,omitempty"` SecurityLevel *eat.SecurityLevel `cbor:"14,keyasint,omitempty" json:"security-level,omitempty"` SecureBoot *bool `cbor:"15,keyasint,omitempty" json:"secure-boot,omitempty"` Debug *eat.Debug `cbor:"16,keyasint,omitempty" json:"debug-disable,omitempty"` Location *eat.Location `cbor:"17,keyasint,omitempty" json:"location,omitempty"` Profile *eat.Profile `cbor:"18,keyasint,omitempty" json:"eat-profile,omitempty"` Uptime *uint `cbor:"19,keyasint,omitempty" json:"uptime,omitempty"` Submods *eat.Submods `cbor:"20,keyasint,omitempty" json:"submods,omitempty"` eat.CWTClaims // Partial list of claims defined by draft-ietf-rats-eat-12 HardwareModelLabel *[]byte `cbor:"259,keyasint,omitempty" json:"hwmodel,omitempty"` HardwareVersionScheme *HardwareVersionType `cbor:"260,keyasint,omitempty" json:"hwvers,omitempty"` // numbers for the next two have not yet been assigned SoftwareNameLabel *string `cbor:"998,keyasint,omitempty" json:"swname,omitempty"` SoftwareVersionScheme *HardwareVersionType `cbor:"999,keyasint,omitempty" json:"swversion,omitempty"` }
func (*EatCWTClaim) FromCBOR ¶
func (o *EatCWTClaim) FromCBOR(data []byte) error
FromCBOR deserializes a CBOR-encoded data into the target EatCWTClaim
func (*EatCWTClaim) FromJSON ¶
func (o *EatCWTClaim) FromJSON(data []byte) error
FromJSON deserializes a JSON-encoded data into the target EatCWTClaim
func (EatCWTClaim) ToCBOR ¶
func (o EatCWTClaim) ToCBOR() ([]byte, error)
ToCBOR serializes the target EatCWTClaim to CBOR
func (EatCWTClaim) ToJSON ¶
func (o EatCWTClaim) ToJSON() ([]byte, error)
ToJSON serializes the target EatCWTClaim to JSON
type EatCWTClaims ¶
type EatCWTClaims []EatCWTClaim
func (*EatCWTClaims) FromCBOR ¶
func (o *EatCWTClaims) FromCBOR(data []byte) error
FromCBOR deserializes a CBOR-encoded data into the target EatCWTClaim
func (*EatCWTClaims) FromJSON ¶
func (o *EatCWTClaims) FromJSON(data []byte) error
FromJSON deserializes a JSON-encoded data into the target EatCWTClaim
func (EatCWTClaims) ToCBOR ¶
func (o EatCWTClaims) ToCBOR() ([]byte, error)
ToCBOR serializes the target EatCWTClsim to CBOR
func (EatCWTClaims) ToJSON ¶
func (o EatCWTClaims) ToJSON() ([]byte, error)
ToJSON serializes the target EatCWTClaim to JSON
func (EatCWTClaims) Valid ¶
func (o EatCWTClaims) Valid() error
type EnvironmentGroup ¶
type EnvironmentGroup struct { Environment *comid.Environment `cbor:"1,keyasint,omitempty" json:"environment,omitempty"` SwidTag *AbbreviatedSwidTag `cbor:"2,keyasint,omitempty" json:"swidtag,omitempty"` NamedTaStore *string `cbor:"3,keyasint,omitempty" json:"namedtastore,omitempty"` }
EnvironmentGroup is the top-level representation of the unsigned-corim-map with CBOR and JSON serialization.
func NewEnvironmentGroup ¶
func NewEnvironmentGroup() *EnvironmentGroup
NewEnvironmentGroup instantiates an empty EnvironmentGroup
func (*EnvironmentGroup) FromCBOR ¶
func (o *EnvironmentGroup) FromCBOR(data []byte) error
FromCBOR deserializes a CBOR-encoded data into the target EnvironmentGroup
func (*EnvironmentGroup) FromJSON ¶
func (o *EnvironmentGroup) FromJSON(data []byte) error
FromJSON deserializes a JSON-encoded data into the target EnvironmentGroup
func (*EnvironmentGroup) SetAbbreviatedSwidTag ¶
func (o *EnvironmentGroup) SetAbbreviatedSwidTag(swidtag AbbreviatedSwidTag) *EnvironmentGroup
func (*EnvironmentGroup) SetEnvironment ¶
func (o *EnvironmentGroup) SetEnvironment(environment comid.Environment) *EnvironmentGroup
func (*EnvironmentGroup) SetNamedTaStore ¶
func (o *EnvironmentGroup) SetNamedTaStore(namedtastore string) *EnvironmentGroup
func (EnvironmentGroup) ToCBOR ¶
func (o EnvironmentGroup) ToCBOR() ([]byte, error)
ToCBOR serializes the target EnvironmentGroup to CBOR
func (EnvironmentGroup) ToJSON ¶
func (o EnvironmentGroup) ToJSON() ([]byte, error)
ToJSON serializes the target EnvironmentGroup to JSON
func (EnvironmentGroup) Valid ¶
func (o EnvironmentGroup) Valid() error
Valid checks the validity of the target EnvironmentGroup
type EnvironmentGroups ¶
type EnvironmentGroups []EnvironmentGroup
func NewEnvironmentGroups ¶
func NewEnvironmentGroups() *EnvironmentGroups
func (*EnvironmentGroups) AddEnvironmentGroup ¶
func (o *EnvironmentGroups) AddEnvironmentGroup(e EnvironmentGroup) *EnvironmentGroups
func (*EnvironmentGroups) FromJSON ¶
func (o *EnvironmentGroups) FromJSON(data []byte) error
FromJSON deserializes a JSON-encoded data into the target EnvironmentGroup
func (EnvironmentGroups) ToJSON ¶
func (o EnvironmentGroups) ToJSON() ([]byte, error)
ToJSON serializes the target EnvironmentGroup to JSON
func (EnvironmentGroups) Valid ¶
func (o EnvironmentGroups) Valid() error
An empty list signifies all contexts SHOULD be considered as applicable
type HardwareVersionType ¶
type HardwareVersionType struct { Version string Scheme swid.VersionScheme }
type TasAndCas ¶
type TasAndCas struct { Tas []TrustAnchor `cbor:"0,keyasint" json:"tas"` Cas [][]byte `cbor:"1,keyasint,omitempty" json:"cas,omitempty"` }
func NewTasAndCas ¶
func NewTasAndCas() *TasAndCas
type TrustAnchor ¶
type TrustAnchor struct { Format TaFormat `json:"format"` Data []byte `json:"data"` // contains filtered or unexported fields }
func NewTrustAnchor ¶
func NewTrustAnchor() *TrustAnchor
func (*TrustAnchor) FromCBOR ¶
func (o *TrustAnchor) FromCBOR(data []byte) error
FromCBOR deserializes the supplied CBOR data into the target TrustAnchor
func (*TrustAnchor) FromJSON ¶
func (o *TrustAnchor) FromJSON(data []byte) error
FromJSON deserializes the supplied JSON data into the target TrustAnchor
func (*TrustAnchor) SetData ¶
func (o *TrustAnchor) SetData(data []byte) *TrustAnchor
func (*TrustAnchor) SetFormat ¶
func (o *TrustAnchor) SetFormat(format TaFormat) *TrustAnchor
func (TrustAnchor) ToCBOR ¶
func (o TrustAnchor) ToCBOR() ([]byte, error)
ToCBOR serializes the target TrustAnchor to CBOR
func (TrustAnchor) ToJSON ¶
func (o TrustAnchor) ToJSON() ([]byte, error)
ToJSON serializes the target TrustAnchor to JSON