x509certificate

Azure Web Application new X509Certificate2() causing System.Security.Cryptography.CryptographicException: Access denied

ⅰ亾dé卋堺 提交于 2019-12-23 20:03:22
问题 Right now I am uploading a .pfx file, taking in a password and calling var cert = new X509Certificate2(fileData, password); And storing things like the thumbprint, etc. I do not need to actually store this on the server, just validate that it is a valid cert and store some information. On local this works (obviously I have better access to my key store) but when I put it up in azure I get the error: System.Security.Cryptography.CryptographicException: Access denied. Is there any way to get

How to make WCF Client conform to specific WS-Security

六眼飞鱼酱① 提交于 2019-12-23 19:17:57
问题 I must make my WCF Client consume a web service (IBM DataPower) and sign/encrypt the request using Web Services Security X.509 Certificate Token Profile 1.1 OASIS Standard Specification, 1 February 2006. So far I have created a custom binding and "think" I am working along the right lines: Updated to reflect latest attempt Private Function CreateCustomBinding() As Channels.Binding Dim asbe As New Channels.AsymmetricSecurityBindingElement asbe.MessageSecurityVersion = MessageSecurityVersion

How safe is my custom SSL verification logic to handle excepted RemoteCertificateNameMismatch?

落花浮王杯 提交于 2019-12-23 18:34:15
问题 I try to upload a file to my domain https://vault.veodin.com/ which is hosted at webfaction.com When you open this url, the browser warns you about the name mismatch, because the SSL certificate is issued for webfaction.com and not for veodin.com Accordingly a sslPolicyError System.Net.Security.SslPolicyErrors.RemoteCertificateNameMismatch occurs when I try to upload a file to this domain using .Net WebClient. For my purpose it's enough to be sure that the upload target is hosted at *

What is the implication of not using X509Store.Close method?

旧时模样 提交于 2019-12-23 18:31:12
问题 If I keep initializing X509Store certificate stores and don't use their Close() method, what is the implication of this? In the code example given in documentation, they don't use try..finally block to make a call to Close method. If this certificate store is something that needs to be freed, why does not the API of the class designed to derive from IDisposable or why does not this class have a implicit destructor called when object goes out of scope? 回答1: In .NET 4.6, X509Store was modified

Securely storing (encrypting) data in an ASP.Net application

谁说胖子不能爱 提交于 2019-12-23 17:15:47
问题 I have an asp.net application, accessed by people over the internet using web browsers. It runs on a web server and it talks to a backend database. Some of the users would like to use the application to store some private data. The requirements of this are: 1) Only the user who stored the data should be able to see it. 2) The developers/dbas should not be able to see the data. 3) If the web server and database server were compromised a hacker must not be able to decrypt the data. So, it's

Can using self-signed certificates with WCF be secure?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-23 12:33:15
问题 Imagine for a moment that we're using classic asymmetric encription with WCF (private/public key pairs). Obviously it's secure until private keys aren't stolen. We don't need any trust chains between keys, right? Client only needs to know its server's public key and vice versa. A problem arises only if client doesn't know server's public key in advance and gets it on the first access. Here we have a risk that actual server is a "man-in-the-middle" instead of the real server. Here we need

Getting root and intermediate certificates from an end-entity

£可爱£侵袭症+ 提交于 2019-12-23 12:27:02
问题 still being a noob in cryptography I stumble upon simple things every day. And today is just one of those days. I want to validate smime messages in java with the bouncy castle library, and I think I almost figured it out, but the problem at this moment is the building of the PKIXparameters object. Let's say, I have an end-entity x509certificate with the following structure: root certificate +->intermediate certificate +->end-entity certificate In order to validate message I need to build a

Why do I get an Access Denied error when creating an X509Certificate2 object?

假装没事ソ 提交于 2019-12-23 08:49:58
问题 We have some unit tests which have PFX certificates embedded in them. These certificates are read during test execution and turned into X509Certificate2 objects. Unfortunately, when run as an unprivileged user, we get Access Denied exceptions: using (var s = EmbeddedResourceUtilities.GetEmbeddedResourceAsStream(typeThatContainsEmbeddedResource, certFileName)) { if (s == null) { throw new ApplicationException(String.Format("Embedded certificate {0} for type {1} not found.", certFileName,

Using self-signed certificates

丶灬走出姿态 提交于 2019-12-23 03:49:29
问题 I have this code: X509Chain x509Chain = new X509Chain(); x509Chain.ChainPolicy.ExtraStore.Add(certificate1); x509Chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; x509Chain.ChainPolicy.RevocationFlag = X509RevocationFlag.ExcludeRoot; x509Chain.Build(certificate2); foreach (X509ChainElement x509ChainElement in x509Chain.ChainElements) { Log("Name: " + x509ChainElement.Certificate.GetNameInfo(X509NameType.SimpleName, false)); foreach (X509ChainStatus x509ChainStatus in

Reading and Verifying Certificates

只谈情不闲聊 提交于 2019-12-23 03:22:32
问题 Hi I have two certificates, i.e mycert.crt and root.crt. and I need to verfiy if my certificate is signed by root certificate. I am using the following code to do so using the following code but I am getting an error Segmentation fault (core dumped) static int verifyCerti (BYTE *cert1, BYTE *cert2, int certlenght1, int certlenght2); int main (int ac, char **av) { FILE *f_in, *f_in2; BYTE *certBuf, *certBuf2; UINT32 certBufLen,certBufLen2; UINT32 certLen,certLen2; int result; ////////////