x509

WCF username without certificate

百般思念 提交于 2019-11-28 20:56:44
I'm working on a project where I need the following. WCF service on the server side (.NET 3.5) WPF client for the client side (.NET 3.0) I have an existing application that I have to use the authentication and authorization from (on the server side). I also need to store some metadata about the user in the WCF Service's Thread Principal (a site object). I do this so that I can get at it in the WCF service if I absolutely have to; some business logic may require it. So my plan was to do the following... Create a custom ServiceAuthorizationManager for the server and in there I will log in the

Sign JAX-WS SOAP request

泄露秘密 提交于 2019-11-28 19:20:33
I would like to write a JAX-WS web service that signs my SOAP messages using the http://www.w3.org/TR/xmldsig-core/ recommendation. With what I found on the internet I wrote a JAX-WS handler ( SOAPHandler<SOAPMessageContext> ) that manages to change a copy of the SOAP request: @Override public boolean handleMessage(SOAPMessageContext smc) { Boolean outboundProperty = (Boolean) smc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY); SOAPMessage message = smc.getMessage(); if (outboundProperty) { try { SOAPPart soapPart = message.getSOAPPart(); SOAPEnvelope soapEnvelope = soapPart.getEnvelope();

C# How can I validate a Root-CA-Cert certificate (x509) chain?

杀马特。学长 韩版系。学妹 提交于 2019-11-28 17:57:31
Let's say I have three certificates (in Base64 format) Root | --- CA | --- Cert (client/signing/whatever) How can I validate the certs and certificate path/chain in C#? (All those three certs may not be in my computer cert store) Edit : BouncyCastle has the function to verify. But I'm trying not to use any third-party library. byte[] b1 = Convert.FromBase64String(x509Str1); byte[] b2 = Convert.FromBase64String(x509Str2); X509Certificate cer1 = new X509CertificateParser().ReadCertificate(b1); X509Certificate cer2 = new X509CertificateParser().ReadCertificate(b2); cer1.Verify(cer2.GetPublicKey()

X.509 Certificate validation with Java and Bouncycastle

回眸只為那壹抹淺笑 提交于 2019-11-28 17:36:38
through the bouncycastle wiki page I was able to understand how to create a X.509 root certificate and a certification request, but I do not quite understand how to proceed concept- and programming wise after that. Lets assume party A does a cert request and gets his client certificate from the CA. How can some party B validate A's certificate? What kind of certificate does A need? A root certificate? A 'normal' client certificate? And how does the validation work on programming level, if we assume that A has successfully send his certificate in DER or PEM format to B? Any help is much

X.509: Private / Public Key

家住魔仙堡 提交于 2019-11-28 17:15:32
We're trying to implement some functionality of a Web-Service from one of our partners. Now, the content which is beeing transmitted, should be encrypted with a public key, which we have to provide. The security-specification says that the public-certificate has to be X.509 standard. Doesn't X.509 rely on the private / public key method? Because I only get one .pem file, containing a private key, and a certificate, but no public key, using the following command: openssl req -new -x509 -days 365 -nodes -out ./cert.pem -keyout ./cert.pem Do I have to modify the command in order to create a

How do I get public key hash for SSL pinning?

五迷三道 提交于 2019-11-28 17:07:35
问题 How would I get the hash of a public certificate's info to be able to perform SSL Pinning in my application? I am using TrustKit in my iOS application and it is asking for me to set the hash that I am expecting. Where can I get this from? 回答1: If it is a public website, you can use SSL Labs server test which computes and displays the pin. The Public Key Pinning page over at the Mozilla Developer Network also has commands for obtaining the pin from a key file, a certificate signing request, a

Certificate subject X.509

[亡魂溺海] 提交于 2019-11-28 15:34:54
According to the X.509, a certificate has an attribute subject. C=US, ST=Maryland, L=Pasadena, O=Brent Baccala, OU=FreeSoft, CN=www.freesoft.org/emailAddress=baccala@freesoft.org This is the typical subject value. The question is what are the types(or tags) of those attributes(C, ST, L, O, OU, CN) and what is their format? Mathias Brossard IETF PKIX (latest version RFC 5280 ) is a well accepted profile for certificates. From section 4.1.2.4, the following fields must be supported (I've added between parenthesis is the OpenSSL long and optional short name): country (countryName, C),

how to get the Keyusage value from the X509 certificate?

限于喜欢 提交于 2019-11-28 09:27:45
问题 I want to retrieve the Key usage value from the X509 structured certificate , i tried the following code X509* lcert=NULL; lCert=PEM_read(filename); // function will return the certificate in X509 unsigned long lKeyusage= lCert->ex_kusage; When i print the lKeyusage value .. some times i get 128 ... sometimes i get 0 for the same certificate .. Can any one tell me what is the error .? If i am doing wrong please give me some sample code or Correct API .. 回答1: I think the easiest way is to use

iPhone RSA algorithm with modulus and exponent [duplicate]

99封情书 提交于 2019-11-28 08:52:11
问题 This question already has an answer here : RSA Encryption public key? (1 answer) Closed 6 years ago . I have modulus and exponent. How can I encode/decode data with RSA algotithm on iPhone? Or how can I generate DER format from modulus and exponent? 回答1: If you want to generate DER data on the iPhone, I have code on GitHub that will let you do this: https://github.com/StCredZero/SCZ-BasicEncodingRules-iOS SCZ-BasicEncodingRules-iOS Implementation of Basic Encoding Rules to enable import of

How to create a digital certificate and export to .p12 file in PHP?

会有一股神秘感。 提交于 2019-11-28 05:15:23
问题 How to create a digital certificate and export to .p12 file in PHP? I want the .p12 file to have private key included. And also want to check whether the key pair is already issued (logged in database). I found a function called 'openssl_pkcs12_export_to_file' but don't know where to start. Seems that I need an X509 cert and a private key first. 回答1: <?php error_reporting(-1); function dump($Var) { echo "<hr/><pre>"; var_dump($Var); echo "</pre><hr/>"; } function check_errors() { echo "<hr/>