Generating a keypair using the crypto/rsa package is trivial, but declaring it yourself is a pain.
I'm trying to declare a variable of type rsa.PublicKey, which is defined as:
type PublicKey struct {
N *big.Int // modulus
E int // public exponent
}
I've tried a hundred and three methods, but my code currently looks like:
PublicKey := new(rsa.PublicKey)
PublicKey.N = 816296297763124917516388440338759500423535395290623239231731567955308683122890408110917894172120047293936355563865250296188045077627313515614945465389856882915690164742049821466713295090362914686221827012330520911241180940331170800129566133563943306086709509374426793735798983196271063876215936717347200817820685489907456621846519078704338901417077754153251584919148131668369473222078960469749879767829241702858598298315759777245767370065542249841401685747514693845945420663931515035586797756896017462499826100826469085345198490755785708882569397123671313993933597159332140624225622926365258472081852103795720495728779491860405409429756519754432759030127289255409541378096471189783136441306888685144178712329637014132885623358066824356187044819578205172698506597932578231190886063535262514544569054747443504586895362356519252402500104155389876467086444850150261677007183689594568339805440756958346151465691221654766132846717117978938197863452998630570321897641091974200100764524637808876854013287571133384735164135339783262769321526997252096927500094807456840263828514476848496064212933462545940124330314474126636272733109787671957872657823289210871868354885730638093964892263227561606744192311648252923260065974092128743259979645799
PublicKey.E = 65537
I get this error:
./main.go:21: constant too large: 816296297763124917516388440338759500423535395290623239231731567955308683122890408110917894172120047293936355563865250296188045077627313515614945465389856882915690164742049821466713295090362914686221827012330520911241180940331170800129566133563943306086709509374426793735798983196271063876215936717347200817820685489907456621846519078704338901417077754153251584919148131668369473222078960469749879767829241702858598298315759777245767370065542249841401685747514693845945420663931515035586797756896017462499826100826469085345198490755785708882569397123671313993933597159332140624225622926365258472081852103795720495728779491860405409429756519754432759030127289255409541378096471189783136441306888685144178712329637014132885623358066824356187044819578205172698506597932578231190886063535262514544569054747443504586895362356519252402500104155389876467086444850150261677007183689594568339805440756958346151465691221654766132846717117978938197863452998630570321897641091974200100764524637808876854013287571133384735164135339783262769321526997252096927500094807456840263828514476848496064212933462545940124330314474126636272733109787671957872657823289210871868354885730638093964892263227561606744192311648252923260065974092128743259979645799
./main.go:21: overflow in constant
./main.go:21: cannot use 0 (type int) as type *big.Int in assignment
Any help?