How to sign string with private key

I guess what you say is you know the key pair before hand and want to sign/verify with that. Please see the following code. import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; import java.security.Signature; import sun.misc.BASE64Encoder; public class MainClass { public static void main(String[] args) throws Exception { KeyPair keyPair = getKeyPair(); byte[] data = “test”.getBytes(“UTF8”); Signature … Read more

Setting up OpenSSH for Windows using public key authentication

Following are setup steps for OpenSSH shipped with Windows 10 v.1803 (April 2018 update. See comments to this post, it might not work with 1809). Server setup (elevated powershell): Install OpenSSH server: Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0. Start agent and sshd services: Start-Service ssh-agent; Start-Service sshd (this will generate host keys and default configuration automatically in … Read more

Getting the PublicKeyToken of .Net assemblies [duplicate]

Open a command prompt and type one of the following lines according to your Visual Studio version and Operating System Architecture : VS 2008 on 32bit Windows : “%ProgramFiles%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe” -T <assemblyname> VS 2008 on 64bit Windows : “%ProgramFiles(x86)%\Microsoft SDKs\Windows\v6.0A\bin\sn.exe” -T <assemblyname> VS 2010 on 32bit Windows : “%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\sn.exe” -T <assemblyname> VS 2010 on … Read more