Exemplo n.º 1
0
        public void Test()
        {
            var keyFile = @"-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEAt8J9+yrN8Ue9Bo7N096YZAZdgtc7YQnDeC10F4muwQrLy5Sh9tNF
N7jzJxdiThL05gL50qM1r7kTysSj/U2tG75QD0Mei8hVKu6nZAV+J0wV/3zBhA6HIMVHWX
MpW+UISVY32YnA7R43QVRLPM2UONDS+aQ/0nL5RUpwchu5h1U3EYcn2EItQI13osXim8Mb
p2Edbublr/JnprX6hykfFiBbL4tx6aV4EItNzs0/wnUKhy7Qw1smOmBYQPc0mEV1OUlSm4
ywIEOQOu6QEGiRjp+JXe7CXrDkSRX7Cng7uNds1j6edlGA6zZgOon6MXIONf0IvsnZyzui
1XM20jDUetM7OYHRHad3MoL94qBQy7O3WD02oYfDPthCThW3k/48JV/Es1go+p63M1Hyhr
dghSamHGKORPizY6OcQsD2+s+7qaDZZSANu6NDujf2sjWu/J+lgPnTvHyvqDOXKuqA3JBx
J2O68DC094W49DMu4/YEZu12dMq2x7l2UUAsqXh1AAAFkI4cAP2OHAD9AAAAB3NzaC1yc2
EAAAGBALfCffsqzfFHvQaOzdPemGQGXYLXO2EJw3gtdBeJrsEKy8uUofbTRTe48ycXYk4S
9OYC+dKjNa+5E8rEo/1NrRu+UA9DHovIVSrup2QFfidMFf98wYQOhyDFR1lzKVvlCElWN9
mJwO0eN0FUSzzNlDjQ0vmkP9Jy+UVKcHIbuYdVNxGHJ9hCLUCNd6LF4pvDG6dhHW7m5a/y
Z6a1+ocpHxYgWy+LcemleBCLTc7NP8J1Cocu0MNbJjpgWED3NJhFdTlJUpuMsCBDkDrukB
BokY6fiV3uwl6w5EkV+wp4O7jXbNY+nnZRgOs2YDqJ+jFyDjX9CL7J2cs7otVzNtIw1HrT
OzmB0R2ndzKC/eKgUMuzt1g9NqGHwz7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hkJifJfMg2dSC4jW8lwroHhCCLU6zekAt0IJAB
GHdBtu4YbLWfzYvgE8ykkPN9Z83K2Ipeui2m6QvERu9Qs4vzNHi/02dQgs51A+Fum+m1Mw
b7/pEvZQM/8Ve8Ti/Pr/sXaegH3llwgQAAAMEA0ueBvEG+/L4MAEvccJcO5taMN9Vg0DGg
9IrzgTmKVVWgW+2fpl9QHj7O/JWcnvG4IiQpRQE5Yv/V/J8YVt9E4tdjOz1zhjrOa20bT+
2ixaJNbFkyrmL8wbCG1Bco3J/oV2QxRTeTn5Z2ofIQcFsX2BG5XoPGQQ1XLt/3Q1GB8KDc
Lep2Co+dWNF/ibWkEhxO7BKfmY+SZQzkrHUcjPal4oXcwXTlwhu2FRKBnKTjm6RmvkN+6m
2afNxPFSV9Ok31AAAAF2tleW1vb25ATEFQVE9QLVRWRTVJRlRUAQID
-----END OPENSSH PRIVATE KEY-----";
            var p       = BigInteger.Parse("1985723872942866522061210426432802109831304533292584197371859358228401672778660973360575491908285788723518056240346140818463870628133727576539634472319995514248249863379166222977677186373609305619502515273854116114305561078727334068764694773692025455209567949396867589435664113558141960877664689393121995588540891904178487160258734092731276746683173153988635168190258389322269536205494235599652112473478260258018715220625679490012166667691175324872918683373686261");
            var q       = BigInteger.Parse("2100091479195422884990548738661606981406090184547316288233540387565192719921733992831957955459165227025908076835097630246404644934615441432864960746964285133075019470100210210255716704817903907104582686984188567339487309463588232681517666503538502571941858300243464422326773658184892944152172160531421713108987842418820812528912240233647955402827834747470667131302818136808292474223571161250004432136363721893189386864396983325068146083054079706116525782132682881");
            var rsa     = RSA.CreateFromKey(new StringReader(keyFile));

            Assert.Equal(p, rsa.P);
            Assert.Equal(q, rsa.Q);
        }