Skip to content

Instantly share code, notes, and snippets.

View soledue's full-sized avatar

Ivailo Kanev soledue

View GitHub Profile
https://developers.italia.it/it/spid/
https://github.com/italia/spid-android-sdk
https://github.com/italia/spid-ios-sdk
@soledue
soledue / Bundle+extension.swift
Last active December 7, 2020 14:31
Bundle + extension
extension Bundle {
func decode<T: Decodable>(_ type: T.Type, from file: String, dateDecodingStrategy: JSONDecoder.DateDecodingStrategy = .deferredToDate, keyDecodingStrategy: JSONDecoder.KeyDecodingStrategy = .useDefaultKeys) -> T {
guard let url = self.url(forResource: file, withExtension: nil) else {
fatalError("Failed to locate \(file) in bundle.")
}
guard let data = try? Data(contentsOf: url) else {
fatalError("Failed to load \(file) from bundle.")
}
@soledue
soledue / getPublicKey
Created December 23, 2020 12:20
extract public key from host
openssl s_client -servername www.google.com -connect www.google.com:443 | openssl x509 -pubkey -noout | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64