System.Security.Cryptography.X509Certificates.X509Certificate.CreateFromSignedFile C# (CSharp) Method

CreateFromSignedFile() public static method

public static CreateFromSignedFile ( string filename ) : System.Security.Cryptography.X509Certificates.X509Certificate
filename string
return System.Security.Cryptography.X509Certificates.X509Certificate
        public static System.Security.Cryptography.X509Certificates.X509Certificate CreateFromSignedFile(string filename)
        {
            throw null;
        }

Same methods

X509Certificate::CreateFromSignedFile ( string filename ) : X509Certificate

Usage Example

Exemplo n.º 1
0
        public Task <PersonalCertificate> GetCertificateFromMsix(string msixFile, CancellationToken cancellationToken = default, IProgress <ProgressData> progress = null)
        {
            if (string.IsNullOrEmpty(msixFile))
            {
                throw new ArgumentNullException(nameof(msixFile));
            }

            return(Task.Run(
                       () =>
            {
                try
                {
                    var x509 = X509Certificate.CreateFromSignedFile(msixFile);
                    return CreateFromX509(x509, CertificateStoreType.File);
                }
                catch (Exception e)
                {
                    // This will be probably WindowsCryptographicException but we do not want to expose too much...
                    Logger.Debug("Selected file {0} is not signed and no certificate could be exported from it (exception of type {1}).", msixFile, e.GetType().Name);
                    return null;
                }
            },
                       cancellationToken));
        }
All Usage Examples Of System.Security.Cryptography.X509Certificates.X509Certificate::CreateFromSignedFile