hello
to store certificate it could be done as follow
byte[] certData = (byte[]) r.Properties["userCertificate"][0];
X509Certificate cert = new X509Certificate(certData);
r.Properties["userCertificate"].Clear();
r.CommitChanges();
r.Properties["userCertificate"].Add(cert.GetRawCertData());
r.CommitChanges();
I hope that it would help and that was what you were looking for