diff --git a/src/CycloneDX.Spdx/Models/v2_3/ExternalRef.cs b/src/CycloneDX.Spdx/Models/v2_3/ExternalRef.cs
index a8cccf03..319044ad 100644
--- a/src/CycloneDX.Spdx/Models/v2_3/ExternalRef.cs
+++ b/src/CycloneDX.Spdx/Models/v2_3/ExternalRef.cs
@@ -29,8 +29,58 @@ public class ExternalRef
///
/// Category for the external reference
///
- [XmlElement("referenceCategory")]
+ [XmlIgnore]
public ExternalRefCategory ReferenceCategory { get; set; }
+
+ ///
+ /// Category for the external reference, adjusted to allow values with hyphens and underscores
+ ///
+ [XmlElement("referenceCategory")]
+ [JsonIgnore]
+ public string ReferenceCategoryAsString
+ {
+ get
+ {
+ string result;
+ switch (ReferenceCategory)
+ {
+ case ExternalRefCategory.PACKAGE_MANAGER:
+ result = "PACKAGE-MANAGER";
+ break;
+ case ExternalRefCategory.PERSISTENT_ID:
+ result = "PERSISTENT-ID";
+ break;
+ default:
+ result = ReferenceCategory.ToString();
+ break;
+ }
+ return result;
+ }
+
+
+ set
+ {
+ switch (value.ToUpperInvariant())
+ {
+ case "OTHER":
+ ReferenceCategory = ExternalRefCategory.OTHER;
+ break;
+ case "SECURITY":
+ ReferenceCategory = ExternalRefCategory.SECURITY;
+ break;
+ case "PACKAGE_MANAGER":
+ case "PACKAGE-MANAGER":
+ ReferenceCategory = ExternalRefCategory.PACKAGE_MANAGER;
+ break;
+ case "PERSISTENT_ID":
+ case "PERSISTENT-ID":
+ ReferenceCategory = ExternalRefCategory.PERSISTENT_ID;
+ break;
+ default:
+ throw new InvalidOperationException();
+ }
+ }
+ }
///
/// The unique string with no spaces necessary to access the package-specific information, metadata, or content within the target location. The format of the locator is subject to constraints defined by the <type>.
diff --git a/src/CycloneDX.Spdx/Models/v2_3/Package.cs b/src/CycloneDX.Spdx/Models/v2_3/Package.cs
index 33cd552f..bcf78dad 100644
--- a/src/CycloneDX.Spdx/Models/v2_3/Package.cs
+++ b/src/CycloneDX.Spdx/Models/v2_3/Package.cs
@@ -43,12 +43,17 @@ public class Package
[XmlElement("attributionTexts")]
public List AttributionTexts { get; set; }
- ///
+ private DateTime? _builtDate;
+ /// 0
/// Provides a place for recording the actual date the package was built.
///
[XmlElement("builtDate")]
[JsonConverter(typeof(UtcDateTimeConverter))]
- public DateTime? BuiltDate { get; set; }
+ public DateTime? BuiltDate
+ {
+ get => _builtDate;
+ set { _builtDate = Utils.UtcifyDateTime(value); }
+ }
///
/// The checksum property provides a mechanism that can be used to verify that the contents of a File or Package have not changed.
@@ -152,12 +157,17 @@ public class Package
[XmlElement("hasFiles")]
public List HasFiles { get; set; }
+ private DateTime? _releaseDate;
///
/// Provides a place for recording the date the package was released.
///
[XmlElement("releaseDate")]
[JsonConverter(typeof(UtcDateTimeConverter))]
- public DateTime? ReleaseDate { get; set; }
+ public DateTime? ReleaseDate
+ {
+ get => _releaseDate;
+ set { _releaseDate = Utils.UtcifyDateTime(value); }
+ }
///
/// Allows the producer(s) of the SPDX document to describe how the package was acquired and/or changed from the original source.
@@ -177,12 +187,17 @@ public class Package
[XmlElement("supplier")]
public string Supplier { get; set; }
- ///
+ private DateTime? _validUntilDate;
+ ///
/// Provides a place for recording the end of the support period for a package from the supplier.
///
[XmlElement("validUntilDate")]
[JsonConverter(typeof(UtcDateTimeConverter))]
- public DateTime? ValidUntilDate { get; set; }
+ public DateTime? ValidUntilDate
+ {
+ get => _validUntilDate;
+ set { _validUntilDate = Utils.UtcifyDateTime(value); }
+ }
///
/// Provides an indication of the version of the package that is described by this SpdxDocument.
diff --git a/src/CycloneDX.Spdx/Models/v2_3/UtcDateTimeConverter.cs b/src/CycloneDX.Spdx/Models/v2_3/UtcDateTimeConverter.cs
index ee9aa061..59e247d8 100644
--- a/src/CycloneDX.Spdx/Models/v2_3/UtcDateTimeConverter.cs
+++ b/src/CycloneDX.Spdx/Models/v2_3/UtcDateTimeConverter.cs
@@ -1,4 +1,5 @@
using System;
+using System.Globalization;
using System.Text.Json;
using System.Text.Json.Serialization;
@@ -8,13 +9,13 @@ public class UtcDateTimeConverter : JsonConverter
{
public override DateTime Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
- return DateTime.Parse(reader.GetString());
+ return DateTime.Parse(reader.GetString(), CultureInfo.InvariantCulture);
}
public override void Write(Utf8JsonWriter writer, DateTime value, JsonSerializerOptions options)
{
// Convert to UTC and format as "yyyy-MM-ddTHH:mm:ssZ"
- writer.WriteStringValue(value.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"));
+ writer.WriteStringValue(value.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture));
}
}
}
diff --git a/src/CycloneDX.Spdx/Schemas/spdx-2.3.schema.json b/src/CycloneDX.Spdx/Schemas/spdx-2.3.schema.json
index 5c6e3962..01b4bac3 100644
--- a/src/CycloneDX.Spdx/Schemas/spdx-2.3.schema.json
+++ b/src/CycloneDX.Spdx/Schemas/spdx-2.3.schema.json
@@ -322,7 +322,7 @@
"referenceCategory": {
"description": "Category for the external reference",
"type": "string",
- "enum": [ "OTHER", "PERSISTENT_ID", "SECURITY", "PACKAGE_MANAGER" ]
+ "enum": [ "OTHER", "PERSISTENT_ID", "SECURITY", "PACKAGE_MANAGER", "PACKAGE-MANAGER", "PERSISTENT-ID" ]
},
"referenceLocator": {
"description": "The unique string with no spaces necessary to access the package-specific information, metadata, or content within the target location. The format of the locator is subject to constraints defined by the .",
diff --git a/src/CycloneDX.Spdx/Serialization/Converters/HyphenToUnderscoreEnumConverter.cs b/src/CycloneDX.Spdx/Serialization/Converters/HyphenToUnderscoreEnumConverter.cs
new file mode 100644
index 00000000..4d0daf0f
--- /dev/null
+++ b/src/CycloneDX.Spdx/Serialization/Converters/HyphenToUnderscoreEnumConverter.cs
@@ -0,0 +1,62 @@
+// This file is part of CycloneDX Library for .NET
+//
+// Licensed under the Apache License, Version 2.0 (the “License”);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an “AS IS” BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// SPDX-License-Identifier: Apache-2.0
+// Copyright (c) OWASP Foundation. All Rights Reserved.
+
+using System;
+using System.Diagnostics.Contracts;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+
+namespace CycloneDX.Spdx.Serialization.Converters
+{
+
+ public class HyphenToUnderscoreEnumConverter : JsonConverter where T: struct
+ {
+ public override T Read(
+ ref Utf8JsonReader reader,
+ Type typeToConvert,
+ JsonSerializerOptions options)
+ {
+ if (reader.TokenType == JsonTokenType.Null
+ || reader.TokenType != JsonTokenType.String)
+ {
+ throw new JsonException();
+ }
+
+ var enumString = reader.GetString();
+
+ T enumValue;
+ var success = Enum.TryParse(enumString.Replace("-", "_"), ignoreCase: true, out enumValue);
+ if (success)
+ {
+ return enumValue;
+ }
+ else
+ {
+ throw new JsonException();
+ }
+ }
+
+ public override void Write(
+ Utf8JsonWriter writer,
+ T value,
+ JsonSerializerOptions options)
+ {
+ Contract.Requires(writer != null);
+ writer.WriteStringValue(value.ToString().Replace("_", "-"));
+ }
+ }
+}
diff --git a/src/CycloneDX.Spdx/Serialization/JsonSerializer.cs b/src/CycloneDX.Spdx/Serialization/JsonSerializer.cs
index 998e2788..290397c9 100644
--- a/src/CycloneDX.Spdx/Serialization/JsonSerializer.cs
+++ b/src/CycloneDX.Spdx/Serialization/JsonSerializer.cs
@@ -20,6 +20,8 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
+using CycloneDX.Spdx.Models.v2_3;
+using CycloneDX.Spdx.Serialization.Converters;
namespace CycloneDX.Spdx.Serialization
{
@@ -38,6 +40,7 @@ public static JsonSerializerOptions GetJsonSerializerOptions_v2_3()
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
};
+ options.Converters.Add(new HyphenToUnderscoreEnumConverter());
options.Converters.Add(new JsonStringEnumConverter());
return options;
}
diff --git a/src/CycloneDX.Spdx/Utils.cs b/src/CycloneDX.Spdx/Utils.cs
new file mode 100644
index 00000000..0f801a71
--- /dev/null
+++ b/src/CycloneDX.Spdx/Utils.cs
@@ -0,0 +1,44 @@
+// This file is part of CycloneDX Library for .NET
+//
+// Licensed under the Apache License, Version 2.0 (the “License”);
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an “AS IS” BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// SPDX-License-Identifier: Apache-2.0
+// Copyright (c) OWASP Foundation. All Rights Reserved.
+
+using System;
+
+namespace CycloneDX.Spdx
+{
+ static internal class Utils
+ {
+ internal static DateTime? UtcifyDateTime(DateTime? value)
+ {
+ if (value is null)
+ {
+ return null;
+ }
+ else if (value.Value.Kind == DateTimeKind.Unspecified)
+ {
+ return DateTime.SpecifyKind(value.Value, DateTimeKind.Utc);
+ }
+ else if (value.Value.Kind == DateTimeKind.Local)
+ {
+ return value.Value.ToUniversalTime();
+ }
+ else
+ {
+ return value;
+ }
+ }
+ }
+}
diff --git a/tests/CycloneDX.Spdx.Interop.Tests/__snapshots__/ConverterTests.FromSpdxToCDXToSpdxRoundTripTest_v2.2document.snap b/tests/CycloneDX.Spdx.Interop.Tests/__snapshots__/ConverterTests.FromSpdxToCDXToSpdxRoundTripTest_v2.2document.snap
index 56e946fe..dee4b8f8 100644
--- a/tests/CycloneDX.Spdx.Interop.Tests/__snapshots__/ConverterTests.FromSpdxToCDXToSpdxRoundTripTest_v2.2document.snap
+++ b/tests/CycloneDX.Spdx.Interop.Tests/__snapshots__/ConverterTests.FromSpdxToCDXToSpdxRoundTripTest_v2.2document.snap
@@ -141,7 +141,7 @@
"downloadLocation": "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
"externalRefs": [
{
- "referenceCategory": "PACKAGE_MANAGER",
+ "referenceCategory": "PACKAGE-MANAGER",
"referenceLocator": "pkg:maven/org.apache.jena/apache-jena@3.12.0",
"referenceType": "purl"
}
diff --git a/tests/CycloneDX.Spdx.Interop.Tests/__snapshots__/ConverterTests.FromSpdxToCDXToSpdxRoundTripTest_v2.3document.snap b/tests/CycloneDX.Spdx.Interop.Tests/__snapshots__/ConverterTests.FromSpdxToCDXToSpdxRoundTripTest_v2.3document.snap
index 3cf2ea77..90fe33b5 100644
--- a/tests/CycloneDX.Spdx.Interop.Tests/__snapshots__/ConverterTests.FromSpdxToCDXToSpdxRoundTripTest_v2.3document.snap
+++ b/tests/CycloneDX.Spdx.Interop.Tests/__snapshots__/ConverterTests.FromSpdxToCDXToSpdxRoundTripTest_v2.3document.snap
@@ -99,7 +99,7 @@
},
{
"comment": "This is the external ref for Acme",
- "referenceCategory": "PERSISTENT_ID",
+ "referenceCategory": "PERSISTENT-ID",
"referenceLocator": "acmecorp/acmenator/4.1.3-alpha",
"referenceType": "swh"
}
@@ -144,7 +144,7 @@
"downloadLocation": "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
"externalRefs": [
{
- "referenceCategory": "PACKAGE_MANAGER",
+ "referenceCategory": "PACKAGE-MANAGER",
"referenceLocator": "pkg:maven/org.apache.jena/apache-jena@3.12.0",
"referenceType": "purl"
}
diff --git a/tests/CycloneDX.Spdx.Tests/JsonSerializerTests.cs b/tests/CycloneDX.Spdx.Tests/JsonSerializerTests.cs
index 86ae6b5d..9f713135 100644
--- a/tests/CycloneDX.Spdx.Tests/JsonSerializerTests.cs
+++ b/tests/CycloneDX.Spdx.Tests/JsonSerializerTests.cs
@@ -29,6 +29,7 @@ public class JsonSerializerTests
{
[Theory]
[InlineData("document")]
+ [InlineData("document-with-hyphens-in-external-reference-category")]
public void JsonRoundTripTest(string baseFilename)
{
var resourceFilename = Path.Join("Resources", "v2.3", baseFilename + ".json");
@@ -42,6 +43,7 @@ public void JsonRoundTripTest(string baseFilename)
[Theory]
[InlineData("document")]
+ [InlineData("document-with-hyphens-in-external-reference-category")]
public async Task JsonAsyncRoundTripTest(string baseFilename)
{
var resourceFilename = Path.Join("Resources", "v2.3", baseFilename + ".json");
diff --git a/tests/CycloneDX.Spdx.Tests/JsonValidatorTests.cs b/tests/CycloneDX.Spdx.Tests/JsonValidatorTests.cs
index 1755111c..5db5fd95 100644
--- a/tests/CycloneDX.Spdx.Tests/JsonValidatorTests.cs
+++ b/tests/CycloneDX.Spdx.Tests/JsonValidatorTests.cs
@@ -28,11 +28,13 @@ namespace CycloneDX.Spdx.Tests
public class JsonValidatorTests
{
[Theory]
- [InlineData("v2.2")]
- [InlineData("v2.3")]
- public void ValidateJsonStringTest(string version)
+ [InlineData("v2.2", "document")]
+ [InlineData("v2.2", "document-with-hyphens-in-external-reference-category")]
+ [InlineData("v2.3", "document")]
+ [InlineData("v2.3", "document-with-hyphens-in-external-reference-category")]
+ public void ValidateJsonStringTest(string version, string baseFilename)
{
- var resourceFilename = Path.Join("Resources", version, "document" + ".json");
+ var resourceFilename = Path.Join("Resources", version, baseFilename + ".json");
var document = File.ReadAllText(resourceFilename);
var result = JsonValidator.Validate(document);
@@ -41,11 +43,13 @@ public void ValidateJsonStringTest(string version)
}
[Theory]
- [InlineData("v2.2")]
- [InlineData("v2.3")]
- public async Task ValidateJsonStreamTest(string version)
+ [InlineData("v2.2", "document")]
+ [InlineData("v2.2", "document-with-hyphens-in-external-reference-category")]
+ [InlineData("v2.3", "document")]
+ [InlineData("v2.3", "document-with-hyphens-in-external-reference-category")]
+ public async Task ValidateJsonStreamTest(string version, string baseFilename)
{
- var resourceFilename = Path.Join("Resources", version, "document" + ".json");
+ var resourceFilename = Path.Join("Resources", version, baseFilename + ".json");
using (var jsonStream = File.OpenRead(resourceFilename))
{
var validationResult = await JsonValidator.ValidateAsync(jsonStream).ConfigureAwait(false);
diff --git a/tests/CycloneDX.Spdx.Tests/Resources/v2.2/document-with-hyphens-in-external-reference-category.json b/tests/CycloneDX.Spdx.Tests/Resources/v2.2/document-with-hyphens-in-external-reference-category.json
new file mode 100644
index 00000000..4b859fe1
--- /dev/null
+++ b/tests/CycloneDX.Spdx.Tests/Resources/v2.2/document-with-hyphens-in-external-reference-category.json
@@ -0,0 +1,403 @@
+{
+ "SPDXID": "SPDXRef-DOCUMENT",
+ "spdxVersion": "SPDX-2.2",
+ "creationInfo": {
+ "comment": "This package has been shipped in source and binary form.\nThe binaries were created with gcc 4.5.1 and expect to link to\ncompatible system run time libraries.",
+ "created": "2010-01-29T18:30:22Z",
+ "creators": [
+ "Tool: LicenseFind-1.0",
+ "Organization: ExampleCodeInspect ()",
+ "Person: Jane Doe ()"
+ ],
+ "licenseListVersion": "3.9"
+ },
+ "name": "SPDX-Tools-v2.0",
+ "dataLicense": "CC0-1.0",
+ "comment": "This document was created using CycloneDX.Spdx 2.0 using licenses from the web site.",
+ "externalDocumentRefs": [
+ {
+ "externalDocumentId": "DocumentRef-spdx-tool-1.2",
+ "checksum": {
+ "algorithm": "SHA1",
+ "checksumValue": "d6a770ba38583ed4bb4525bd96e50461655d2759"
+ },
+ "spdxDocument": "http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301"
+ }
+ ],
+ "hasExtractedLicensingInfos": [
+ {
+ "licenseId": "LicenseRef-1",
+ "extractedText": "/*\n * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/"
+ },
+ {
+ "licenseId": "LicenseRef-2",
+ "extractedText": "This package includes the GRDDL parser developed by Hewlett Packard under the following license:\n� Copyright 2007 Hewlett-Packard Development Company, LP\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: \n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. \nThe name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. \nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ },
+ {
+ "licenseId": "LicenseRef-4",
+ "extractedText": "/*\n * (c) Copyright 2009 University of Bristol\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/"
+ },
+ {
+ "licenseId": "LicenseRef-Beerware-4.2",
+ "comment": "The beerware license has a couple of other standard variants.",
+ "extractedText": "\"THE BEER-WARE LICENSE\" (Revision 42):\nphk@FreeBSD.ORG wrote this file. As long as you retain this notice you\ncan do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp",
+ "name": "Beer-Ware License (Version 42)",
+ "seeAlsos": [
+ "http://people.freebsd.org/~phk/"
+ ]
+ },
+ {
+ "licenseId": "LicenseRef-3",
+ "comment": "This is tye CyperNeko License",
+ "extractedText": "The CyberNeko Software License, Version 1.0\n\n \n(C) Copyright 2002-2005, Andy Clark. All rights reserved.\n \nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer. \n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n3. The end-user documentation included with the redistribution,\n if any, must include the following acknowledgment: \n \"This product includes software developed by Andy Clark.\"\n Alternately, this acknowledgment may appear in the software itself,\n if and wherever such third-party acknowledgments normally appear.\n\n4. The names \"CyberNeko\" and \"NekoHTML\" must not be used to endorse\n or promote products derived from this software without prior \n written permission. For written permission, please contact \n andyc@cyberneko.net.\n\n5. Products derived from this software may not be called \"CyberNeko\",\n nor may \"CyberNeko\" appear in their name, without prior written\n permission of the author.\n\nTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, \nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE \nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+ "name": "CyberNeko License",
+ "seeAlsos": [
+ "http://people.apache.org/~andyc/neko/LICENSE",
+ "http://justasample.url.com"
+ ]
+ }
+ ],
+ "annotations": [
+ {
+ "annotationDate": "2010-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: Jane Doe ()",
+ "comment": "Document level annotation"
+ },
+ {
+ "annotationDate": "2010-02-10T00:00:00Z",
+ "annotationType": "REVIEW",
+ "annotator": "Person: Joe Reviewer",
+ "comment": "This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses"
+ },
+ {
+ "annotationDate": "2011-03-13T00:00:00Z",
+ "annotationType": "REVIEW",
+ "annotator": "Person: Suzanne Reviewer",
+ "comment": "Another example reviewer."
+ }
+ ],
+ "documentNamespace": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301",
+ "documentDescribes": [
+ "SPDXRef-File",
+ "SPDXRef-Package"
+ ],
+ "packages": [
+ {
+ "SPDXID": "SPDXRef-Package",
+ "annotations": [
+ {
+ "annotationDate": "2011-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: Package Commenter",
+ "comment": "Package level annotation"
+ }
+ ],
+ "attributionTexts": [
+ "The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually."
+ ],
+ "checksums": [
+ {
+ "algorithm": "MD5",
+ "checksumValue": "624c1abb3664f4b35547e7c73864ad24"
+ },
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "85ed0817af83a24ad8da68c2b5094de69833983c"
+ },
+ {
+ "algorithm": "SHA256",
+ "checksumValue": "11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd"
+ }
+ ],
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "description": "The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.",
+ "downloadLocation": "http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
+ "externalRefs": [
+ {
+ "referenceCategory": "SECURITY",
+ "referenceLocator": "cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*",
+ "referenceType": "cpe23Type"
+ },
+ {
+ "comment": "This is the external ref for Acme",
+ "referenceCategory": "OTHER",
+ "referenceLocator": "acmecorp/acmenator/4.1.3-alpha",
+ "referenceType": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge"
+ }
+ ],
+ "filesAnalyzed": true,
+ "hasFiles": [
+ "SPDXRef-CommonsLangSrc",
+ "SPDXRef-JenaLib",
+ "SPDXRef-DoapSource"
+ ],
+ "homepage": "http://ftp.gnu.org/gnu/glibc",
+ "licenseComments": "The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.",
+ "licenseConcluded": "(LGPL-2.0-only OR LicenseRef-3)",
+ "licenseDeclared": "(LGPL-2.0-only AND LicenseRef-3)",
+ "licenseInfoFromFiles": [
+ "GPL-2.0-only",
+ "LicenseRef-2",
+ "LicenseRef-1"
+ ],
+ "name": "glibc",
+ "originator": "Organization: ExampleCodeInspect (contact@example.com)",
+ "packageFileName": "glibc-2.11.1.tar.gz",
+ "packageVerificationCode": {
+ "packageVerificationCodeExcludedFiles": [
+ "./package.spdx"
+ ],
+ "packageVerificationCodeValue": "d6a770ba38583ed4bb4525bd96e50461655d2758"
+ },
+ "sourceInfo": "uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.",
+ "summary": "GNU C library.",
+ "supplier": "Person: Jane Doe (jane.doe@example.com)",
+ "versionInfo": "2.11.1"
+ },
+ {
+ "SPDXID": "SPDXRef-fromDoap-1",
+ "copyrightText": "NOASSERTION",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "homepage": "http://commons.apache.org/proper/commons-lang/",
+ "licenseConcluded": "NOASSERTION",
+ "licenseDeclared": "NOASSERTION",
+ "name": "Apache Commons Lang"
+ },
+ {
+ "SPDXID": "SPDXRef-fromDoap-0",
+ "copyrightText": "NOASSERTION",
+ "downloadLocation": "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceLocator": "pkg:maven/org.apache.jena/apache-jena@3.12.0",
+ "referenceType": "purl"
+ }
+ ],
+ "filesAnalyzed": false,
+ "homepage": "http://www.openjena.org/",
+ "licenseConcluded": "NOASSERTION",
+ "licenseDeclared": "NOASSERTION",
+ "name": "Jena",
+ "versionInfo": "3.12.0"
+ },
+ {
+ "SPDXID": "SPDXRef-Saxon",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "85ed0817af83a24ad8da68c2b5094de69833983c"
+ }
+ ],
+ "copyrightText": "Copyright Saxonica Ltd",
+ "description": "The Saxon package is a collection of tools for processing XML documents.",
+ "downloadLocation": "https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download",
+ "filesAnalyzed": false,
+ "homepage": "http://saxon.sourceforge.net/",
+ "licenseComments": "Other versions available for a commercial license",
+ "licenseConcluded": "MPL-1.0",
+ "licenseDeclared": "MPL-1.0",
+ "name": "Saxon",
+ "packageFileName": "saxonB-8.8.zip",
+ "versionInfo": "8.8"
+ }
+ ],
+ "files": [
+ {
+ "SPDXID": "SPDXRef-DoapSource",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
+ }
+ ],
+ "copyrightText": "Copyright 2010, 2011 Source Auditor Inc.",
+ "fileContributors": [
+ "Protecode Inc.",
+ "SPDX Technical Team Members",
+ "Open Logic Inc.",
+ "Source Auditor Inc.",
+ "Black Duck Software In.c"
+ ],
+ "fileName": "./src/org/spdx/parser/DOAPProject.java",
+ "fileTypes": [
+ "SOURCE"
+ ],
+ "licenseConcluded": "Apache-2.0",
+ "licenseInfoInFiles": [
+ "Apache-2.0"
+ ]
+ },
+ {
+ "SPDXID": "SPDXRef-CommonsLangSrc",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "c2b4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "This file is used by Jena",
+ "copyrightText": "Copyright 2001-2011 The Apache Software Foundation",
+ "fileContributors": [
+ "Apache Software Foundation"
+ ],
+ "fileName": "./lib-source/commons-lang3-3.1-sources.jar",
+ "fileTypes": [
+ "ARCHIVE"
+ ],
+ "licenseConcluded": "Apache-2.0",
+ "licenseInfoInFiles": [
+ "Apache-2.0"
+ ],
+ "noticeText": "Apache Commons Lang\nCopyright 2001-2011 The Apache Software Foundation\n\nThis product includes software developed by\nThe Apache Software Foundation (http://www.apache.org/).\n\nThis product includes software from the Spring Framework,\nunder the Apache License 2.0 (see: StringUtils.containsWhitespace())"
+ },
+ {
+ "SPDXID": "SPDXRef-JenaLib",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "3ab4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "This file belongs to Jena",
+ "copyrightText": "(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP",
+ "fileContributors": [
+ "Apache Software Foundation",
+ "Hewlett Packard Inc."
+ ],
+ "fileName": "./lib-source/jena-2.6.3-sources.jar",
+ "fileTypes": [
+ "ARCHIVE"
+ ],
+ "licenseComments": "This license is used by Jena",
+ "licenseConcluded": "LicenseRef-1",
+ "licenseInfoInFiles": [
+ "LicenseRef-1"
+ ]
+ },
+ {
+ "SPDXID": "SPDXRef-File",
+ "annotations": [
+ {
+ "annotationDate": "2011-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: File Commenter",
+ "comment": "File level annotation"
+ }
+ ],
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "d6a770ba38583ed4bb4525bd96e50461655d2758"
+ },
+ {
+ "algorithm": "MD5",
+ "checksumValue": "624c1abb3664f4b35547e7c73864ad24"
+ }
+ ],
+ "comment": "The concluded license was taken from the package level that the file was included in.\nThis information was found in the COPYING.txt file in the xyz directory.",
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "fileContributors": [
+ "The Regents of the University of California",
+ "Modified by Paul Mundt lethal@linux-sh.org",
+ "IBM Corporation"
+ ],
+ "fileName": "./package/foo.c",
+ "fileTypes": [
+ "SOURCE"
+ ],
+ "licenseComments": "The concluded license was taken from the package level that the file was included in.",
+ "licenseConcluded": "(LGPL-2.0-only OR LicenseRef-2)",
+ "licenseInfoInFiles": [
+ "GPL-2.0-only",
+ "LicenseRef-2"
+ ],
+ "noticeText": "Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the �Software�), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED �AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
+ }
+ ],
+ "snippets": [
+ {
+ "SPDXID": "SPDXRef-Snippet",
+ "comment": "This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.",
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "licenseComments": "The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.",
+ "licenseConcluded": "GPL-2.0-only",
+ "licenseInfoInSnippets": [
+ "GPL-2.0-only"
+ ],
+ "name": "from linux kernel",
+ "ranges": [
+ {
+ "endPointer": {
+ "offset": 420,
+ "reference": "SPDXRef-DoapSource"
+ },
+ "startPointer": {
+ "offset": 310,
+ "reference": "SPDXRef-DoapSource"
+ }
+ },
+ {
+ "endPointer": {
+ "lineNumber": 23,
+ "reference": "SPDXRef-DoapSource"
+ },
+ "startPointer": {
+ "lineNumber": 5,
+ "reference": "SPDXRef-DoapSource"
+ }
+ }
+ ],
+ "snippetFromFile": "SPDXRef-DoapSource"
+ }
+ ],
+ "relationships": [
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relatedSpdxElement": "SPDXRef-Package",
+ "relationshipType": "CONTAINS"
+ },
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relatedSpdxElement": "DocumentRef-spdx-tool-1.2:SPDXRef-ToolsElement",
+ "relationshipType": "COPY_OF"
+ },
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relatedSpdxElement": "SPDXRef-File",
+ "relationshipType": "DESCRIBES"
+ },
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relatedSpdxElement": "SPDXRef-Package",
+ "relationshipType": "DESCRIBES"
+ },
+ {
+ "spdxElementId": "SPDXRef-Package",
+ "relatedSpdxElement": "SPDXRef-JenaLib",
+ "relationshipType": "CONTAINS"
+ },
+ {
+ "spdxElementId": "SPDXRef-Package",
+ "relatedSpdxElement": "SPDXRef-Saxon",
+ "relationshipType": "DYNAMIC_LINK"
+ },
+ {
+ "spdxElementId": "SPDXRef-CommonsLangSrc",
+ "relatedSpdxElement": "NOASSERTION",
+ "relationshipType": "GENERATED_FROM"
+ },
+ {
+ "spdxElementId": "SPDXRef-JenaLib",
+ "relatedSpdxElement": "SPDXRef-Package",
+ "relationshipType": "CONTAINS"
+ },
+ {
+ "spdxElementId": "SPDXRef-File",
+ "relatedSpdxElement": "SPDXRef-fromDoap-0",
+ "relationshipType": "GENERATED_FROM"
+ }
+ ]
+}
diff --git a/tests/CycloneDX.Spdx.Tests/Resources/v2.2/document-with-hyphens-in-external-reference-category.xml b/tests/CycloneDX.Spdx.Tests/Resources/v2.2/document-with-hyphens-in-external-reference-category.xml
new file mode 100644
index 00000000..6bd4efd8
--- /dev/null
+++ b/tests/CycloneDX.Spdx.Tests/Resources/v2.2/document-with-hyphens-in-external-reference-category.xml
@@ -0,0 +1,457 @@
+
+
+ SPDXRef-DOCUMENT
+ SPDX-2.2
+
+
+ This package has been shipped in source and binary form.
+ The binaries were created with gcc 4.5.1 and expect to link to
+ compatible system run time libraries.
+
+ 2010-01-29T18:30:22Z
+ Tool: LicenseFind-1.0
+ Organization: ExampleCodeInspect ()
+ Person: Jane Doe ()
+ 3.9
+
+ SPDX-Tools-v2.0
+ CC0-1.0
+ This document was created using CycloneDX.Spdx 2.0 using licenses from the web site.
+
+ DocumentRef-spdx-tool-1.2
+
+ SHA1
+ d6a770ba38583ed4bb4525bd96e50461655d2759
+
+ http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301
+
+
+ LicenseRef-1
+
+ /*
+ * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+
+ LicenseRef-2
+
+ This package includes the GRDDL parser developed by Hewlett Packard under the following license:
+ � Copyright 2007 Hewlett-Packard Development Company, LP
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ LicenseRef-4
+
+ /*
+ * (c) Copyright 2009 University of Bristol
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+
+ LicenseRef-Beerware-4.2
+ The beerware license has a couple of other standard variants.
+
+ "THE BEER-WARE LICENSE" (Revision 42):
+ phk@FreeBSD.ORG wrote this file. As long as you retain this notice you
+ can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp
+
+ Beer-Ware License (Version 42)
+ http://people.freebsd.org/~phk/
+
+
+ LicenseRef-3
+ This is tye CyperNeko License
+
+ The CyberNeko Software License, Version 1.0
+
+
+ (C) Copyright 2002-2005, Andy Clark. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. The end-user documentation included with the redistribution,
+ if any, must include the following acknowledgment:
+ "This product includes software developed by Andy Clark."
+ Alternately, this acknowledgment may appear in the software itself,
+ if and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "CyberNeko" and "NekoHTML" must not be used to endorse
+ or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ andyc@cyberneko.net.
+
+ 5. Products derived from this software may not be called "CyberNeko",
+ nor may "CyberNeko" appear in their name, without prior written
+ permission of the author.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ CyberNeko License
+ http://people.apache.org/~andyc/neko/LICENSE
+ http://justasample.url.com
+
+
+ 2010-01-29T18:30:22Z
+ OTHER
+ Person: Jane Doe ()
+ Document level annotation
+
+
+ 2010-02-10T00:00:00Z
+ REVIEW
+ Person: Joe Reviewer
+ This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses
+
+
+ 2011-03-13T00:00:00Z
+ REVIEW
+ Person: Suzanne Reviewer
+ Another example reviewer.
+
+ http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301
+ SPDXRef-File
+ SPDXRef-File
+ SPDXRef-Package
+ SPDXRef-File
+ SPDXRef-Package
+ SPDXRef-File
+ SPDXRef-Package
+
+ SPDXRef-Package
+
+ 2011-01-29T18:30:22Z
+ OTHER
+ Person: Package Commenter
+ Package level annotation
+
+ The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually.
+
+ MD5
+ 624c1abb3664f4b35547e7c73864ad24
+
+
+ SHA1
+ 85ed0817af83a24ad8da68c2b5094de69833983c
+
+
+ SHA256
+ 11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd
+
+ Copyright 2008-2010 John Smith
+ The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.
+ http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz
+
+ SECURITY
+ cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*
+ cpe23Type
+
+
+ This is the external ref for Acme
+ OTHER
+ acmecorp/acmenator/4.1.3-alpha
+ http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge
+
+ true
+ SPDXRef-CommonsLangSrc
+ SPDXRef-CommonsLangSrc
+ SPDXRef-JenaLib
+ SPDXRef-CommonsLangSrc
+ SPDXRef-JenaLib
+ SPDXRef-DoapSource
+ SPDXRef-CommonsLangSrc
+ SPDXRef-JenaLib
+ SPDXRef-DoapSource
+ http://ftp.gnu.org/gnu/glibc
+ The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.
+ (LGPL-2.0-only OR LicenseRef-3)
+ (LGPL-2.0-only AND LicenseRef-3)
+ GPL-2.0-only
+ LicenseRef-2
+ LicenseRef-1
+ glibc
+ Organization: ExampleCodeInspect (contact@example.com)
+ glibc-2.11.1.tar.gz
+
+ ./package.spdx
+ d6a770ba38583ed4bb4525bd96e50461655d2758
+
+ uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.
+ GNU C library.
+ Person: Jane Doe (jane.doe@example.com)
+ 2.11.1
+
+
+ SPDXRef-fromDoap-1
+ NOASSERTION
+ NOASSERTION
+ false
+ http://commons.apache.org/proper/commons-lang/
+ NOASSERTION
+ NOASSERTION
+ Apache Commons Lang
+
+
+ SPDXRef-fromDoap-0
+ NOASSERTION
+ https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz
+
+ PACKAGE-MANAGER
+ pkg:maven/org.apache.jena/apache-jena@3.12.0
+ purl
+
+ false
+ http://www.openjena.org/
+ NOASSERTION
+ NOASSERTION
+ Jena
+ 3.12.0
+
+
+ SPDXRef-Saxon
+
+ SHA1
+ 85ed0817af83a24ad8da68c2b5094de69833983c
+
+ Copyright Saxonica Ltd
+ The Saxon package is a collection of tools for processing XML documents.
+ https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download
+ false
+ http://saxon.sourceforge.net/
+ Other versions available for a commercial license
+ MPL-1.0
+ MPL-1.0
+ Saxon
+ saxonB-8.8.zip
+ 8.8
+
+
+ SPDXRef-DoapSource
+
+ SHA1
+ 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
+
+ Copyright 2010, 2011 Source Auditor Inc.
+ Protecode Inc.
+ SPDX Technical Team Members
+ Open Logic Inc.
+ Source Auditor Inc.
+ Black Duck Software In.c
+ ./src/org/spdx/parser/DOAPProject.java
+ SOURCE
+ Apache-2.0
+ Apache-2.0
+
+
+ SPDXRef-CommonsLangSrc
+
+ SHA1
+ c2b4e1c67a2d28fced849ee1bb76e7391b93f125
+
+ This file is used by Jena
+ Copyright 2001-2011 The Apache Software Foundation
+ Apache Software Foundation
+ ./lib-source/commons-lang3-3.1-sources.jar
+ ARCHIVE
+ Apache-2.0
+ Apache-2.0
+
+ Apache Commons Lang
+ Copyright 2001-2011 The Apache Software Foundation
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ This product includes software from the Spring Framework,
+ under the Apache License 2.0 (see: StringUtils.containsWhitespace())
+
+
+
+ SPDXRef-JenaLib
+
+ SHA1
+ 3ab4e1c67a2d28fced849ee1bb76e7391b93f125
+
+ This file belongs to Jena
+ (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+ Apache Software Foundation
+ Hewlett Packard Inc.
+ ./lib-source/jena-2.6.3-sources.jar
+ ARCHIVE
+ This license is used by Jena
+ LicenseRef-1
+ LicenseRef-1
+
+
+ SPDXRef-File
+
+ 2011-01-29T18:30:22Z
+ OTHER
+ Person: File Commenter
+ File level annotation
+
+
+ SHA1
+ d6a770ba38583ed4bb4525bd96e50461655d2758
+
+
+ MD5
+ 624c1abb3664f4b35547e7c73864ad24
+
+
+ The concluded license was taken from the package level that the file was included in.
+ This information was found in the COPYING.txt file in the xyz directory.
+
+ Copyright 2008-2010 John Smith
+ The Regents of the University of California
+ Modified by Paul Mundt lethal@linux-sh.org
+ IBM Corporation
+ ./package/foo.c
+ SOURCE
+ The concluded license was taken from the package level that the file was included in.
+ (LGPL-2.0-only OR LicenseRef-2)
+ GPL-2.0-only
+ LicenseRef-2
+
+ Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the �Software�), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED �AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+ SPDXRef-Snippet
+ This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.
+ Copyright 2008-2010 John Smith
+ The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.
+ GPL-2.0-only
+ GPL-2.0-only
+ from linux kernel
+
+
+ 420
+ SPDXRef-DoapSource
+
+
+ 310
+ SPDXRef-DoapSource
+
+
+
+
+ 23
+ SPDXRef-DoapSource
+
+
+ 5
+ SPDXRef-DoapSource
+
+
+ SPDXRef-DoapSource
+
+
+ SPDXRef-DOCUMENT
+ SPDXRef-Package
+ CONTAINS
+
+
+ SPDXRef-DOCUMENT
+ DocumentRef-spdx-tool-1.2:SPDXRef-ToolsElement
+ COPY_OF
+
+
+ SPDXRef-Package
+ SPDXRef-Saxon
+ DYNAMIC_LINK
+
+
+ SPDXRef-CommonsLangSrc
+ NOASSERTION
+ GENERATED_FROM
+
+
+ SPDXRef-JenaLib
+ SPDXRef-Package
+ CONTAINS
+
+
+ SPDXRef-File
+ SPDXRef-fromDoap-0
+ GENERATED_FROM
+
+
diff --git a/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document-with-hyphens-in-external-reference-category.json b/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document-with-hyphens-in-external-reference-category.json
new file mode 100644
index 00000000..353eb74c
--- /dev/null
+++ b/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document-with-hyphens-in-external-reference-category.json
@@ -0,0 +1,353 @@
+{
+ "SPDXID": "SPDXRef-DOCUMENT",
+ "spdxVersion": "SPDX-2.3",
+ "creationInfo": {
+ "comment": "This package has been shipped in source and binary form.\nThe binaries were created with gcc 4.5.1 and expect to link to\ncompatible system run time libraries.",
+ "created": "2010-01-29T18:30:22Z",
+ "creators": [ "Tool: LicenseFind-1.0", "Organization: ExampleCodeInspect ()", "Person: Jane Doe ()" ],
+ "licenseListVersion": "3.17"
+ },
+ "name": "SPDX-Tools-v2.0",
+ "dataLicense": "CC0-1.0",
+ "comment": "This document was created using SPDX 2.0 using licenses from the web site.",
+ "externalDocumentRefs": [
+ {
+ "externalDocumentId": "DocumentRef-spdx-tool-1.2",
+ "checksum": {
+ "algorithm": "SHA1",
+ "checksumValue": "d6a770ba38583ed4bb4525bd96e50461655d2759"
+ },
+ "spdxDocument": "http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301"
+ }
+ ],
+ "hasExtractedLicensingInfos": [
+ {
+ "licenseId": "LicenseRef-1",
+ "extractedText": "/*\n * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/"
+ },
+ {
+ "licenseId": "LicenseRef-2",
+ "extractedText": "This package includes the GRDDL parser developed by Hewlett Packard under the following license:\n© Copyright 2007 Hewlett-Packard Development Company, LP\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: \n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. \nThe name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. \nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ },
+ {
+ "licenseId": "LicenseRef-4",
+ "extractedText": "/*\n * (c) Copyright 2009 University of Bristol\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/"
+ },
+ {
+ "licenseId": "LicenseRef-Beerware-4.2",
+ "comment": "The beerware license has a couple of other standard variants.",
+ "extractedText": "\"THE BEER-WARE LICENSE\" (Revision 42):\nphk@FreeBSD.ORG wrote this file. As long as you retain this notice you\ncan do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp",
+ "name": "Beer-Ware License (Version 42)",
+ "seeAlsos": [ "http://people.freebsd.org/~phk/" ]
+ },
+ {
+ "licenseId": "LicenseRef-3",
+ "comment": "This is tye CyperNeko License",
+ "extractedText": "The CyberNeko Software License, Version 1.0\n\n \n(C) Copyright 2002-2005, Andy Clark. All rights reserved.\n \nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer. \n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n3. The end-user documentation included with the redistribution,\n if any, must include the following acknowledgment: \n \"This product includes software developed by Andy Clark.\"\n Alternately, this acknowledgment may appear in the software itself,\n if and wherever such third-party acknowledgments normally appear.\n\n4. The names \"CyberNeko\" and \"NekoHTML\" must not be used to endorse\n or promote products derived from this software without prior \n written permission. For written permission, please contact \n andyc@cyberneko.net.\n\n5. Products derived from this software may not be called \"CyberNeko\",\n nor may \"CyberNeko\" appear in their name, without prior written\n permission of the author.\n\nTHIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, \nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE \nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+ "name": "CyberNeko License",
+ "seeAlsos": [ "http://people.apache.org/~andyc/neko/LICENSE", "http://justasample.url.com" ]
+ }
+ ],
+ "annotations": [
+ {
+ "annotationDate": "2010-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: Jane Doe ()",
+ "comment": "Document level annotation"
+ },
+ {
+ "annotationDate": "2010-02-10T00:00:00Z",
+ "annotationType": "REVIEW",
+ "annotator": "Person: Joe Reviewer",
+ "comment": "This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses"
+ },
+ {
+ "annotationDate": "2011-03-13T00:00:00Z",
+ "annotationType": "REVIEW",
+ "annotator": "Person: Suzanne Reviewer",
+ "comment": "Another example reviewer."
+ }
+ ],
+ "documentDescribes": [ "SPDXRef-File", "SPDXRef-Package" ],
+ "documentNamespace": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301",
+ "packages": [
+ {
+ "SPDXID": "SPDXRef-Package",
+ "annotations": [
+ {
+ "annotationDate": "2011-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: Package Commenter",
+ "comment": "Package level annotation"
+ }
+ ],
+ "attributionTexts": [ "The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually." ],
+ "builtDate": "2011-01-29T18:30:22Z",
+ "checksums": [
+ {
+ "algorithm": "MD5",
+ "checksumValue": "624c1abb3664f4b35547e7c73864ad24"
+ },
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "85ed0817af83a24ad8da68c2b5094de69833983c"
+ },
+ {
+ "algorithm": "SHA256",
+ "checksumValue": "11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd"
+ },
+ {
+ "algorithm": "BLAKE2b_384",
+ "checksumValue": "aaabd89c926ab525c242e6621f2f5fa73aa4afe3d9e24aed727faaadd6af38b620bdb623dd2b4788b1c8086984af8706"
+ }
+ ],
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "description": "The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.",
+ "downloadLocation": "http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
+ "externalRefs": [
+ {
+ "referenceCategory": "SECURITY",
+ "referenceLocator": "cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*",
+ "referenceType": "cpe23Type"
+ },
+ {
+ "comment": "This is the external ref for Acme",
+ "referenceCategory": "PERSISTENT-ID",
+ "referenceLocator": "acmecorp/acmenator/4.1.3-alpha",
+ "referenceType": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge"
+ }
+ ],
+ "filesAnalyzed": true,
+ "homepage": "http://ftp.gnu.org/gnu/glibc",
+ "licenseComments": "The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.",
+ "licenseConcluded": "(LGPL-2.0-only OR LicenseRef-3)",
+ "licenseDeclared": "(LGPL-2.0-only AND LicenseRef-3)",
+ "licenseInfoFromFiles": [ "GPL-2.0-only", "LicenseRef-2", "LicenseRef-1" ],
+ "name": "glibc",
+ "originator": "Organization: ExampleCodeInspect (contact@example.com)",
+ "packageFileName": "glibc-2.11.1.tar.gz",
+ "packageVerificationCode": {
+ "packageVerificationCodeExcludedFiles": [ "./package.spdx" ],
+ "packageVerificationCodeValue": "d6a770ba38583ed4bb4525bd96e50461655d2758"
+ },
+ "primaryPackagePurpose": "SOURCE",
+ "hasFiles": [ "SPDXRef-Specification", "SPDXRef-Specification", "SPDXRef-CommonsLangSrc", "SPDXRef-Specification", "SPDXRef-CommonsLangSrc", "SPDXRef-JenaLib", "SPDXRef-Specification", "SPDXRef-CommonsLangSrc", "SPDXRef-JenaLib", "SPDXRef-DoapSource", "SPDXRef-Specification", "SPDXRef-CommonsLangSrc", "SPDXRef-JenaLib", "SPDXRef-DoapSource" ],
+ "releaseDate": "2012-01-29T18:30:22Z",
+ "sourceInfo": "uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.",
+ "summary": "GNU C library.",
+ "supplier": "Person: Jane Doe (jane.doe@example.com)",
+ "validUntilDate": "2014-01-29T18:30:22Z",
+ "versionInfo": "2.11.1"
+ },
+ {
+ "SPDXID": "SPDXRef-fromDoap-1",
+ "copyrightText": "NOASSERTION",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "homepage": "http://commons.apache.org/proper/commons-lang/",
+ "licenseConcluded": "NOASSERTION",
+ "licenseDeclared": "NOASSERTION",
+ "name": "Apache Commons Lang"
+ },
+ {
+ "SPDXID": "SPDXRef-fromDoap-0",
+ "downloadLocation": "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceLocator": "pkg:maven/org.apache.jena/apache-jena@3.12.0",
+ "referenceType": "purl"
+ }
+ ],
+ "filesAnalyzed": false,
+ "homepage": "http://www.openjena.org/",
+ "name": "Jena",
+ "primaryPackagePurpose": "APPLICATION",
+ "versionInfo": "3.12.0"
+ },
+ {
+ "SPDXID": "SPDXRef-Saxon",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "85ed0817af83a24ad8da68c2b5094de69833983c"
+ }
+ ],
+ "copyrightText": "Copyright Saxonica Ltd",
+ "description": "The Saxon package is a collection of tools for processing XML documents.",
+ "downloadLocation": "https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download",
+ "filesAnalyzed": false,
+ "homepage": "http://saxon.sourceforge.net/",
+ "licenseComments": "Other versions available for a commercial license",
+ "licenseConcluded": "MPL-1.0",
+ "licenseDeclared": "MPL-1.0",
+ "name": "Saxon",
+ "packageFileName": "saxonB-8.8.zip",
+ "versionInfo": "8.8"
+ }
+ ],
+ "files": [
+ {
+ "SPDXID": "SPDXRef-DoapSource",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
+ }
+ ],
+ "copyrightText": "Copyright 2010, 2011 Source Auditor Inc.",
+ "fileContributors": [ "Protecode Inc.", "SPDX Technical Team Members", "Open Logic Inc.", "Source Auditor Inc.", "Black Duck Software In.c" ],
+ "fileName": "./src/org/spdx/parser/DOAPProject.java",
+ "fileTypes": [ "SOURCE" ],
+ "licenseConcluded": "Apache-2.0",
+ "licenseInfoInFiles": [ "Apache-2.0" ]
+ },
+ {
+ "SPDXID": "SPDXRef-CommonsLangSrc",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "c2b4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "This file is used by Jena",
+ "copyrightText": "Copyright 2001-2011 The Apache Software Foundation",
+ "fileContributors": [ "Apache Software Foundation" ],
+ "fileName": "./lib-source/commons-lang3-3.1-sources.jar",
+ "fileTypes": [ "ARCHIVE" ],
+ "licenseConcluded": "Apache-2.0",
+ "licenseInfoInFiles": [ "Apache-2.0" ],
+ "noticeText": "Apache Commons Lang\nCopyright 2001-2011 The Apache Software Foundation\n\nThis product includes software developed by\nThe Apache Software Foundation (http://www.apache.org/).\n\nThis product includes software from the Spring Framework,\nunder the Apache License 2.0 (see: StringUtils.containsWhitespace())"
+ },
+ {
+ "SPDXID": "SPDXRef-JenaLib",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "3ab4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "This file belongs to Jena",
+ "copyrightText": "(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP",
+ "fileContributors": [ "Apache Software Foundation", "Hewlett Packard Inc." ],
+ "fileName": "./lib-source/jena-2.6.3-sources.jar",
+ "fileTypes": [ "ARCHIVE" ],
+ "licenseComments": "This license is used by Jena",
+ "licenseConcluded": "LicenseRef-1",
+ "licenseInfoInFiles": [ "LicenseRef-1" ]
+ },
+ {
+ "SPDXID": "SPDXRef-Specification",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "fff4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "Specification Documentation",
+ "fileName": "./docs/myspec.pdf",
+ "fileTypes": [ "DOCUMENTATION" ]
+ },
+ {
+ "SPDXID": "SPDXRef-File",
+ "annotations": [
+ {
+ "annotationDate": "2011-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: File Commenter",
+ "comment": "File level annotation"
+ }
+ ],
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "d6a770ba38583ed4bb4525bd96e50461655d2758"
+ },
+ {
+ "algorithm": "MD5",
+ "checksumValue": "624c1abb3664f4b35547e7c73864ad24"
+ }
+ ],
+ "comment": "The concluded license was taken from the package level that the file was included in.\nThis information was found in the COPYING.txt file in the xyz directory.",
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "fileContributors": [ "The Regents of the University of California", "Modified by Paul Mundt lethal@linux-sh.org", "IBM Corporation" ],
+ "fileName": "./package/foo.c",
+ "fileTypes": [ "SOURCE" ],
+ "licenseComments": "The concluded license was taken from the package level that the file was included in.",
+ "licenseConcluded": "(LGPL-2.0-only OR LicenseRef-2)",
+ "licenseInfoInFiles": [ "GPL-2.0-only", "LicenseRef-2" ],
+ "noticeText": "Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
+ }
+ ],
+ "snippets": [
+ {
+ "SPDXID": "SPDXRef-Snippet",
+ "comment": "This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.",
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "licenseComments": "The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.",
+ "licenseConcluded": "GPL-2.0-only",
+ "licenseInfoInSnippets": [ "GPL-2.0-only" ],
+ "name": "from linux kernel",
+ "ranges": [
+ {
+ "endPointer": {
+ "offset": 420,
+ "reference": "SPDXRef-DoapSource"
+ },
+ "startPointer": {
+ "offset": 310,
+ "reference": "SPDXRef-DoapSource"
+ }
+ },
+ {
+ "endPointer": {
+ "lineNumber": 23,
+ "reference": "SPDXRef-DoapSource"
+ },
+ "startPointer": {
+ "lineNumber": 5,
+ "reference": "SPDXRef-DoapSource"
+ }
+ }
+ ],
+ "snippetFromFile": "SPDXRef-DoapSource"
+ }
+ ],
+ "relationships": [
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relationshipType": "CONTAINS",
+ "relatedSpdxElement": "SPDXRef-Package"
+ },
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relationshipType": "COPY_OF",
+ "relatedSpdxElement": "DocumentRef-spdx-tool-1.2:SPDXRef-ToolsElement"
+ },
+ {
+ "spdxElementId": "SPDXRef-Package",
+ "relationshipType": "DYNAMIC_LINK",
+ "relatedSpdxElement": "SPDXRef-Saxon"
+ },
+ {
+ "spdxElementId": "SPDXRef-CommonsLangSrc",
+ "relationshipType": "GENERATED_FROM",
+ "relatedSpdxElement": "NOASSERTION"
+ },
+ {
+ "spdxElementId": "SPDXRef-JenaLib",
+ "relationshipType": "CONTAINS",
+ "relatedSpdxElement": "SPDXRef-Package"
+ },
+ {
+ "spdxElementId": "SPDXRef-Specification",
+ "relationshipType": "SPECIFICATION_FOR",
+ "relatedSpdxElement": "SPDXRef-fromDoap-0"
+ },
+ {
+ "spdxElementId": "SPDXRef-File",
+ "relationshipType": "GENERATED_FROM",
+ "relatedSpdxElement": "SPDXRef-fromDoap-0"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document-with-hyphens-in-external-reference-category.xml b/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document-with-hyphens-in-external-reference-category.xml
new file mode 100644
index 00000000..05d1aadd
--- /dev/null
+++ b/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document-with-hyphens-in-external-reference-category.xml
@@ -0,0 +1,477 @@
+
+
+ SPDXRef-DOCUMENT
+ SPDX-2.3
+
+
+ This package has been shipped in source and binary form.
+ The binaries were created with gcc 4.5.1 and expect to link to
+ compatible system run time libraries.
+
+ 2010-01-29T18:30:22Z
+ Tool: LicenseFind-1.0
+ Organization: ExampleCodeInspect ()
+ Person: Jane Doe ()
+ 3.17
+
+ SPDX-Tools-v2.0
+ CC0-1.0
+ This document was created using SPDX 2.0 using licenses from the web site.
+
+ DocumentRef-spdx-tool-1.2
+
+ SHA1
+ d6a770ba38583ed4bb4525bd96e50461655d2759
+
+ http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301
+
+
+ LicenseRef-1
+
+ /*
+ * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+
+ LicenseRef-2
+
+ This package includes the GRDDL parser developed by Hewlett Packard under the following license:
+ © Copyright 2007 Hewlett-Packard Development Company, LP
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ LicenseRef-4
+
+ /*
+ * (c) Copyright 2009 University of Bristol
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+
+ LicenseRef-Beerware-4.2
+ The beerware license has a couple of other standard variants.
+
+ "THE BEER-WARE LICENSE" (Revision 42):
+ phk@FreeBSD.ORG wrote this file. As long as you retain this notice you
+ can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp
+
+ Beer-Ware License (Version 42)
+ http://people.freebsd.org/~phk/
+
+
+ LicenseRef-3
+ This is tye CyperNeko License
+
+ The CyberNeko Software License, Version 1.0
+
+
+ (C) Copyright 2002-2005, Andy Clark. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. The end-user documentation included with the redistribution,
+ if any, must include the following acknowledgment:
+ "This product includes software developed by Andy Clark."
+ Alternately, this acknowledgment may appear in the software itself,
+ if and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "CyberNeko" and "NekoHTML" must not be used to endorse
+ or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ andyc@cyberneko.net.
+
+ 5. Products derived from this software may not be called "CyberNeko",
+ nor may "CyberNeko" appear in their name, without prior written
+ permission of the author.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ CyberNeko License
+ http://people.apache.org/~andyc/neko/LICENSE
+ http://justasample.url.com
+
+
+ 2010-01-29T18:30:22Z
+ OTHER
+ Person: Jane Doe ()
+ Document level annotation
+
+
+ 2010-02-10T00:00:00Z
+ REVIEW
+ Person: Joe Reviewer
+ This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses
+
+
+ 2011-03-13T00:00:00Z
+ REVIEW
+ Person: Suzanne Reviewer
+ Another example reviewer.
+
+ SPDXRef-File
+ SPDXRef-Package
+ http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301
+
+ SPDXRef-Package
+
+ 2011-01-29T18:30:22Z
+ OTHER
+ Person: Package Commenter
+ Package level annotation
+
+ The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually.
+ 2011-01-29T18:30:22Z
+
+ MD5
+ 624c1abb3664f4b35547e7c73864ad24
+
+
+ SHA1
+ 85ed0817af83a24ad8da68c2b5094de69833983c
+
+
+ SHA256
+ 11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd
+
+
+ BLAKE2b-384
+ aaabd89c926ab525c242e6621f2f5fa73aa4afe3d9e24aed727faaadd6af38b620bdb623dd2b4788b1c8086984af8706
+
+ Copyright 2008-2010 John Smith
+ The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.
+ http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz
+
+ SECURITY
+ cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*
+ cpe23Type
+
+
+ This is the external ref for Acme
+ PERSISTENT-ID
+ acmecorp/acmenator/4.1.3-alpha
+ http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge
+
+ true
+ http://ftp.gnu.org/gnu/glibc
+ The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.
+ (LGPL-2.0-only OR LicenseRef-3)
+ (LGPL-2.0-only AND LicenseRef-3)
+ GPL-2.0-only
+ LicenseRef-2
+ LicenseRef-1
+ glibc
+ Organization: ExampleCodeInspect (contact@example.com)
+ glibc-2.11.1.tar.gz
+
+ ./package.spdx
+ d6a770ba38583ed4bb4525bd96e50461655d2758
+
+ SOURCE
+ SPDXRef-Specification
+ SPDXRef-Specification
+ SPDXRef-CommonsLangSrc
+ SPDXRef-Specification
+ SPDXRef-CommonsLangSrc
+ SPDXRef-JenaLib
+ SPDXRef-Specification
+ SPDXRef-CommonsLangSrc
+ SPDXRef-JenaLib
+ SPDXRef-DoapSource
+ SPDXRef-Specification
+ SPDXRef-CommonsLangSrc
+ SPDXRef-JenaLib
+ SPDXRef-DoapSource
+ 2012-01-29T18:30:22Z
+ uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.
+ GNU C library.
+ Person: Jane Doe (jane.doe@example.com)
+ 2014-01-29T18:30:22Z
+ 2.11.1
+
+
+ SPDXRef-fromDoap-1
+ NOASSERTION
+ NOASSERTION
+ false
+ http://commons.apache.org/proper/commons-lang/
+ NOASSERTION
+ NOASSERTION
+ Apache Commons Lang
+
+
+ SPDXRef-fromDoap-0
+ https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz
+
+ PACKAGE-MANAGER
+ pkg:maven/org.apache.jena/apache-jena@3.12.0
+ purl
+
+ false
+ http://www.openjena.org/
+ Jena
+ 3.12.0
+
+
+ SPDXRef-Saxon
+
+ SHA1
+ 85ed0817af83a24ad8da68c2b5094de69833983c
+
+ Copyright Saxonica Ltd
+ The Saxon package is a collection of tools for processing XML documents.
+ https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download
+ false
+ http://saxon.sourceforge.net/
+ Other versions available for a commercial license
+ MPL-1.0
+ MPL-1.0
+ Saxon
+ saxonB-8.8.zip
+ 8.8
+
+
+ SPDXRef-DoapSource
+
+ SHA1
+ 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
+
+ Copyright 2010, 2011 Source Auditor Inc.
+ Protecode Inc.
+ SPDX Technical Team Members
+ Open Logic Inc.
+ Source Auditor Inc.
+ Black Duck Software In.c
+ ./src/org/spdx/parser/DOAPProject.java
+ SOURCE
+ Apache-2.0
+ Apache-2.0
+
+
+ SPDXRef-CommonsLangSrc
+
+ SHA1
+ c2b4e1c67a2d28fced849ee1bb76e7391b93f125
+
+ This file is used by Jena
+ Copyright 2001-2011 The Apache Software Foundation
+ Apache Software Foundation
+ ./lib-source/commons-lang3-3.1-sources.jar
+ ARCHIVE
+ Apache-2.0
+ Apache-2.0
+
+ Apache Commons Lang
+ Copyright 2001-2011 The Apache Software Foundation
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ This product includes software from the Spring Framework,
+ under the Apache License 2.0 (see: StringUtils.containsWhitespace())
+
+
+
+ SPDXRef-JenaLib
+
+ SHA1
+ 3ab4e1c67a2d28fced849ee1bb76e7391b93f125
+
+ This file belongs to Jena
+ (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+ Apache Software Foundation
+ Hewlett Packard Inc.
+ ./lib-source/jena-2.6.3-sources.jar
+ ARCHIVE
+ This license is used by Jena
+ LicenseRef-1
+ LicenseRef-1
+
+
+ SPDXRef-Specification
+
+ SHA1
+ fff4e1c67a2d28fced849ee1bb76e7391b93f125
+
+ Specification Documentation
+ ./docs/myspec.pdf
+ DOCUMENTATION
+
+
+ SPDXRef-File
+
+ 2011-01-29T18:30:22Z
+ OTHER
+ Person: File Commenter
+ File level annotation
+
+
+ SHA1
+ d6a770ba38583ed4bb4525bd96e50461655d2758
+
+
+ MD5
+ 624c1abb3664f4b35547e7c73864ad24
+
+
+ The concluded license was taken from the package level that the file was included in.
+ This information was found in the COPYING.txt file in the xyz directory.
+
+ Copyright 2008-2010 John Smith
+ The Regents of the University of California
+ Modified by Paul Mundt lethal@linux-sh.org
+ IBM Corporation
+ ./package/foo.c
+ SOURCE
+ The concluded license was taken from the package level that the file was included in.
+ (LGPL-2.0-only OR LicenseRef-2)
+ GPL-2.0-only
+ LicenseRef-2
+
+ Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+ SPDXRef-Snippet
+ This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.
+ Copyright 2008-2010 John Smith
+ The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.
+ GPL-2.0-only
+ GPL-2.0-only
+ from linux kernel
+
+
+ 420
+ SPDXRef-DoapSource
+
+
+ 310
+ SPDXRef-DoapSource
+
+
+
+
+ 23
+ SPDXRef-DoapSource
+
+
+ 5
+ SPDXRef-DoapSource
+
+
+ SPDXRef-DoapSource
+
+
+ SPDXRef-DOCUMENT
+ CONTAINS
+ SPDXRef-Package
+
+
+ SPDXRef-DOCUMENT
+ COPY_OF
+ DocumentRef-spdx-tool-1.2:SPDXRef-ToolsElement
+
+
+ SPDXRef-Package
+ DYNAMIC_LINK
+ SPDXRef-Saxon
+
+
+ SPDXRef-CommonsLangSrc
+ GENERATED_FROM
+ NOASSERTION
+
+
+ SPDXRef-JenaLib
+ CONTAINS
+ SPDXRef-Package
+
+
+ SPDXRef-Specification
+ SPECIFICATION_FOR
+ SPDXRef-fromDoap-0
+
+
+ SPDXRef-File
+ GENERATED_FROM
+ SPDXRef-fromDoap-0
+
+
diff --git a/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document.xml b/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document.xml
index 05d1aadd..935f9817 100644
--- a/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document.xml
+++ b/tests/CycloneDX.Spdx.Tests/Resources/v2.3/document.xml
@@ -221,7 +221,7 @@
This is the external ref for Acme
- PERSISTENT-ID
+ PERSISTENT_ID
acmecorp/acmenator/4.1.3-alpha
http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge
diff --git a/tests/CycloneDX.Spdx.Tests/XmlSerializerTests.cs b/tests/CycloneDX.Spdx.Tests/XmlSerializerTests.cs
index 6f936b9b..267a7a94 100644
--- a/tests/CycloneDX.Spdx.Tests/XmlSerializerTests.cs
+++ b/tests/CycloneDX.Spdx.Tests/XmlSerializerTests.cs
@@ -29,6 +29,7 @@ public class XmlSerializerTests
{
[Theory]
[InlineData("document")]
+ [InlineData("document-with-hyphens-in-external-reference-category")]
public void XmlRoundTripTest(string baseFilename)
{
var resourceFilename = Path.Join("Resources", "v2.3", baseFilename + ".xml");
diff --git a/tests/CycloneDX.Spdx.Tests/XmlValidatorTests.cs b/tests/CycloneDX.Spdx.Tests/XmlValidatorTests.cs
index 971a74b0..91a0f016 100644
--- a/tests/CycloneDX.Spdx.Tests/XmlValidatorTests.cs
+++ b/tests/CycloneDX.Spdx.Tests/XmlValidatorTests.cs
@@ -28,11 +28,11 @@ namespace CycloneDX.Spdx.Tests
public class XmlValidatorTests
{
[Theory]
- //[InlineData("v2.2")]
- [InlineData("v2.3")]
- public void ValidateXmlStringTest(string version)
+ [InlineData("document")]
+ [InlineData("document-with-hyphens-in-external-reference-category")]
+ public void ValidateXmlStringTest(string baseFilename)
{
- var resourceFilename = Path.Join("Resources", version, "document" + ".xml");
+ var resourceFilename = Path.Join("Resources", "v2.3", baseFilename + ".xml");
var document = File.ReadAllText(resourceFilename);
var result = XmlValidator.Validate(document);
diff --git a/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonAsyncRoundTripTest_document-with-hyphens-in-external-reference-category.snap b/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonAsyncRoundTripTest_document-with-hyphens-in-external-reference-category.snap
new file mode 100644
index 00000000..4e5aca6b
--- /dev/null
+++ b/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonAsyncRoundTripTest_document-with-hyphens-in-external-reference-category.snap
@@ -0,0 +1,424 @@
+{
+ "SPDXID": "SPDXRef-DOCUMENT",
+ "spdxVersion": "SPDX-2.3",
+ "creationInfo": {
+ "comment": "This package has been shipped in source and binary form.\nThe binaries were created with gcc 4.5.1 and expect to link to\ncompatible system run time libraries.",
+ "created": "2010-01-29T18:30:22Z",
+ "creators": [
+ "Tool: LicenseFind-1.0",
+ "Organization: ExampleCodeInspect ()",
+ "Person: Jane Doe ()"
+ ],
+ "licenseListVersion": "3.17"
+ },
+ "name": "SPDX-Tools-v2.0",
+ "dataLicense": "CC0-1.0",
+ "comment": "This document was created using SPDX 2.0 using licenses from the web site.",
+ "externalDocumentRefs": [
+ {
+ "externalDocumentId": "DocumentRef-spdx-tool-1.2",
+ "checksum": {
+ "algorithm": "SHA1",
+ "checksumValue": "d6a770ba38583ed4bb4525bd96e50461655d2759"
+ },
+ "spdxDocument": "http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301"
+ }
+ ],
+ "hasExtractedLicensingInfos": [
+ {
+ "licenseId": "LicenseRef-1",
+ "extractedText": "/*\n * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR \u0060\u0060AS IS\u0027\u0027 AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/"
+ },
+ {
+ "licenseId": "LicenseRef-2",
+ "extractedText": "This package includes the GRDDL parser developed by Hewlett Packard under the following license:\n\u00A9 Copyright 2007 Hewlett-Packard Development Company, LP\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: \n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. \nThe name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. \nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR \u0060\u0060AS IS\u0027\u0027 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ },
+ {
+ "licenseId": "LicenseRef-4",
+ "extractedText": "/*\n * (c) Copyright 2009 University of Bristol\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR \u0060\u0060AS IS\u0027\u0027 AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/"
+ },
+ {
+ "licenseId": "LicenseRef-Beerware-4.2",
+ "comment": "The beerware license has a couple of other standard variants.",
+ "extractedText": "\u0022THE BEER-WARE LICENSE\u0022 (Revision 42):\nphk@FreeBSD.ORG wrote this file. As long as you retain this notice you\ncan do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp",
+ "name": "Beer-Ware License (Version 42)",
+ "seeAlsos": [
+ "http://people.freebsd.org/~phk/"
+ ]
+ },
+ {
+ "licenseId": "LicenseRef-3",
+ "comment": "This is tye CyperNeko License",
+ "extractedText": "The CyberNeko Software License, Version 1.0\n\n \n(C) Copyright 2002-2005, Andy Clark. All rights reserved.\n \nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer. \n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n3. The end-user documentation included with the redistribution,\n if any, must include the following acknowledgment: \n \u0022This product includes software developed by Andy Clark.\u0022\n Alternately, this acknowledgment may appear in the software itself,\n if and wherever such third-party acknowledgments normally appear.\n\n4. The names \u0022CyberNeko\u0022 and \u0022NekoHTML\u0022 must not be used to endorse\n or promote products derived from this software without prior \n written permission. For written permission, please contact \n andyc@cyberneko.net.\n\n5. Products derived from this software may not be called \u0022CyberNeko\u0022,\n nor may \u0022CyberNeko\u0022 appear in their name, without prior written\n permission of the author.\n\nTHIS SOFTWARE IS PROVIDED \u0060\u0060AS IS\u0027\u0027 AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, \nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE \nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+ "name": "CyberNeko License",
+ "seeAlsos": [
+ "http://people.apache.org/~andyc/neko/LICENSE",
+ "http://justasample.url.com"
+ ]
+ }
+ ],
+ "annotations": [
+ {
+ "annotationDate": "2010-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: Jane Doe ()",
+ "comment": "Document level annotation"
+ },
+ {
+ "annotationDate": "2010-02-10T00:00:00Z",
+ "annotationType": "REVIEW",
+ "annotator": "Person: Joe Reviewer",
+ "comment": "This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses"
+ },
+ {
+ "annotationDate": "2011-03-13T00:00:00Z",
+ "annotationType": "REVIEW",
+ "annotator": "Person: Suzanne Reviewer",
+ "comment": "Another example reviewer."
+ }
+ ],
+ "documentDescribes": [
+ "SPDXRef-File",
+ "SPDXRef-Package"
+ ],
+ "documentNamespace": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301",
+ "packages": [
+ {
+ "SPDXID": "SPDXRef-Package",
+ "annotations": [
+ {
+ "annotationDate": "2011-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: Package Commenter",
+ "comment": "Package level annotation"
+ }
+ ],
+ "attributionTexts": [
+ "The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually."
+ ],
+ "builtDate": "2011-01-29T18:30:22Z",
+ "checksums": [
+ {
+ "algorithm": "MD5",
+ "checksumValue": "624c1abb3664f4b35547e7c73864ad24"
+ },
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "85ed0817af83a24ad8da68c2b5094de69833983c"
+ },
+ {
+ "algorithm": "SHA256",
+ "checksumValue": "11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd"
+ },
+ {
+ "algorithm": "BLAKE2b_384",
+ "checksumValue": "aaabd89c926ab525c242e6621f2f5fa73aa4afe3d9e24aed727faaadd6af38b620bdb623dd2b4788b1c8086984af8706"
+ }
+ ],
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "description": "The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.",
+ "downloadLocation": "http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
+ "externalRefs": [
+ {
+ "referenceCategory": "SECURITY",
+ "referenceLocator": "cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*",
+ "referenceType": "cpe23Type"
+ },
+ {
+ "comment": "This is the external ref for Acme",
+ "referenceCategory": "PERSISTENT-ID",
+ "referenceLocator": "acmecorp/acmenator/4.1.3-alpha",
+ "referenceType": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge"
+ }
+ ],
+ "filesAnalyzed": true,
+ "homepage": "http://ftp.gnu.org/gnu/glibc",
+ "licenseComments": "The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.",
+ "licenseConcluded": "(LGPL-2.0-only OR LicenseRef-3)",
+ "licenseDeclared": "(LGPL-2.0-only AND LicenseRef-3)",
+ "licenseInfoFromFiles": [
+ "GPL-2.0-only",
+ "LicenseRef-2",
+ "LicenseRef-1"
+ ],
+ "name": "glibc",
+ "originator": "Organization: ExampleCodeInspect (contact@example.com)",
+ "packageFileName": "glibc-2.11.1.tar.gz",
+ "packageVerificationCode": {
+ "packageVerificationCodeExcludedFiles": [
+ "./package.spdx"
+ ],
+ "packageVerificationCodeValue": "d6a770ba38583ed4bb4525bd96e50461655d2758"
+ },
+ "primaryPackagePurpose": "SOURCE",
+ "hasFiles": [
+ "SPDXRef-Specification",
+ "SPDXRef-Specification",
+ "SPDXRef-CommonsLangSrc",
+ "SPDXRef-Specification",
+ "SPDXRef-CommonsLangSrc",
+ "SPDXRef-JenaLib",
+ "SPDXRef-Specification",
+ "SPDXRef-CommonsLangSrc",
+ "SPDXRef-JenaLib",
+ "SPDXRef-DoapSource",
+ "SPDXRef-Specification",
+ "SPDXRef-CommonsLangSrc",
+ "SPDXRef-JenaLib",
+ "SPDXRef-DoapSource"
+ ],
+ "releaseDate": "2012-01-29T18:30:22Z",
+ "sourceInfo": "uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.",
+ "summary": "GNU C library.",
+ "supplier": "Person: Jane Doe (jane.doe@example.com)",
+ "validUntilDate": "2014-01-29T18:30:22Z",
+ "versionInfo": "2.11.1"
+ },
+ {
+ "SPDXID": "SPDXRef-fromDoap-1",
+ "copyrightText": "NOASSERTION",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "homepage": "http://commons.apache.org/proper/commons-lang/",
+ "licenseConcluded": "NOASSERTION",
+ "licenseDeclared": "NOASSERTION",
+ "name": "Apache Commons Lang"
+ },
+ {
+ "SPDXID": "SPDXRef-fromDoap-0",
+ "downloadLocation": "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceLocator": "pkg:maven/org.apache.jena/apache-jena@3.12.0",
+ "referenceType": "purl"
+ }
+ ],
+ "filesAnalyzed": false,
+ "homepage": "http://www.openjena.org/",
+ "name": "Jena",
+ "primaryPackagePurpose": "APPLICATION",
+ "versionInfo": "3.12.0"
+ },
+ {
+ "SPDXID": "SPDXRef-Saxon",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "85ed0817af83a24ad8da68c2b5094de69833983c"
+ }
+ ],
+ "copyrightText": "Copyright Saxonica Ltd",
+ "description": "The Saxon package is a collection of tools for processing XML documents.",
+ "downloadLocation": "https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download",
+ "filesAnalyzed": false,
+ "homepage": "http://saxon.sourceforge.net/",
+ "licenseComments": "Other versions available for a commercial license",
+ "licenseConcluded": "MPL-1.0",
+ "licenseDeclared": "MPL-1.0",
+ "name": "Saxon",
+ "packageFileName": "saxonB-8.8.zip",
+ "versionInfo": "8.8"
+ }
+ ],
+ "files": [
+ {
+ "SPDXID": "SPDXRef-DoapSource",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
+ }
+ ],
+ "copyrightText": "Copyright 2010, 2011 Source Auditor Inc.",
+ "fileContributors": [
+ "Protecode Inc.",
+ "SPDX Technical Team Members",
+ "Open Logic Inc.",
+ "Source Auditor Inc.",
+ "Black Duck Software In.c"
+ ],
+ "fileName": "./src/org/spdx/parser/DOAPProject.java",
+ "fileTypes": [
+ "SOURCE"
+ ],
+ "licenseConcluded": "Apache-2.0",
+ "licenseInfoInFiles": [
+ "Apache-2.0"
+ ]
+ },
+ {
+ "SPDXID": "SPDXRef-CommonsLangSrc",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "c2b4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "This file is used by Jena",
+ "copyrightText": "Copyright 2001-2011 The Apache Software Foundation",
+ "fileContributors": [
+ "Apache Software Foundation"
+ ],
+ "fileName": "./lib-source/commons-lang3-3.1-sources.jar",
+ "fileTypes": [
+ "ARCHIVE"
+ ],
+ "licenseConcluded": "Apache-2.0",
+ "licenseInfoInFiles": [
+ "Apache-2.0"
+ ],
+ "noticeText": "Apache Commons Lang\nCopyright 2001-2011 The Apache Software Foundation\n\nThis product includes software developed by\nThe Apache Software Foundation (http://www.apache.org/).\n\nThis product includes software from the Spring Framework,\nunder the Apache License 2.0 (see: StringUtils.containsWhitespace())"
+ },
+ {
+ "SPDXID": "SPDXRef-JenaLib",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "3ab4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "This file belongs to Jena",
+ "copyrightText": "(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP",
+ "fileContributors": [
+ "Apache Software Foundation",
+ "Hewlett Packard Inc."
+ ],
+ "fileName": "./lib-source/jena-2.6.3-sources.jar",
+ "fileTypes": [
+ "ARCHIVE"
+ ],
+ "licenseComments": "This license is used by Jena",
+ "licenseConcluded": "LicenseRef-1",
+ "licenseInfoInFiles": [
+ "LicenseRef-1"
+ ]
+ },
+ {
+ "SPDXID": "SPDXRef-Specification",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "fff4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "Specification Documentation",
+ "fileName": "./docs/myspec.pdf",
+ "fileTypes": [
+ "DOCUMENTATION"
+ ]
+ },
+ {
+ "SPDXID": "SPDXRef-File",
+ "annotations": [
+ {
+ "annotationDate": "2011-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: File Commenter",
+ "comment": "File level annotation"
+ }
+ ],
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "d6a770ba38583ed4bb4525bd96e50461655d2758"
+ },
+ {
+ "algorithm": "MD5",
+ "checksumValue": "624c1abb3664f4b35547e7c73864ad24"
+ }
+ ],
+ "comment": "The concluded license was taken from the package level that the file was included in.\nThis information was found in the COPYING.txt file in the xyz directory.",
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "fileContributors": [
+ "The Regents of the University of California",
+ "Modified by Paul Mundt lethal@linux-sh.org",
+ "IBM Corporation"
+ ],
+ "fileName": "./package/foo.c",
+ "fileTypes": [
+ "SOURCE"
+ ],
+ "licenseComments": "The concluded license was taken from the package level that the file was included in.",
+ "licenseConcluded": "(LGPL-2.0-only OR LicenseRef-2)",
+ "licenseInfoInFiles": [
+ "GPL-2.0-only",
+ "LicenseRef-2"
+ ],
+ "noticeText": "Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u0022Software\u0022), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \u0022AS IS\u0022, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
+ }
+ ],
+ "snippets": [
+ {
+ "SPDXID": "SPDXRef-Snippet",
+ "comment": "This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.",
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "licenseComments": "The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.",
+ "licenseConcluded": "GPL-2.0-only",
+ "licenseInfoInSnippets": [
+ "GPL-2.0-only"
+ ],
+ "name": "from linux kernel",
+ "ranges": [
+ {
+ "endPointer": {
+ "offset": 420,
+ "reference": "SPDXRef-DoapSource"
+ },
+ "startPointer": {
+ "offset": 310,
+ "reference": "SPDXRef-DoapSource"
+ }
+ },
+ {
+ "endPointer": {
+ "lineNumber": 23,
+ "reference": "SPDXRef-DoapSource"
+ },
+ "startPointer": {
+ "lineNumber": 5,
+ "reference": "SPDXRef-DoapSource"
+ }
+ }
+ ],
+ "snippetFromFile": "SPDXRef-DoapSource"
+ }
+ ],
+ "relationships": [
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relationshipType": "CONTAINS",
+ "relatedSpdxElement": "SPDXRef-Package"
+ },
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relationshipType": "COPY_OF",
+ "relatedSpdxElement": "DocumentRef-spdx-tool-1.2:SPDXRef-ToolsElement"
+ },
+ {
+ "spdxElementId": "SPDXRef-Package",
+ "relationshipType": "DYNAMIC_LINK",
+ "relatedSpdxElement": "SPDXRef-Saxon"
+ },
+ {
+ "spdxElementId": "SPDXRef-CommonsLangSrc",
+ "relationshipType": "GENERATED_FROM",
+ "relatedSpdxElement": "NOASSERTION"
+ },
+ {
+ "spdxElementId": "SPDXRef-JenaLib",
+ "relationshipType": "CONTAINS",
+ "relatedSpdxElement": "SPDXRef-Package"
+ },
+ {
+ "spdxElementId": "SPDXRef-Specification",
+ "relationshipType": "SPECIFICATION_FOR",
+ "relatedSpdxElement": "SPDXRef-fromDoap-0"
+ },
+ {
+ "spdxElementId": "SPDXRef-File",
+ "relationshipType": "GENERATED_FROM",
+ "relatedSpdxElement": "SPDXRef-fromDoap-0"
+ }
+ ]
+}
diff --git a/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonAsyncRoundTripTest_document.snap b/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonAsyncRoundTripTest_document.snap
index 70a28f65..4e5aca6b 100644
--- a/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonAsyncRoundTripTest_document.snap
+++ b/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonAsyncRoundTripTest_document.snap
@@ -126,7 +126,7 @@
},
{
"comment": "This is the external ref for Acme",
- "referenceCategory": "PERSISTENT_ID",
+ "referenceCategory": "PERSISTENT-ID",
"referenceLocator": "acmecorp/acmenator/4.1.3-alpha",
"referenceType": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge"
}
@@ -189,7 +189,7 @@
"downloadLocation": "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
"externalRefs": [
{
- "referenceCategory": "PACKAGE_MANAGER",
+ "referenceCategory": "PACKAGE-MANAGER",
"referenceLocator": "pkg:maven/org.apache.jena/apache-jena@3.12.0",
"referenceType": "purl"
}
diff --git a/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonRoundTripTest_document-with-hyphens-in-external-reference-category.snap b/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonRoundTripTest_document-with-hyphens-in-external-reference-category.snap
new file mode 100644
index 00000000..4e5aca6b
--- /dev/null
+++ b/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonRoundTripTest_document-with-hyphens-in-external-reference-category.snap
@@ -0,0 +1,424 @@
+{
+ "SPDXID": "SPDXRef-DOCUMENT",
+ "spdxVersion": "SPDX-2.3",
+ "creationInfo": {
+ "comment": "This package has been shipped in source and binary form.\nThe binaries were created with gcc 4.5.1 and expect to link to\ncompatible system run time libraries.",
+ "created": "2010-01-29T18:30:22Z",
+ "creators": [
+ "Tool: LicenseFind-1.0",
+ "Organization: ExampleCodeInspect ()",
+ "Person: Jane Doe ()"
+ ],
+ "licenseListVersion": "3.17"
+ },
+ "name": "SPDX-Tools-v2.0",
+ "dataLicense": "CC0-1.0",
+ "comment": "This document was created using SPDX 2.0 using licenses from the web site.",
+ "externalDocumentRefs": [
+ {
+ "externalDocumentId": "DocumentRef-spdx-tool-1.2",
+ "checksum": {
+ "algorithm": "SHA1",
+ "checksumValue": "d6a770ba38583ed4bb4525bd96e50461655d2759"
+ },
+ "spdxDocument": "http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301"
+ }
+ ],
+ "hasExtractedLicensingInfos": [
+ {
+ "licenseId": "LicenseRef-1",
+ "extractedText": "/*\n * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR \u0060\u0060AS IS\u0027\u0027 AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/"
+ },
+ {
+ "licenseId": "LicenseRef-2",
+ "extractedText": "This package includes the GRDDL parser developed by Hewlett Packard under the following license:\n\u00A9 Copyright 2007 Hewlett-Packard Development Company, LP\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: \n\nRedistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. \nRedistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. \nThe name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. \nTHIS SOFTWARE IS PROVIDED BY THE AUTHOR \u0060\u0060AS IS\u0027\u0027 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+ },
+ {
+ "licenseId": "LicenseRef-4",
+ "extractedText": "/*\n * (c) Copyright 2009 University of Bristol\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR \u0060\u0060AS IS\u0027\u0027 AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/"
+ },
+ {
+ "licenseId": "LicenseRef-Beerware-4.2",
+ "comment": "The beerware license has a couple of other standard variants.",
+ "extractedText": "\u0022THE BEER-WARE LICENSE\u0022 (Revision 42):\nphk@FreeBSD.ORG wrote this file. As long as you retain this notice you\ncan do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp",
+ "name": "Beer-Ware License (Version 42)",
+ "seeAlsos": [
+ "http://people.freebsd.org/~phk/"
+ ]
+ },
+ {
+ "licenseId": "LicenseRef-3",
+ "comment": "This is tye CyperNeko License",
+ "extractedText": "The CyberNeko Software License, Version 1.0\n\n \n(C) Copyright 2002-2005, Andy Clark. All rights reserved.\n \nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer. \n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in\n the documentation and/or other materials provided with the\n distribution.\n\n3. The end-user documentation included with the redistribution,\n if any, must include the following acknowledgment: \n \u0022This product includes software developed by Andy Clark.\u0022\n Alternately, this acknowledgment may appear in the software itself,\n if and wherever such third-party acknowledgments normally appear.\n\n4. The names \u0022CyberNeko\u0022 and \u0022NekoHTML\u0022 must not be used to endorse\n or promote products derived from this software without prior \n written permission. For written permission, please contact \n andyc@cyberneko.net.\n\n5. Products derived from this software may not be called \u0022CyberNeko\u0022,\n nor may \u0022CyberNeko\u0022 appear in their name, without prior written\n permission of the author.\n\nTHIS SOFTWARE IS PROVIDED \u0060\u0060AS IS\u0027\u0027 AND ANY EXPRESSED OR IMPLIED\nWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\nOF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS\nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, \nOR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT \nOF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR \nBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, \nWHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE \nOR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \nEVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.",
+ "name": "CyberNeko License",
+ "seeAlsos": [
+ "http://people.apache.org/~andyc/neko/LICENSE",
+ "http://justasample.url.com"
+ ]
+ }
+ ],
+ "annotations": [
+ {
+ "annotationDate": "2010-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: Jane Doe ()",
+ "comment": "Document level annotation"
+ },
+ {
+ "annotationDate": "2010-02-10T00:00:00Z",
+ "annotationType": "REVIEW",
+ "annotator": "Person: Joe Reviewer",
+ "comment": "This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses"
+ },
+ {
+ "annotationDate": "2011-03-13T00:00:00Z",
+ "annotationType": "REVIEW",
+ "annotator": "Person: Suzanne Reviewer",
+ "comment": "Another example reviewer."
+ }
+ ],
+ "documentDescribes": [
+ "SPDXRef-File",
+ "SPDXRef-Package"
+ ],
+ "documentNamespace": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301",
+ "packages": [
+ {
+ "SPDXID": "SPDXRef-Package",
+ "annotations": [
+ {
+ "annotationDate": "2011-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: Package Commenter",
+ "comment": "Package level annotation"
+ }
+ ],
+ "attributionTexts": [
+ "The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually."
+ ],
+ "builtDate": "2011-01-29T18:30:22Z",
+ "checksums": [
+ {
+ "algorithm": "MD5",
+ "checksumValue": "624c1abb3664f4b35547e7c73864ad24"
+ },
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "85ed0817af83a24ad8da68c2b5094de69833983c"
+ },
+ {
+ "algorithm": "SHA256",
+ "checksumValue": "11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd"
+ },
+ {
+ "algorithm": "BLAKE2b_384",
+ "checksumValue": "aaabd89c926ab525c242e6621f2f5fa73aa4afe3d9e24aed727faaadd6af38b620bdb623dd2b4788b1c8086984af8706"
+ }
+ ],
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "description": "The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.",
+ "downloadLocation": "http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz",
+ "externalRefs": [
+ {
+ "referenceCategory": "SECURITY",
+ "referenceLocator": "cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*",
+ "referenceType": "cpe23Type"
+ },
+ {
+ "comment": "This is the external ref for Acme",
+ "referenceCategory": "PERSISTENT-ID",
+ "referenceLocator": "acmecorp/acmenator/4.1.3-alpha",
+ "referenceType": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge"
+ }
+ ],
+ "filesAnalyzed": true,
+ "homepage": "http://ftp.gnu.org/gnu/glibc",
+ "licenseComments": "The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.",
+ "licenseConcluded": "(LGPL-2.0-only OR LicenseRef-3)",
+ "licenseDeclared": "(LGPL-2.0-only AND LicenseRef-3)",
+ "licenseInfoFromFiles": [
+ "GPL-2.0-only",
+ "LicenseRef-2",
+ "LicenseRef-1"
+ ],
+ "name": "glibc",
+ "originator": "Organization: ExampleCodeInspect (contact@example.com)",
+ "packageFileName": "glibc-2.11.1.tar.gz",
+ "packageVerificationCode": {
+ "packageVerificationCodeExcludedFiles": [
+ "./package.spdx"
+ ],
+ "packageVerificationCodeValue": "d6a770ba38583ed4bb4525bd96e50461655d2758"
+ },
+ "primaryPackagePurpose": "SOURCE",
+ "hasFiles": [
+ "SPDXRef-Specification",
+ "SPDXRef-Specification",
+ "SPDXRef-CommonsLangSrc",
+ "SPDXRef-Specification",
+ "SPDXRef-CommonsLangSrc",
+ "SPDXRef-JenaLib",
+ "SPDXRef-Specification",
+ "SPDXRef-CommonsLangSrc",
+ "SPDXRef-JenaLib",
+ "SPDXRef-DoapSource",
+ "SPDXRef-Specification",
+ "SPDXRef-CommonsLangSrc",
+ "SPDXRef-JenaLib",
+ "SPDXRef-DoapSource"
+ ],
+ "releaseDate": "2012-01-29T18:30:22Z",
+ "sourceInfo": "uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.",
+ "summary": "GNU C library.",
+ "supplier": "Person: Jane Doe (jane.doe@example.com)",
+ "validUntilDate": "2014-01-29T18:30:22Z",
+ "versionInfo": "2.11.1"
+ },
+ {
+ "SPDXID": "SPDXRef-fromDoap-1",
+ "copyrightText": "NOASSERTION",
+ "downloadLocation": "NOASSERTION",
+ "filesAnalyzed": false,
+ "homepage": "http://commons.apache.org/proper/commons-lang/",
+ "licenseConcluded": "NOASSERTION",
+ "licenseDeclared": "NOASSERTION",
+ "name": "Apache Commons Lang"
+ },
+ {
+ "SPDXID": "SPDXRef-fromDoap-0",
+ "downloadLocation": "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
+ "externalRefs": [
+ {
+ "referenceCategory": "PACKAGE-MANAGER",
+ "referenceLocator": "pkg:maven/org.apache.jena/apache-jena@3.12.0",
+ "referenceType": "purl"
+ }
+ ],
+ "filesAnalyzed": false,
+ "homepage": "http://www.openjena.org/",
+ "name": "Jena",
+ "primaryPackagePurpose": "APPLICATION",
+ "versionInfo": "3.12.0"
+ },
+ {
+ "SPDXID": "SPDXRef-Saxon",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "85ed0817af83a24ad8da68c2b5094de69833983c"
+ }
+ ],
+ "copyrightText": "Copyright Saxonica Ltd",
+ "description": "The Saxon package is a collection of tools for processing XML documents.",
+ "downloadLocation": "https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download",
+ "filesAnalyzed": false,
+ "homepage": "http://saxon.sourceforge.net/",
+ "licenseComments": "Other versions available for a commercial license",
+ "licenseConcluded": "MPL-1.0",
+ "licenseDeclared": "MPL-1.0",
+ "name": "Saxon",
+ "packageFileName": "saxonB-8.8.zip",
+ "versionInfo": "8.8"
+ }
+ ],
+ "files": [
+ {
+ "SPDXID": "SPDXRef-DoapSource",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
+ }
+ ],
+ "copyrightText": "Copyright 2010, 2011 Source Auditor Inc.",
+ "fileContributors": [
+ "Protecode Inc.",
+ "SPDX Technical Team Members",
+ "Open Logic Inc.",
+ "Source Auditor Inc.",
+ "Black Duck Software In.c"
+ ],
+ "fileName": "./src/org/spdx/parser/DOAPProject.java",
+ "fileTypes": [
+ "SOURCE"
+ ],
+ "licenseConcluded": "Apache-2.0",
+ "licenseInfoInFiles": [
+ "Apache-2.0"
+ ]
+ },
+ {
+ "SPDXID": "SPDXRef-CommonsLangSrc",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "c2b4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "This file is used by Jena",
+ "copyrightText": "Copyright 2001-2011 The Apache Software Foundation",
+ "fileContributors": [
+ "Apache Software Foundation"
+ ],
+ "fileName": "./lib-source/commons-lang3-3.1-sources.jar",
+ "fileTypes": [
+ "ARCHIVE"
+ ],
+ "licenseConcluded": "Apache-2.0",
+ "licenseInfoInFiles": [
+ "Apache-2.0"
+ ],
+ "noticeText": "Apache Commons Lang\nCopyright 2001-2011 The Apache Software Foundation\n\nThis product includes software developed by\nThe Apache Software Foundation (http://www.apache.org/).\n\nThis product includes software from the Spring Framework,\nunder the Apache License 2.0 (see: StringUtils.containsWhitespace())"
+ },
+ {
+ "SPDXID": "SPDXRef-JenaLib",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "3ab4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "This file belongs to Jena",
+ "copyrightText": "(c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP",
+ "fileContributors": [
+ "Apache Software Foundation",
+ "Hewlett Packard Inc."
+ ],
+ "fileName": "./lib-source/jena-2.6.3-sources.jar",
+ "fileTypes": [
+ "ARCHIVE"
+ ],
+ "licenseComments": "This license is used by Jena",
+ "licenseConcluded": "LicenseRef-1",
+ "licenseInfoInFiles": [
+ "LicenseRef-1"
+ ]
+ },
+ {
+ "SPDXID": "SPDXRef-Specification",
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "fff4e1c67a2d28fced849ee1bb76e7391b93f125"
+ }
+ ],
+ "comment": "Specification Documentation",
+ "fileName": "./docs/myspec.pdf",
+ "fileTypes": [
+ "DOCUMENTATION"
+ ]
+ },
+ {
+ "SPDXID": "SPDXRef-File",
+ "annotations": [
+ {
+ "annotationDate": "2011-01-29T18:30:22Z",
+ "annotationType": "OTHER",
+ "annotator": "Person: File Commenter",
+ "comment": "File level annotation"
+ }
+ ],
+ "checksums": [
+ {
+ "algorithm": "SHA1",
+ "checksumValue": "d6a770ba38583ed4bb4525bd96e50461655d2758"
+ },
+ {
+ "algorithm": "MD5",
+ "checksumValue": "624c1abb3664f4b35547e7c73864ad24"
+ }
+ ],
+ "comment": "The concluded license was taken from the package level that the file was included in.\nThis information was found in the COPYING.txt file in the xyz directory.",
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "fileContributors": [
+ "The Regents of the University of California",
+ "Modified by Paul Mundt lethal@linux-sh.org",
+ "IBM Corporation"
+ ],
+ "fileName": "./package/foo.c",
+ "fileTypes": [
+ "SOURCE"
+ ],
+ "licenseComments": "The concluded license was taken from the package level that the file was included in.",
+ "licenseConcluded": "(LGPL-2.0-only OR LicenseRef-2)",
+ "licenseInfoInFiles": [
+ "GPL-2.0-only",
+ "LicenseRef-2"
+ ],
+ "noticeText": "Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u0022Software\u0022), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: \nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \u0022AS IS\u0022, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
+ }
+ ],
+ "snippets": [
+ {
+ "SPDXID": "SPDXRef-Snippet",
+ "comment": "This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.",
+ "copyrightText": "Copyright 2008-2010 John Smith",
+ "licenseComments": "The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.",
+ "licenseConcluded": "GPL-2.0-only",
+ "licenseInfoInSnippets": [
+ "GPL-2.0-only"
+ ],
+ "name": "from linux kernel",
+ "ranges": [
+ {
+ "endPointer": {
+ "offset": 420,
+ "reference": "SPDXRef-DoapSource"
+ },
+ "startPointer": {
+ "offset": 310,
+ "reference": "SPDXRef-DoapSource"
+ }
+ },
+ {
+ "endPointer": {
+ "lineNumber": 23,
+ "reference": "SPDXRef-DoapSource"
+ },
+ "startPointer": {
+ "lineNumber": 5,
+ "reference": "SPDXRef-DoapSource"
+ }
+ }
+ ],
+ "snippetFromFile": "SPDXRef-DoapSource"
+ }
+ ],
+ "relationships": [
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relationshipType": "CONTAINS",
+ "relatedSpdxElement": "SPDXRef-Package"
+ },
+ {
+ "spdxElementId": "SPDXRef-DOCUMENT",
+ "relationshipType": "COPY_OF",
+ "relatedSpdxElement": "DocumentRef-spdx-tool-1.2:SPDXRef-ToolsElement"
+ },
+ {
+ "spdxElementId": "SPDXRef-Package",
+ "relationshipType": "DYNAMIC_LINK",
+ "relatedSpdxElement": "SPDXRef-Saxon"
+ },
+ {
+ "spdxElementId": "SPDXRef-CommonsLangSrc",
+ "relationshipType": "GENERATED_FROM",
+ "relatedSpdxElement": "NOASSERTION"
+ },
+ {
+ "spdxElementId": "SPDXRef-JenaLib",
+ "relationshipType": "CONTAINS",
+ "relatedSpdxElement": "SPDXRef-Package"
+ },
+ {
+ "spdxElementId": "SPDXRef-Specification",
+ "relationshipType": "SPECIFICATION_FOR",
+ "relatedSpdxElement": "SPDXRef-fromDoap-0"
+ },
+ {
+ "spdxElementId": "SPDXRef-File",
+ "relationshipType": "GENERATED_FROM",
+ "relatedSpdxElement": "SPDXRef-fromDoap-0"
+ }
+ ]
+}
diff --git a/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonRoundTripTest_document.snap b/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonRoundTripTest_document.snap
index 70a28f65..4e5aca6b 100644
--- a/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonRoundTripTest_document.snap
+++ b/tests/CycloneDX.Spdx.Tests/__snapshots__/JsonSerializerTests.JsonRoundTripTest_document.snap
@@ -126,7 +126,7 @@
},
{
"comment": "This is the external ref for Acme",
- "referenceCategory": "PERSISTENT_ID",
+ "referenceCategory": "PERSISTENT-ID",
"referenceLocator": "acmecorp/acmenator/4.1.3-alpha",
"referenceType": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge"
}
@@ -189,7 +189,7 @@
"downloadLocation": "https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz",
"externalRefs": [
{
- "referenceCategory": "PACKAGE_MANAGER",
+ "referenceCategory": "PACKAGE-MANAGER",
"referenceLocator": "pkg:maven/org.apache.jena/apache-jena@3.12.0",
"referenceType": "purl"
}
diff --git a/tests/CycloneDX.Spdx.Tests/__snapshots__/XmlSerializerTests.XmlRoundTripTest_document-with-hyphens-in-external-reference-category.snap b/tests/CycloneDX.Spdx.Tests/__snapshots__/XmlSerializerTests.XmlRoundTripTest_document-with-hyphens-in-external-reference-category.snap
new file mode 100644
index 00000000..caf1c701
--- /dev/null
+++ b/tests/CycloneDX.Spdx.Tests/__snapshots__/XmlSerializerTests.XmlRoundTripTest_document-with-hyphens-in-external-reference-category.snap
@@ -0,0 +1,475 @@
+
+
+ SPDXRef-DOCUMENT
+
+
+ This package has been shipped in source and binary form.
+ The binaries were created with gcc 4.5.1 and expect to link to
+ compatible system run time libraries.
+
+ 2010-01-29T18:30:22Z
+ Tool: LicenseFind-1.0
+ Organization: ExampleCodeInspect ()
+ Person: Jane Doe ()
+ 3.17
+
+ SPDX-Tools-v2.0
+ This document was created using SPDX 2.0 using licenses from the web site.
+
+ DocumentRef-spdx-tool-1.2
+
+ SHA1
+ d6a770ba38583ed4bb4525bd96e50461655d2759
+
+ http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301
+
+
+ LicenseRef-1
+
+ /*
+ * (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+
+ LicenseRef-2
+
+ This package includes the GRDDL parser developed by Hewlett Packard under the following license:
+ © Copyright 2007 Hewlett-Packard Development Company, LP
+
+ Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+ Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+ Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+ The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+ LicenseRef-4
+
+ /*
+ * (c) Copyright 2009 University of Bristol
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+
+
+ LicenseRef-Beerware-4.2
+ The beerware license has a couple of other standard variants.
+
+ "THE BEER-WARE LICENSE" (Revision 42):
+ phk@FreeBSD.ORG wrote this file. As long as you retain this notice you
+ can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return Poul-Henning Kamp
+
+ Beer-Ware License (Version 42)
+ http://people.freebsd.org/~phk/
+
+
+ LicenseRef-3
+ This is tye CyperNeko License
+
+ The CyberNeko Software License, Version 1.0
+
+
+ (C) Copyright 2002-2005, Andy Clark. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ 3. The end-user documentation included with the redistribution,
+ if any, must include the following acknowledgment:
+ "This product includes software developed by Andy Clark."
+ Alternately, this acknowledgment may appear in the software itself,
+ if and wherever such third-party acknowledgments normally appear.
+
+ 4. The names "CyberNeko" and "NekoHTML" must not be used to endorse
+ or promote products derived from this software without prior
+ written permission. For written permission, please contact
+ andyc@cyberneko.net.
+
+ 5. Products derived from this software may not be called "CyberNeko",
+ nor may "CyberNeko" appear in their name, without prior written
+ permission of the author.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR OTHER CONTRIBUTORS
+ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ CyberNeko License
+ http://people.apache.org/~andyc/neko/LICENSE
+ http://justasample.url.com
+
+
+ 2010-01-29T18:30:22Z
+ OTHER
+ Person: Jane Doe ()
+ Document level annotation
+
+
+ 2010-02-10T00:00:00Z
+ REVIEW
+ Person: Joe Reviewer
+ This is just an example. Some of the non-standard licenses look like they are actually BSD 3 clause licenses
+
+
+ 2011-03-13T00:00:00Z
+ REVIEW
+ Person: Suzanne Reviewer
+ Another example reviewer.
+
+ SPDXRef-File
+ SPDXRef-Package
+ http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301
+
+ SPDXRef-Package
+
+ 2011-01-29T18:30:22Z
+ OTHER
+ Person: Package Commenter
+ Package level annotation
+
+ The GNU C Library is free software. See the file COPYING.LIB for copying conditions, and LICENSES for notices about a few contributions that require these additional notices to be distributed. License copyright years may be listed using range notation, e.g., 1996-2015, indicating that every year in the range, inclusive, is a copyrightable year that would otherwise be listed individually.
+ 2011-01-29T18:30:22Z
+
+ MD5
+ 624c1abb3664f4b35547e7c73864ad24
+
+
+ SHA1
+ 85ed0817af83a24ad8da68c2b5094de69833983c
+
+
+ SHA256
+ 11b6d3ee554eedf79299905a98f9b9a04e498210b59f15094c916c91d150efcd
+
+
+ BLAKE2b-384
+ aaabd89c926ab525c242e6621f2f5fa73aa4afe3d9e24aed727faaadd6af38b620bdb623dd2b4788b1c8086984af8706
+
+ Copyright 2008-2010 John Smith
+ The GNU C Library defines functions that are specified by the ISO C standard, as well as additional features specific to POSIX and other derivatives of the Unix operating system, and extensions specific to GNU systems.
+ http://ftp.gnu.org/gnu/glibc/glibc-ports-2.15.tar.gz
+
+ SECURITY
+ cpe:2.3:a:pivotal_software:spring_framework:4.1.0:*:*:*:*:*:*:*
+ cpe23Type
+
+
+ This is the external ref for Acme
+ PERSISTENT-ID
+ acmecorp/acmenator/4.1.3-alpha
+ http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#LocationRef-acmeforge
+
+ true
+ http://ftp.gnu.org/gnu/glibc
+ The license for this project changed with the release of version x.y. The version of the project included here post-dates the license change.
+ (LGPL-2.0-only OR LicenseRef-3)
+ (LGPL-2.0-only AND LicenseRef-3)
+ GPL-2.0-only
+ LicenseRef-2
+ LicenseRef-1
+ glibc
+ Organization: ExampleCodeInspect (contact@example.com)
+ glibc-2.11.1.tar.gz
+
+ ./package.spdx
+ d6a770ba38583ed4bb4525bd96e50461655d2758
+
+ SOURCE
+ SPDXRef-Specification
+ SPDXRef-Specification
+ SPDXRef-CommonsLangSrc
+ SPDXRef-Specification
+ SPDXRef-CommonsLangSrc
+ SPDXRef-JenaLib
+ SPDXRef-Specification
+ SPDXRef-CommonsLangSrc
+ SPDXRef-JenaLib
+ SPDXRef-DoapSource
+ SPDXRef-Specification
+ SPDXRef-CommonsLangSrc
+ SPDXRef-JenaLib
+ SPDXRef-DoapSource
+ 2012-01-29T18:30:22Z
+ uses glibc-2_11-branch from git://sourceware.org/git/glibc.git.
+ GNU C library.
+ Person: Jane Doe (jane.doe@example.com)
+ 2014-01-29T18:30:22Z
+ 2.11.1
+
+
+ SPDXRef-fromDoap-1
+ NOASSERTION
+ NOASSERTION
+ false
+ http://commons.apache.org/proper/commons-lang/
+ NOASSERTION
+ NOASSERTION
+ Apache Commons Lang
+
+
+ SPDXRef-fromDoap-0
+ https://search.maven.org/remotecontent?filepath=org/apache/jena/apache-jena/3.12.0/apache-jena-3.12.0.tar.gz
+
+ PACKAGE-MANAGER
+ pkg:maven/org.apache.jena/apache-jena@3.12.0
+ purl
+
+ false
+ http://www.openjena.org/
+ Jena
+ 3.12.0
+
+
+ SPDXRef-Saxon
+
+ SHA1
+ 85ed0817af83a24ad8da68c2b5094de69833983c
+
+ Copyright Saxonica Ltd
+ The Saxon package is a collection of tools for processing XML documents.
+ https://sourceforge.net/projects/saxon/files/Saxon-B/8.8.0.7/saxonb8-8-0-7j.zip/download
+ false
+ http://saxon.sourceforge.net/
+ Other versions available for a commercial license
+ MPL-1.0
+ MPL-1.0
+ Saxon
+ saxonB-8.8.zip
+ 8.8
+
+
+ SPDXRef-DoapSource
+
+ SHA1
+ 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
+
+ Copyright 2010, 2011 Source Auditor Inc.
+ Protecode Inc.
+ SPDX Technical Team Members
+ Open Logic Inc.
+ Source Auditor Inc.
+ Black Duck Software In.c
+ ./src/org/spdx/parser/DOAPProject.java
+ SOURCE
+ Apache-2.0
+ Apache-2.0
+
+
+ SPDXRef-CommonsLangSrc
+
+ SHA1
+ c2b4e1c67a2d28fced849ee1bb76e7391b93f125
+
+ This file is used by Jena
+ Copyright 2001-2011 The Apache Software Foundation
+ Apache Software Foundation
+ ./lib-source/commons-lang3-3.1-sources.jar
+ ARCHIVE
+ Apache-2.0
+ Apache-2.0
+
+ Apache Commons Lang
+ Copyright 2001-2011 The Apache Software Foundation
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ This product includes software from the Spring Framework,
+ under the Apache License 2.0 (see: StringUtils.containsWhitespace())
+
+
+
+ SPDXRef-JenaLib
+
+ SHA1
+ 3ab4e1c67a2d28fced849ee1bb76e7391b93f125
+
+ This file belongs to Jena
+ (c) Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP
+ Apache Software Foundation
+ Hewlett Packard Inc.
+ ./lib-source/jena-2.6.3-sources.jar
+ ARCHIVE
+ This license is used by Jena
+ LicenseRef-1
+ LicenseRef-1
+
+
+ SPDXRef-Specification
+
+ SHA1
+ fff4e1c67a2d28fced849ee1bb76e7391b93f125
+
+ Specification Documentation
+ ./docs/myspec.pdf
+ DOCUMENTATION
+
+
+ SPDXRef-File
+
+ 2011-01-29T18:30:22Z
+ OTHER
+ Person: File Commenter
+ File level annotation
+
+
+ SHA1
+ d6a770ba38583ed4bb4525bd96e50461655d2758
+
+
+ MD5
+ 624c1abb3664f4b35547e7c73864ad24
+
+
+ The concluded license was taken from the package level that the file was included in.
+ This information was found in the COPYING.txt file in the xyz directory.
+
+ Copyright 2008-2010 John Smith
+ The Regents of the University of California
+ Modified by Paul Mundt lethal@linux-sh.org
+ IBM Corporation
+ ./package/foo.c
+ SOURCE
+ The concluded license was taken from the package level that the file was included in.
+ (LGPL-2.0-only OR LicenseRef-2)
+ GPL-2.0-only
+ LicenseRef-2
+
+ Copyright (c) 2001 Aaron Lehmann aaroni@vitelus.com
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+ SPDXRef-Snippet
+ This snippet was identified as significant and highlighted in this Apache-2.0 file, when a commercial scanner identified it as being derived from file foo.c in package xyz which is licensed under GPL-2.0.
+ Copyright 2008-2010 John Smith
+ The concluded license was taken from package xyz, from which the snippet was copied into the current file. The concluded license information was found in the COPYING.txt file in package xyz.
+ GPL-2.0-only
+ GPL-2.0-only
+ from linux kernel
+
+
+ 420
+ SPDXRef-DoapSource
+
+
+ 310
+ SPDXRef-DoapSource
+
+
+
+
+ 23
+ SPDXRef-DoapSource
+
+
+ 5
+ SPDXRef-DoapSource
+
+
+ SPDXRef-DoapSource
+
+
+ SPDXRef-DOCUMENT
+ CONTAINS
+ SPDXRef-Package
+
+
+ SPDXRef-DOCUMENT
+ COPY_OF
+ DocumentRef-spdx-tool-1.2:SPDXRef-ToolsElement
+
+
+ SPDXRef-Package
+ DYNAMIC_LINK
+ SPDXRef-Saxon
+
+
+ SPDXRef-CommonsLangSrc
+ GENERATED_FROM
+ NOASSERTION
+
+
+ SPDXRef-JenaLib
+ CONTAINS
+ SPDXRef-Package
+
+
+ SPDXRef-Specification
+ SPECIFICATION_FOR
+ SPDXRef-fromDoap-0
+
+
+ SPDXRef-File
+ GENERATED_FROM
+ SPDXRef-fromDoap-0
+
+