public-key

Setup SFTP to use public-key authentication

☆樱花仙子☆ 提交于 2019-12-05 17:23:47
问题 How do you setup server to server SFTP to use public-key authentication instead of user account and password? 回答1: In the client you need to generate its public key and add it to server's authorized key list. The following are the commands you can use. On client machine ssh-keygen -t dsa -f id_dsa mv id_dsa* ~/.ssh/ scp ~/.ssh/id_dsa.pub USER_NAME@SERVER:~/.ssh/HOST_NAME.key On the server cat ~/.ssh/HOST_NAME.key >> ~/.ssh/authorized_keys2 回答2: Remember to chmod 700 .ssh and also chmod 600

SecKeyGetBlockSize or SecKeyRawVerify for Public Key throw EXC_BAD_ACCESS code=2

半世苍凉 提交于 2019-12-05 10:55:44
Upon trying to implement Security.Framework SecKeyRawVerify iOS function from Apple's example, programm halts with bad pointer error (EXC_BAD_ACCESS code=2). Any help or suggestions would be appreciated. Here is my code: - (BOOL)verifySignature:(NSData *)plainText signature:(NSData *)sig { size_t signedHashBytesSize = 0; OSStatus sanityCheck = noErr; SecKeyRef publicKeyA = NULL; NSMutableDictionary * queryPublicKeyA = [[NSMutableDictionary alloc] init]; NSData * publicTag = [NSData dataWithBytes:publicKeyAIdentifier length:strlen((const char *)publicKeyAIdentifier)]; // // Set the public key

RSA public key created in iOS/Swift and exported as base64 not recognized in Java

瘦欲@ 提交于 2019-12-05 06:58:34
TL;DR: RSA public key generated in iOS and stored in the keychain, exported as base64 and sent to a java backend, is not recognized. I'm implementing a chat encryption feature in an iOS app, and I'm using symmetric + asymmetric keys to handle it. Without going too much into details, at backend I use the user's public key to encrypt a symmetric key used to encrypt and decrypt messages. I created two frameworks, respectively in Swift and in Java (backend) to handle key generation, encryption, decryption, etc. I also have tests for them, so I'm 100% everything works as expected. However, it looks

What is the structure of the public key of a signed assembly in C#?

时光总嘲笑我的痴心妄想 提交于 2019-12-04 18:35:05
Using this code to retrieve the public key bytes... var pubKey = AppDomain.CurrentDomain.DomainManager.EntryAssembly .GetName().GetPublicKey(); What is this common structure at the start (first 32 bytes) of the key? It's not ASN.1 and it might not be variable. I can google it and get repeats. // 00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 Is it all reversed or just part of it (e.g. the modulus at the end)? 52 53 41 31 is a string of RSA1 . My key's modulus is 1024 bit, so I was looking for something that described the length. 0x0400 ( 00 04 B.E.) would be 1024 (bits

Could not generate ssh public key for heroku in Windows 7

不问归期 提交于 2019-12-04 16:11:58
问题 While I am trying heroku login through cmd in my machine, it says Could not find existing public key Would you like to generate one? [YN] After that when I press 'y' and enter it says Generating new ssh public key Could not generate key: "ssh-keygen" is not recognized as a internal or external command operable program or batch file Please help me. 回答1: Heroku toolbelt includes git distribution which includes the required ssh-keygen.exe . I've just found it in C:\Program Files\git\bin . Locate

Get public Key from imported certificate in Keystore with Java

爱⌒轻易说出口 提交于 2019-12-04 16:00:51
I have created and downloaded a certificate from sales force , as per the instructions in PicketLink document . I downloaded the certificate and its name is mysample.crt and I imported the certificate into a keysotre. keytool -import -file mysample.crt -keystore keystore.jks -alias salesforce-idp To check, I exported the public key also keytool -export -alias salesforce-idp -keystore keystore.jks -rfc -file public.cert I have a Java code to get the Public Key, but it is not working. This is my Code package com.sample.keystore; import java.io.File; import java.io.FileInputStream; import java

WinSCP .NET library: Connect to SFTP server without specifying SSH host key fingerprint

一个人想着一个人 提交于 2019-12-04 15:01:21
In the current stable release of WinSCP, it seems that using SshHostKeyFingerprint is mandatory and there are no ways to connect to SFTP server without that in SessionOptions . I can see that the ability to bypass is added to the beta (5.2) but I was wondering whether or not it's possible to connect without this fingerprint. First, make sure you understand that you give-up any security , when you try to bypass SSH host key check. You effectively lose a protection against man-in-the-middle attacks . Anyway, you can use use SessionOptions.GiveUpSecurityAndAcceptAnySshHostKey . It's NOT

What does PackageInfo.signatures return?

笑着哭i 提交于 2019-12-04 12:41:43
Why there are multiple signatures in this value? Are these values the public key of the package? Can I uniquely identify a package using this signature instead of reading the files under META-INF, or calculating an MD5 on the whole APK file? According to @hackbod, this is all the public keys the APK was signed with Despite its name, the contents of PackageInfo.signatures is the public keys your app is signed with. This absolutely, positively does not change between builds. This is the pure identify of the developer of the app. Reference: https://groups.google.com/d/msg/android-developers

How to setup multiple ssh identities for single hg repository?

霸气de小男生 提交于 2019-12-04 12:24:05
问题 I am using ssh publickey authentication for my mercurial repository. So I have: [ui] ssh = ssh -i ~/.ssh/id_rsa -C in my .hgrc. This works fine and allows me to push/pull to an ssh-authenticated repo. However, I want to be able to push/pull to another repo that requires a different identity. How can I configure my .hgrc file so the identity is tied to a particular path. I guess I'd want something like: [ui] one.prefix = someserver.com one.ssh = ssh -i ~/.ssh/id_rsa -C two.prefix = otherserver

Location of container for public and private keys in Windows?

…衆ロ難τιáo~ 提交于 2019-12-04 11:13:46
问题 I am trying to store my public and private keys in a container using following code: CspParameters cp = new CspParameters(); cp.KeyContainerName = "Test"; RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(cp); What I'd like to know is the location of the container. Is the location of the container in the file system? 回答1: You'll find the key files in the following directory (*): Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), @"Microsoft