I am storing a openssl private Key EVP_PKEY as nsdata. For this I am serializing into a byte stream using the code below
unsigned char *buf, *p; int len; len
Swift 5:
String(data: data!, encoding: String.Encoding.utf8)