openssl rsa -in rsa_private.pem -modulus
C# 에서 modulus 로드하려면
리소스에 RSA_PublicKey 라는 이름으로 텍스트 파일을 하나 추가해주고 256바이트 길이의 HEX코드로 된 Modulus를 넣어준뒤 다음코드 이용해서 로딩
E 값은 0x10001 (65537)
// 공개키 로드
RSAParameters RSAKeyInfoP = new RSAParameters();
RSAKeyInfoP.Exponent = new byte[3];
RSAKeyInfoP.Modulus = new byte[128];
RSAKeyInfoP.Exponent[0] = 1;
RSAKeyInfoP.Exponent[1] = 0;
RSAKeyInfoP.Exponent[2] = 1;
for (int i = 0; i < 128; i++)
{
string strCurrentByte = Resource1.RSA_PublicKey.Substring(i * 2, 2);
RSAKeyInfoP.Modulus[i] = (byte)Convert.ToInt32(strCurrentByte, 16);
}
encrypt 시에 패딩파라미터는 false 로 놓아서 RSA PKC#1 PADDING 을 적용