add password to self signed cert

This commit is contained in:
Luke Pulverenti
2017-05-01 16:03:27 -04:00
parent dbfb1fb370
commit fc788efa49
5 changed files with 12 additions and 4 deletions

View File

@@ -44,7 +44,7 @@ namespace Emby.Common.Implementations.Security
cb.NotAfter = notAfter;
cb.SubjectName = subject;
cb.SubjectPublicKey = subjectKey;
// signature
cb.Hash = "SHA256";
byte[] rawcert = cb.Sign(issuerKey);
@@ -60,6 +60,7 @@ namespace Emby.Common.Implementations.Security
attributes.Add(PKCS9.localKeyId, list);
p12.AddCertificate(new X509Certificate(rawcert), attributes);
p12.Password = password;
p12.AddPkcs8ShroudedKeyBag(subjectKey, attributes);
p12.SaveToFile(fileName);