x509

Generate base64 url-encoded X.509 format 2048-bit RSA public key with Swift?

依然范特西╮ 提交于 2019-12-01 14:04:20
问题 Working in Apple Swift for iOS. I have to generate this for the backend as it's a secure app. I'm new to security and certificates and have been searching for a day now with no results. How can I generate base64 url-encoded X.509 format 2048-bit RSA public key with swift? Any help is highly appreciated. 回答1: There's a library for handling public-private key pairs in Swift that I recently created called Heimdall, which allows you to easily export the X.509 formatted Base64 string of the public

Create RSACryptoServiceProvider object using RSA private key file in C#

ぐ巨炮叔叔 提交于 2019-12-01 12:26:43
问题 How can I properly create the RSACryptoServiceProvider object using an RSA private key file? I generated an RSA private key and exported it to a p12 file on OSX using the methods: openssl genrsa -out rsakey.pem 2048 openssl pkcs12 -export -out rsakey.p12 -inkey rsakey.pem -nocerts In my C# code, which runs on a Windows laptop, I am getting an error trying to instantiate the X509Certificate2 object so that I can grab the private key as an RSACryptoServiceProvider object out of it: var

Verify XMLDSIG chain in .NET?

心已入冬 提交于 2019-12-01 10:37:59
I'm using XMLDSIG to sign a configuration file . I'd like my CA to be able to issue keys that can be used to sign XML. I'd then like to verify that the XML was signed with a key issued by my CA. How do I get the signing certificate out of the SignedXml object? How do I follow the certificate chain back to a specific CA? Note that the public key for my CA will be stored in my executable, rather than the certificate store. Roger Lipscombe To attach arbitrary certificates to an XML-DSIG file, add an <X509Data> element . To do this in .NET, use: signedXml.KeyInfo.AddClause( new KeyInfoX509Data

How many formats of x.509 client certificate file are there?

半世苍凉 提交于 2019-12-01 09:36:57
I am working on a task which is to get the client certificate when the user sends a request to the server. I have to get the certificate and get the 3 pieces of information from the certificate: user name, user's email address and user's firm name. At first it seems quite simple to just get the "Subject CN" for user name, "Subject E" for email address and "subject OU" for the company name. But later I realise there are a lot of different CA and tools and they issue certificate in different formats. For example, some certificate does not have email address field at all in the "subject" field

How to programmatically extract information from certificate?

点点圈 提交于 2019-12-01 07:30:18
问题 I have a generated a certificate, but I would like to be able to extract the information from the certificate, as for example the country, the validity, the public key and so on. I have to compare this information retrived from the certificate with some other that I have stored in my C programe. I know that if I use a function like this it will print me the certificate information: void print_certificate(const char* cert) { X509 *x509 = NULL; BIO *i = BIO_new(BIO_s_file()); BIO *o = BIO_new

Getting Subject Alternate Names with Pkcs10CertificationRequest

懵懂的女人 提交于 2019-12-01 04:01:53
问题 I'm currently able to decode a CSR's values except for Requested Extensions, specifically X509v3 Subject Alternative Name . Here's the relevant part of my `DecodeCSR(string csr): public void DecodeCsr(string csrStr){ //getting just csr var csrChars = Regex.Replace(csrStr, @"-----[^-]+-----", "").Trim().Replace(" ", "").Replace(Environment.NewLine, "").ToCharArray(); //converting that string into a byte array byte[] csrEncode = Convert.FromBase64CharArray(csrChars, 0, csrChars.Length); /

C# Support for RSA SHA 256 signing for individual XML elements

浪子不回头ぞ 提交于 2019-12-01 00:41:57
I have encountered a blocker with the .NET Framework version 4.5 to do with signing of XML with digital signatures. My problem is based around the need to sign individual XML elements with X.509 certificate with the RSA SHA-256 algorithm. I have read many .NET posts on this topic and it appears that there is a solution originally developed in the CLR Security project RSAPKCS1SHA256SignatureDescription.cs class. RSAPKCS1SHA256SignatureDescription has of course since been incorporated into the .net runtime and as of .NET 4.5 is now available under the distributed binary System.Deployment.dll. I

Convert a X509 Public key to RSA public key

依然范特西╮ 提交于 2019-12-01 00:23:41
I have a public key in the following format -----BEGIN PUBLIC KEY----- xxxxxxxx -----END PUBLIC KEY----- I need to convert this into the following format -----BEGIN RSA PUBLIC KEY----- xxxxxxxxx -----END RSA PUBLIC KEY----- Basically, the issue is that I am working with a third party library which is written in Java. The third party library uses Java class "RSAPublicKeySpec" to generate an instance of type RSAPublicKey from a String. The String that I am supplying to this third party library is taken from a file which is in the following format: -----BEGIN PUBLIC KEY----- xxxxxxxx -----END

Sign git commit with x509 certificate in corporate environment

半城伤御伤魂 提交于 2019-11-30 23:17:02
I have learned from the documentation that it is possible to sign git tags and commits. git config --global user.signingkey 0A46826A Docs: https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work This works for GPG. Has somebody done something like this with X509 user certificates? It looks like GPG is not compatible or interchangeable with x509 pki certificates. Since this is in a corporate environment GPG is not a option. It would be great if somebody could share thoughts or experiences how this could be done with x509 certs? What would be required and what it takes to implement something

How to download an EC2 X.509 certificate with an IAM User account?

大兔子大兔子 提交于 2019-11-30 20:21:09
Through the AWS Identity and Access Management, I have a user account to the AWS account of my CTO (who is credited with some money). I wanted to use this IAM user account to set up my own instances to ssh to it and run some BeautifulSoup python scripts. However, following this tutorial , when arriving to the part where I need to go on the Security Credentials page, I can't access this page and I'm told I do not have the authorization to view it. I checked my permissions with the IAM Manager, and I have administration rights, the highest possible clearance (so it seems to me). What can I do to