草庐IT

x509certificate2

全部标签

c# - Azure 网站中的站点无法处理 X509Certificate2

我在Azure网站(不是托管服务)中有站点,我需要在那里处理带有私钥的.pfx证书。varx509Certificate2=newX509Certificate2(certificate,password);但我遇到了以下异常:System.Security.Cryptography.CryptographicException:Thesystemcannotfindthefilespecified.atSystem.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32hr)atSy

c# - 从 PKCS#12 字节数组构建 X509Certificate2 如何抛出 CryptographicException ("The system cannot find the file specified.")?

我试图从一个字节数组中的PKCS#12blob构造一个X509Certificate2并得到一个相当令人费解的错误。此代码在具有WindowsXP管理员权限的桌面应用程序中运行。堆栈跟踪如下,但我在尝试排除故障时迷路了,因为_LoadCertFromBlob被标记为[MethodImpl(MethodImplOptions.InternalCall)]。System.Security.Cryptography.CryptographicException:Thesystemcannotfindthefilespecified.atSystem.Security.Cryptography

c# - 是否可以仅使用 C# 以编程方式生成 X509 证书?

我们正在尝试使用C#和BouncyCastle以编程方式生成X509证书(包括私钥)图书馆。我们尝试使用thissamplebyFelixKollmann中的一些代码但证书的私钥部分返回null。代码和单元测试如下:usingSystem;usingSystem.Collections;usingOrg.BouncyCastle.Asn1;usingOrg.BouncyCastle.Asn1.X509;usingOrg.BouncyCastle.Crypto;usingOrg.BouncyCastle.Crypto.Generators;usingOrg.BouncyCastle.Cr

c# - X509 证书未在服务器上加载私钥文件

我正在使用GoogleAnalyticsAPI,我按照这个SO问题来设置OAuth:https://stackoverflow.com/a/13013265/1299363这是我的OAuth代码:publicvoidSetupOAuth(){varCert=newX509Certificate2(PrivateKeyPath,"notasecret",X509KeyStorageFlags.Exportable);varProvider=newAssertionFlowClient(GoogleAuthenticationServer.Description,Cert){Service

c# - X509证书构造函数异常

//certisanEFEntityand//cert.CertificatePKCS12isabyte[]withthecertificate.varcertificate=newX509Certificate(cert.CertificatePKCS12,"SomePassword");从我们的数据库加载证书时,在我们的暂存服务器(Windows2008R2/IIS7.5)上,我们得到这个异常:System.Security.Cryptography.CryptographicException:Aninternalerroroccurred.atSystem.Security.C

c# - X509Store Certificates.Find FindByThumbprint 问题

我在使用X509Store.Certificates.Find方法时遇到问题publicstaticX509Certificate2FromStore(StoreNamestoreName,StoreLocationstoreLocation,X509FindTypefindType,stringfindValue){X509Storestore=newX509Store(storeName,storeLocation);store.Open(OpenFlags.ReadOnly);try{//findValue="7a6fa503ab57b81d6318a51ca265e739a51

c# - "The remote certificate is invalid according to the validation procedure."使用 Gmail SMTP 服务器

我收到这个错误:Theremotecertificateisinvalidaccordingtothevalidationprocedure.每当我尝试在我的C#代码中使用Gmail的SMTP服务器发送电子邮件时。有人可以指出解决此问题的正确方向吗?以下是堆栈跟踪...atSystem.Net.Security.SslState.StartSendAuthResetSignal(ProtocolTokenmessage,AsyncProtocolRequestasyncRequest,Exceptionexception)atSystem.Net.Security.SslState.C

go - 如何从 Go 中的 http 客户端获取 x509 证书

我已经查看了https://golang.org/pkg/上的文档但无法建立此连接。我正在像这样创建一个客户端和请求(删除了错误处理):client:=http.Client{CheckRedirect:func(req*http.Request,via[]*http.Request)error{returnhttp.ErrUseLastResponse},}req,reqErr:=http.NewRequest(requestMethod,requestUrl,nil)resp,clientErr:=client.Do(req)我需要一个x509.Certificate来读取从服务器

ssl - ListenAndServerTLS 一直失败,错误为 : failed to find any PEM data in certificate input

我从Godaddy为网站购买了SSL证书。我在服务器中添加文件并运行该服务,它只返回一个错误:failedtofindanyPEMdataincertificateinput我使用cat生成了一个包含所有文件的server.pem文件,甚至添加了一个他们为G2证书链提供的godaddypem中间pem文件,什么也没有。catgenerated-private-key.txt>server.pemcat678f65b8a7391017.crt>>server.pemcatgd_bundle-g2-g1.crt>>server.pemcatgdig2.crt.pem>>server.pem

go - x509 CheckSignature 参数

在x509库中,有一个名为CheckSignature的函数。我有点不知道要将什么传递给signed。它应该是什么?函数是func(c*Certificate)CheckSignature(algoSignatureAlgorithm,signed,signature[]byte)(errerror)https://golang.org/src/crypto/x509/x509.go?s=21660:21759#L623我想强调的另一件事是,如果我使用与证书关联的私钥签署某些内容,该签名是否会通过此CheckSignature函数? 最佳答案