This commit is contained in:
Max Goedjen
2022-01-01 18:03:13 -08:00
parent 56cc559a97
commit 776b4a0b97
6 changed files with 23 additions and 8 deletions

View File

@@ -1,7 +0,0 @@
import Foundation
extension Bundle {
public var agentBundleID: String {(self.bundleIdentifier?.replacingOccurrences(of: "Host", with: "SecretAgent"))!}
public var hostBundleID: String {(self.bundleIdentifier?.replacingOccurrences(of: "SecretAgent", with: "Host"))!}
}

View File

@@ -47,7 +47,7 @@ public struct OpenSSHKeyWriter {
extension OpenSSHKeyWriter {
/// Creates an OpenSSH protocol style data object, which has a length header, followed by the data payload.
/// - Parameter data: the data payload.
/// - Parameter data: The data payload.
/// - Returns: OpenSSH data.
public func lengthAndData(of data: Data) -> Data {
let rawLength = UInt32(data.count)
@@ -57,8 +57,8 @@ extension OpenSSHKeyWriter {
/// The fully qualified OpenSSH identifier for the algorithm.
/// - Parameters:
/// - algorithm: the algorithm to identify.
/// - length: the key length of the algorithm.
/// - algorithm: The algorithm to identify.
/// - length: The key length of the algorithm.
/// - Returns: The OpenSSH identifier for the algorithm.
public func curveType(for algorithm: Algorithm, length: Int) -> String {
switch algorithm {
@@ -69,8 +69,8 @@ extension OpenSSHKeyWriter {
/// The OpenSSH identifier for an algorithm.
/// - Parameters:
/// - algorithm: the algorithm to identify.
/// - length: the key length of the algorithm.
/// - algorithm: The algorithm to identify.
/// - length: The key length of the algorithm.
/// - Returns: The OpenSSH identifier for the algorithm.
private func curveIdentifier(for algorithm: Algorithm, length: Int) -> String {
switch algorithm {

View File

@@ -6,7 +6,7 @@ public class OpenSSHReader {
var remaining: Data
/// Initialize the reader with an OpenSSH data payload.
/// - Parameter data: the data to read.
/// - Parameter data: The data to read.
public init(data: Data) {
remaining = Data(data)
}

View File

@@ -3,7 +3,7 @@ import Foundation
/// The base protocol for describing a Secret
public protocol Secret: Identifiable, Hashable {
/// A user-facing string identifying the Secret
/// A user-facing string identifying the Secret.
var name: String { get }
/// The algorithm this secret uses.
var algorithm: Algorithm { get }

View File

@@ -46,7 +46,10 @@ public protocol SecretStoreModifiable: SecretStore {
/// - secret: The ``Secret`` to delete.
func delete(secret: SecretType) throws
/// Updates the name of a Secret in the store.
/// - Parameters:
/// - secret: The ``Secret`` to update.
/// - name: The new name for the Secret.
func update(secret: SecretType, name: String) throws
}