secretive/SecretAgentKit/SigningRequestProvenance.swift

46 lines
899 B
Swift
Raw Normal View History

2020-03-17 07:56:55 +00:00
import Foundation
import AppKit
public struct SigningRequestProvenance {
public var chain: [Process]
public init(root: Process) {
self.chain = [root]
}
}
extension SigningRequestProvenance {
public var origin: Process {
chain.last!
}
2020-03-18 06:28:51 +00:00
public var intact: Bool {
return chain.reduce(true) { $0 && $1.validSignature }
}
2020-03-17 07:56:55 +00:00
}
extension SigningRequestProvenance {
public struct Process {
public let pid: Int32
public let name: String
public let path: String
2020-03-18 05:59:03 +00:00
public let validSignature: Bool
2020-03-17 07:56:55 +00:00
let parentPID: Int32?
2020-03-18 05:59:03 +00:00
init(pid: Int32, name: String, path: String, validSignature: Bool, parentPID: Int32?) {
2020-03-17 07:56:55 +00:00
self.pid = pid
self.name = name
self.path = path
2020-03-18 06:28:51 +00:00
self.validSignature = validSignature
2020-03-17 07:56:55 +00:00
self.parentPID = parentPID
}
}
}