Posts

Post not yet marked as solved
0 Replies
760 Views
Hi every one. we are using .net to create push package, our certificate is expiring soon, so we decided to get the new one, after downloading it we dont G4 authority error on keychain, we installed that and after that make new .p12 certificate and replaced it inside our code. after replacing it, is giving error signature verification failed, no clues onn that, i am attaching my sample code which was working with old certificate. var cert = _contentService                .GetCertificate(Path.Combine("apple-certs", "safari-web-push.p12"),                    password,                    X509KeyStorageFlags.MachineKeySet); // I'm not sure it's possible we have to add | X509KeyStorageFlags.EphemeralKeySet for Windows, I didn't check it              var content = new ContentInfo(manifestJson);            var signedMessage = new SignedCms(content);              var cmsSigner = new CmsSigner(cert);            cmsSigner.IncludeOption = X509IncludeOption.EndCertOnly;// Use if Error: A certificate chain could not be built to a trusted root authority.              signedMessage.ComputeSignature(cmsSigner);              byte[] result = signedMessage.Encode();            return result; this is the function to make signature
Posted
by m_h_a3456.
Last updated
.