secretive/Sources/Packages/Sources/SecretAgentKit/SSHAgentProtocol.swift

44 lines
1.3 KiB
Swift
Raw Normal View History

2020-03-04 07:14:38 +00:00
import Foundation
/// A namespace for the SSH Agent Protocol, as described in https://tools.ietf.org/id/draft-miller-ssh-agent-01.html
2020-03-04 07:14:38 +00:00
public enum SSHAgent {}
extension SSHAgent {
/// The type of the SSH Agent Request, as described in https://tools.ietf.org/id/draft-miller-ssh-agent-01.html#rfc.section.5.1
2020-03-04 07:14:38 +00:00
public enum RequestType: UInt8, CustomDebugStringConvertible {
2020-03-04 07:14:38 +00:00
case requestIdentities = 11
case signRequest = 13
public var debugDescription: String {
switch self {
case .requestIdentities:
return "RequestIdentities"
2020-03-24 06:22:22 +00:00
case .signRequest:
2020-03-04 07:14:38 +00:00
return "SignRequest"
}
}
}
/// The type of the SSH Agent Response, as described in https://tools.ietf.org/id/draft-miller-ssh-agent-01.html#rfc.section.5.1
2020-03-04 07:14:38 +00:00
public enum ResponseType: UInt8, CustomDebugStringConvertible {
2020-03-04 07:14:38 +00:00
case agentFailure = 5
case agentIdentitiesAnswer = 12
case agentSignResponse = 14
public var debugDescription: String {
switch self {
case .agentFailure:
return "AgentFailure"
case .agentIdentitiesAnswer:
return "AgentIdentitiesAnswer"
case .agentSignResponse:
return "AgentSignResponse"
}
}
}
}