Skip to content

Commit

Permalink
Merge branch 'main' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
phisakel committed Nov 27, 2024
2 parents 168b72f + 29f30a9 commit 6838bde
Show file tree
Hide file tree
Showing 19 changed files with 1,146 additions and 497 deletions.
2 changes: 0 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "false",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "false"
},
"ghcr.io/devcontainers/features/git:1": {
Expand Down
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[*.swift]
indent_style = space
indent_size = 4
tab_width = 4
end_of_line = crlf
insert_final_newline = false
max_line_length = 120
trim_trailing_whitespace = true
79 changes: 79 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/MdocDataModel18013.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1610"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MdocDataModel18013"
BuildableName = "MdocDataModel18013"
BlueprintName = "MdocDataModel18013"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MdocDataModel18013Tests"
BuildableName = "MdocDataModel18013Tests"
BlueprintName = "MdocDataModel18013Tests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MdocDataModel18013"
BuildableName = "MdocDataModel18013"
BlueprintName = "MdocDataModel18013"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1610"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "MdocDataModel18013Tests"
BuildableName = "MdocDataModel18013Tests"
BlueprintName = "MdocDataModel18013Tests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
6 changes: 3 additions & 3 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"originHash" : "1fc736a3bfff36a7df370b7a914735d71b0a0a3897bf02fd79d4d70d5d0edc8d",
"originHash" : "3eabeceaaff7aca7549bf2b21745ba3028b27e5d8114e6f543dfbdd023912f1c",
"pins" : [
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "9bf03ff58ce34478e66aaee630e491823326fd06",
"version" : "1.1.3"
"revision" : "671108c96644956dddcd89dd59c203dcdb36cec7",
"version" : "1.1.4"
}
},
{
Expand Down
79 changes: 44 additions & 35 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "MdocDataModel18013",
defaultLocalization: "en",
platforms: [.macOS(.v10_15), .iOS(.v14), .tvOS(.v12), .watchOS(.v9)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "MdocDataModel18013",
targets: ["MdocDataModel18013"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/niscy-eudiw/SwiftCBOR.git", from: "0.6.2"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
],

targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "MdocDataModel18013",
dependencies: [
"SwiftCBOR",
.product(name: "Logging", package: "swift-log")
]),
.testTarget(
name: "MdocDataModel18013Tests",
dependencies: ["MdocDataModel18013"], resources: [.process("Resources")]),
]
)
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "MdocDataModel18013",
defaultLocalization: "en",
platforms: [.macOS(.v10_15), .iOS(.v14), .tvOS(.v12), .watchOS(.v9)],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "MdocDataModel18013",
targets: ["MdocDataModel18013"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
.package(url: "https://github.com/niscy-eudiw/SwiftCBOR.git", from: "0.6.2"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.3"),
] + cryptoPD
,

targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "MdocDataModel18013",
dependencies: [
"SwiftCBOR",
.product(name: "Logging", package: "swift-log")
] + cryptoTD),
.testTarget(
name: "MdocDataModel18013Tests",
dependencies: ["MdocDataModel18013"], resources: [.process("Resources")]),
]
)

#if !canImport(CryptoKit)
var cryptoPD: [Package.Dependency]{ [ Package.Dependency.package(url: "https://github.com/apple/swift-crypto.git", from: "3.9.0"), ] }
var cryptoTD: [Target.Dependency]{ [ .product(name: "Crypto", package: "swift-crypto"), ] }
#else
var cryptoPD: [Package.Dependency] { [] }
var cryptoTD: [Target.Dependency] { [] }
#endif
8 changes: 8 additions & 0 deletions Sources/MdocDataModel18013/Cose.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ extension Cose {
case es256 = 6 //-7 ECDSA w/ SHA-256
case es384 = 34 //-35 ECDSA w/ SHA-384
case es512 = 35//-36 ECDSA w/ SHA-512

public var signingAlgorithm: SigningAlgorithm {
switch self {
case .es256: return .ES256
case .es384: return .ES384
case .es512: return .ES512
}
}
}

/// MAC Algorithm Values
Expand Down
Loading

0 comments on commit 6838bde

Please sign in to comment.