-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved VSSKeyEntry to swift, added SPM
- Loading branch information
Showing
11 changed files
with
147 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ Pods | |
|
||
## Build generated | ||
build/ | ||
.build/ | ||
DerivedData/ | ||
|
||
## Various settings | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "virgil-crypto-x", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/VirgilSecurity/virgil-crypto-x.git", | ||
"state" : { | ||
"branch" : "develop", | ||
"revision" : "bb45915104076945276d8d32c515ecb5b2a1b362" | ||
} | ||
}, | ||
{ | ||
"identity" : "virgil-cryptowrapper-x", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/VirgilSecurity/virgil-cryptowrapper-x.git", | ||
"state" : { | ||
"branch" : "develop", | ||
"revision" : "aa65889e563b99527aefa8b53af4b769a92fbf21" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// swift-tools-version: 5.6 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "VirgilSDK", | ||
platforms: [ | ||
.macOS(.v10_11), .iOS(.v9), .tvOS(.v9), .watchOS(.v2) | ||
], | ||
products: [ | ||
.library( | ||
name: "VirgilSDK", | ||
targets: ["VirgilSDK"]), | ||
], | ||
|
||
dependencies: [ | ||
.package(url: "https://github.com/VirgilSecurity/virgil-crypto-x.git", branch: "develop") | ||
], | ||
|
||
targets: [ | ||
.target( | ||
name: "VirgilSDK", | ||
dependencies: [ | ||
.product(name: "VirgilCrypto", package: "virgil-crypto-x"), | ||
], | ||
path: "Source" | ||
) | ||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// | ||
// Copyright (C) 2015-2021 Virgil Security Inc. | ||
// Copyright (C) 2015-2022 Virgil Security Inc. | ||
// | ||
// All rights reserved. | ||
// | ||
|
@@ -34,4 +34,44 @@ | |
// Lead Maintainer: Virgil Security Inc. <[email protected]> | ||
// | ||
|
||
#import "VSSKeyEntry.h" | ||
import Foundation | ||
|
||
@objc(VSSKeyEntry) public class KeyEntry: NSObject, NSCoding { | ||
|
||
public let name: String | ||
public let value: Data | ||
public let meta: [String: String]? | ||
|
||
private enum CodingKeys: String { | ||
case name = "name" | ||
case value = "value" | ||
case meta = "meta" | ||
} | ||
|
||
public init(name: String, value: Data, meta: [String: String]?) { | ||
self.name = name | ||
self.value = value | ||
self.meta = meta | ||
} | ||
|
||
public required init?(coder: NSCoder) { | ||
self.name = coder.decodeObject(forKey: CodingKeys.name.rawValue) as! String | ||
self.value = coder.decodeObject(forKey: CodingKeys.value.rawValue) as! Data | ||
|
||
if coder.containsValue(forKey: CodingKeys.meta.rawValue) { | ||
self.meta = coder.decodeObject(forKey: CodingKeys.meta.rawValue) as? [String: String] | ||
} | ||
else { | ||
self.meta = nil | ||
} | ||
} | ||
|
||
public func encode(with coder: NSCoder) { | ||
coder.encode(self.name, forKey: CodingKeys.name.rawValue) | ||
coder.encode(self.value, forKey: CodingKeys.value.rawValue) | ||
|
||
if let meta = self.meta { | ||
coder.encode(meta, forKey: CodingKeys.value.rawValue) | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
// Lead Maintainer: Virgil Security Inc. <[email protected]> | ||
// | ||
|
||
import Foundation | ||
import VirgilCrypto | ||
|
||
/// Encryption credentials | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ | |
// Lead Maintainer: Virgil Security Inc. <[email protected]> | ||
// | ||
|
||
import Foundation | ||
import VirgilSDK | ||
import VirgilCrypto | ||
|
||
|
Oops, something went wrong.