Pairing fix

Fixed some incorrect SSL data structure code that was corrupting the certificate/private key data being saved in the pairing records. Fixed the device pubkey being encoded in the pairing record as "DeviceCertificate" instead of the generated certificate itself.