Skip to content

Instantly share code, notes, and snippets.

View bupt-wenxiaole's full-sized avatar
🎯
Focusing

xiaolewen bupt-wenxiaole

🎯
Focusing
  • Microsoft
  • Beijing
View GitHub Profile
@ststeiger
ststeiger / RSAKeys.cs
Created October 25, 2018 11:29 — forked from therightstuff/RSAKeys.cs
Import and export RSA Keys between C# and PEM format using BouncyCastle
using Org.BouncyCastle.Crypto;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.OpenSsl;
using Org.BouncyCastle.Security;
using System;
using System.IO;
using System.Security.Cryptography;
namespace MyProject.Data.Encryption
{
@nanasess
nanasess / Jwks.cs
Created August 8, 2017 01:04
RSA public key to JWKs(JSON Web Key Set) for C#
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using Microsoft.IdentityModel.Tokens;
using Newtonsoft.Json;
using Org.BouncyCastle.Crypto.Parameters;
using Org.BouncyCastle.OpenSsl;
namespace TestCommands
@bcho
bcho / socket.go
Created January 26, 2014 16:25
A simple multiple broadcast server written in Go.
package main
import (
"fmt"
"net"
)
const MSG_SIZE = 512
type SocketServerHandler func (*SocketServer, net.Conn)
@bortzmeyer
bortzmeyer / gist:1284249
Created October 13, 2011 13:42
The only simple way to do SSH in Python today is to use subprocess + OpenSSH...
#!/usr/bin/python
# All SSH libraries for Python are junk (2011-10-13).
# Too low-level (libssh2), too buggy (paramiko), too complicated
# (both), too poor in features (no use of the agent, for instance)
# Here is the right solution today:
import subprocess
import sys