mirror of
https://github.com/maxgoedjen/secretive.git
synced 2024-11-22 05:27:28 +00:00
22 lines
482 B
Swift
22 lines
482 B
Swift
public protocol Secret: Identifiable, Hashable {
|
|
|
|
var name: String { get }
|
|
var algorithm: Algorithm { get }
|
|
var keySize: Int { get }
|
|
var publicKey: Data { get }
|
|
|
|
}
|
|
|
|
public enum Algorithm {
|
|
case ellipticCurve
|
|
public init(secAttr: NSNumber) {
|
|
let secAttrString = secAttr.stringValue as CFString
|
|
switch secAttrString {
|
|
case kSecAttrKeyTypeEC:
|
|
self = .ellipticCurve
|
|
default:
|
|
fatalError()
|
|
}
|
|
}
|
|
}
|