Hi,
usually you would do it by storing the data representation of the key like this (working code, beta 3):
let key = P256.Signing.PrivateKey()
let keyData = key.x963Representation
// Store the data in the key chain
print("--- Org Key data ---")
print(keyData.base64EncodedString())
// Load the data from the keychain
let keyFromData = try? P256.Signing.PrivateKey(x963Representation: keyData)
if let keyFromData = keyFromData {
print("--- Loaded Key data ---")
print(keyFromData.x963Representation.base64EncodedString())
}
But it it looks like that Curve25519 does not support key data represntation yet. Maybe this will come in a later Beta.