private-key

Using ColdFusion to sign data for single sign-on

﹥>﹥吖頭↗ 提交于 2019-12-08 18:37:14
问题 I apologize in advance for the length of this post. I don't really know enough about this issue to properly identify what the specific problem may actually be! But at any rate, we've been making calls against our membership API to query info about our members (join dates, membership types, etc.) using steps and advice provided by @Leigh here and they have been working great! Thanks again, Leigh, our members are very happy to be able to do this! Now I want to set up single sign-on for our

SharpSSH invalid privatekey

岁酱吖の 提交于 2019-12-08 14:39:20
问题 I use SharpSSH to connect to a stfp-server. This for I need to add a privatekey-file like this: sftp.AddIdentityFile(KeyFilePath); But this throws an exception: invaid privatekey: C:\KeyFile\privatekey_2.ppk The file was created with puttygen and works with filezilla. The privatekey-type doesn't matter (SSH-1 RSA, SSH-2 RSA, SSH-2 DSA). Everytime the same result. Do you know how to handle this problem? 回答1: You have to convert your key to OpenSSH Format: Use PuttyGen to generate and convert

How to fix bad length error for DecodeRSAPrivateKey?

懵懂的女人 提交于 2019-12-08 07:21:18
问题 This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 2 years ago . I'm getting this error: Bad length Object reference not set to an instance of an object. I'm using this code: public string RSASign(string data, string PhysicalApplicationPath) { RSACryptoServiceProvider rsaCsp = LoadCertificateFile(PhysicalApplicationPath); byte[] dataBytes = System.Text.Encoding.Default.GetBytes(data); byte[] signatureBytes = rsaCsp.SignData(dataBytes, "SHA256");

PHP Creating CSR using existing private key

痴心易碎 提交于 2019-12-08 04:24:13
问题 <?php $c = $_POST['c']; $city = $_POST['city']; $cn = $_POST['cn']; $mail = $_POST['email']; $p = $_POST['pass']; echo "$c<BR>$city<br>$cn<br>$mail"; $key = $_POST['key']; $dn = array( "countryName" => "$c", "stateOrProvinceName" => ".", "localityName" => "$city", "organizationName" => ".", "organizationalUnitName" => ".", "commonName" => "$cn", "emailAddress" => "$key" //"passphase" => "$p" ); // Generate a certificate signing request $csr = openssl_csr_new($dn, $key); var_dump($csr); while

How to use private key on a PKCS#11 module instead of perivate key file for mutual-authentication in OpenSSL?

99封情书 提交于 2019-12-08 03:24:08
问题 I've a simple SSL client that uses OpenSSL library. My server requires client authentication & so I've to set client's private key stored in a password protected PEM file. I use the following code for this purpose: /* set the private key from KeyFile */ if (SSL_CTX_use_PrivateKey_file(ctx, KeyFile, SSL_FILETYPE_PEM) <= 0) { ERR_print_errors_fp(stderr); abort(); } /* verify private key */ if ( !SSL_CTX_check_private_key(ctx) ) { fprintf(stderr, "Private key does not match the public

Javascript RSA decryption using private key

≯℡__Kan透↙ 提交于 2019-12-08 02:42:25
Hello I have this script that I set in Javascript : <!DOCTYPE html> <html lang="en"> <head> <script src="jquery-1.7.2.min.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript" src="jsbn.js"></script> <script language="JavaScript" type="text/javascript" src="rsa.js"></script> <script language="JavaScript"> function encryptData(){ var pem ="-----BEGIN PUBLIC KEY-----\ MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+tii3IwzHa4i142kAB0dRVXoXA2Q8oF48UgMA\ AV54+JDED5iVyJK1s7J/xGi4U3+9sRoraE7bS19Nihs5DuYa0gsbKs/5jXOtKiw94fAtMyJTcX0d\ SzZhJKcX9vEzI27Hdu1rNFY64Ixz3KjrG1N

Java byte array to ECCPrivateKey - InvalidKeySpecException: encoded key spec not recognised

非 Y 不嫁゛ 提交于 2019-12-08 02:14:54
问题 When I try to make ECC private key from byte array, I get exception mentioned below. I have public/private keys and out signed output from C library micro-ecc/uECC.h. C used secp192r1 curve. I am trying to verify data with C generated keys in Java. How to convert byte array to private/public key? Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider()); byte[] kb = new byte[]{(byte)0x24, (byte)0xF4, (byte)0x36, (byte)0x16, (byte)0xD0, (byte)0x96, (byte)0x12, (byte)0x63,

How to use private key on a PKCS#11 module instead of perivate key file for mutual-authentication in OpenSSL?

僤鯓⒐⒋嵵緔 提交于 2019-12-07 23:16:29
I've a simple SSL client that uses OpenSSL library. My server requires client authentication & so I've to set client's private key stored in a password protected PEM file. I use the following code for this purpose: /* set the private key from KeyFile */ if (SSL_CTX_use_PrivateKey_file(ctx, KeyFile, SSL_FILETYPE_PEM) <= 0) { ERR_print_errors_fp(stderr); abort(); } /* verify private key */ if ( !SSL_CTX_check_private_key(ctx) ) { fprintf(stderr, "Private key does not match the public certificate\n"); abort(); } Now I want to know how can I establish a SSL connection using private key stored on a

How to securely deploy PPK file in WPF C# app?

孤者浪人 提交于 2019-12-07 16:58:26
I have a C# app that connects to a SFTP server to transfer log files. The app achieves this by using WinSCP .NET assembly to connect to the server. How do I securely store the .ppk private key file such that the user is not able to take this file to access the SFTP for themselves? http://winscp.net/eng/docs/library#csharp Based on the way the library reference the .ppk , it may not be possible to avoid storing the .ppk file on the local disk during run-time? Thanks in advance. There's generally no way to hide any kind of credentials that (any) application possess from the end user. You can

Private and public key separately

折月煮酒 提交于 2019-12-06 17:03:37
οκ!I want to establish a client server communication oves SSL/TLS in java. The server is multithreaded. With openssl I acted as my own CA (created private key and self-signed certificate for the authority). Now I want to create keys and certs for my server and clients which are signed from the CA I created. 1)Do I have to create certs and keys from the prompt for every single client? Or is it another "automated" way eg with a script? 2) I have seen that this code for setting up keystores private void setupClientKeyStore() throws GeneralSecurityException, IOException { clientKeyStore = KeyStore