mirror of
https://github.com/maxgoedjen/secretive.git
synced 2025-08-31 01:20:57 +00:00
* WIP. * WIP * WIP Edit * Key selection. * WIP * WIP * Proxy through * WIP * Remove verify. * Migration. * Comment * Add param * Semi-offering key * Ignore updates if test build. * Fix rsa public key gen * Messily fix RSA * Remove 1024 bit rsa * Cleanup * Cleanup * Clean out MLDSA refs for now * Dump notifier changes * Put back UI tweaks * Fixes.
24 lines
623 B
Swift
24 lines
623 B
Swift
import Foundation
|
|
|
|
extension Data {
|
|
|
|
/// Creates an OpenSSH protocol style data object, which has a length header, followed by the data payload.
|
|
/// - Returns: OpenSSH data.
|
|
package var lengthAndData: Data {
|
|
let rawLength = UInt32(count)
|
|
var endian = rawLength.bigEndian
|
|
return Data(bytes: &endian, count: UInt32.bitWidth/8) + self
|
|
}
|
|
|
|
}
|
|
|
|
extension String {
|
|
|
|
/// Creates an OpenSSH protocol style data object, which has a length header, followed by the data payload.
|
|
/// - Returns: OpenSSH data.
|
|
package var lengthAndData: Data {
|
|
Data(utf8).lengthAndData
|
|
}
|
|
|
|
}
|